Guides

    MCP

    Connect an AI agent over Model Context Protocol — API key or OAuth.

    DocDealer speaks Model Context Protocol, so an AI agent can author templates and produce documents directly. One endpoint, two ways to authenticate, and the tool catalogue below.

    The endpoint

    Everything goes through a single JSON-RPC endpoint:

    endpoint
    POST https://thedocdealer.com/api/mcp

    It is stateless: no session id, no resumability, no server-initiated streams. GET and DELETE return 405 by design.

    Authenticating

    Simplest, and right for a service you control. Mint a key with the mcp:tools scope (see Authentication) and send it as a bearer.

    client config
    {
      "mcpServers": {
        "docdealer": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote",
            "https://thedocdealer.com/api/mcp",
            "--header",
            "Authorization: Bearer dd_live_xxxxxxxxxxxx"
          ]
        }
      }
    }

    Or call it directly:

    curl
    curl -X POST https://thedocdealer.com/api/mcp \
      -H "Authorization: Bearer $DOCDEALER_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

    Missing the scope returns HTTP 403 with a JSON-RPC error body (code -32001), not the usual { "error": … } shape.

    Tools

    37 tools, grouped by what you would reach for them to do.

    Getting oriented
    • get_instructions
    • whoami
    • get_document_generation_skill
    • get_template_authoring_skill
    • list_templates
    • get_template
    Documents
    • create_document
    • get_document
    • get_document_context
    • update_document_form
    • validate_document
    • export_document
    • get_document_url
    Generation
    • generate_section
    • generate_all_sections
    • generate_document
    Attachments
    • create_attachment_upload_url
    • upload_attachment
    • analyze_attachments
    • list_attachments
    Template authoring (file round-trip)
    • export_template
    • validate_template
    • import_template
    • convert_reference_document
    • get_template_examples
    • test_template
    Templates
    • create_template
    • update_template_content
    • update_template_form_schema
    • update_template_metadata
    • create_template_version
    • list_template_versions
    • get_template_version
    Helpers
    • geocode_address
    • get_form_value
    • extract_file_text
    • list_section_tools

    One resource is exposed: docs://docdealer, a static overview of what the server does and which tool to call for what. Everything dynamic is a tool — most MCP clients never fetch a resource unless the user attaches it, so anything an agent must be able to reach on its own is a tool.

    Skills

    Two tools return the workflow you need, so an agent pays only for the one it is doing:

    • get_document_generation_skill({ templateId? }) — the generation workflow and the form-data format. Pass templateId and it also returns that template's form checklist, attachment and address fields, section ids, and any agentInstructions its author wrote — replacing a separate get_template call.
    • get_template_authoring_skill() — the authoring workflow and the complete template file format.

    get_instructions is the entry point: a short overview that routes to one of the two.

    whoami answers the other orientation question — who this credential belongs to, which organization is active, and which operations the session may actually perform. Its capabilities block is computed by calling the same checks the tools enforce, so it cannot disagree with them, and it saves an agent from discovering its own permissions by failing a write.

    Two more tools support authoring: get_template_examples returns one validated snippet per construct of the template format, and list_section_tools lists the tokens a section's tools attribute may name — including this organization's connector tools, which cannot be guessed.

    Clients also receive an instructions string at initialize, built per caller, naming the document types that credential can see. That reaches the model's system prompt without a tool call, so an agent recognises a request for one of your document types without asking first.

    How authorization differs from REST

    Worth understanding before you mint a key for an agent, because it is not what the REST rules would lead you to expect.

    Tool reference

    Every tool's input schema is published in the MCP OpenAPI document, which needs no credentials:

    curl
    curl https://thedocdealer.com/api/mcp/openapi.public.json

    One caveat if you read it in a viewer: the /tools/{tool_name} paths are a reference only and are not routable. There is no HTTP endpoint per tool — a "try it" button against those paths returns 404. Use the body shown as the arguments of a tools/call request to POST /api/mcp.