Let an AI agent generate documents for you.
doctagd exposes a Model Context Protocol (MCP) server. MCP is an open standard, so any compatible agent — Claude, ChatGPT, Gemini, or an agent you build yourself — can discover your saved configs and produce documents from a plain-language request, with no upload and no field-mapping step. It is a thin layer over the same v1 API: your dtgd_ key is the credential, and every quota, drift, and idempotency rule is identical.
Vendor-neutral
Connect over streamable HTTP at https://doctagd.com/mcp from any MCP client that can send an Authorization header — your API key is the Bearer token.
Self-describing
inspect_config returns a typed schema (date / currency / number / required) so the agent knows exactly what to send and how to format it.
Safe to retry
validate_input is a dry run that costs no quota, and an idempotency key makes generation retries safe.
You still create a config once in the app (upload a template, confirm the mapping). MCP runs configs — it does not author them. Documents and PDF entitlements count against your plan exactly as they do in the app.
Tools
Six tools, each mapping 1:1 to a v1 endpoint. Only generate_documents spends quota.
list_configsDiscover which document templates (saved configs) this account can generate.
inspect_configGet one config's typed column schema — every column's type, whether it is required, and (for template configs) the placeholder it feeds. Call before generating.
validate_inputDry-run rows against a config. Returns drift, missing-required columns, and coercion notes. No quota, no document — call it until the input is valid.
generate_documentsGenerate one document per row (DOCX, or PDF on Pro/Business). Returns a jobId and a download URL. This is the only tool that uses quota.
check_jobPoll a generation job by id for its status and download URL. Runs are usually synchronous, so the job is often already done.
get_usageRead the account's remaining monthly document allowance before starting a batch. Reflects shared-license pooling.
Connect
Any MCP client that can send an Authorization header works. Get a key from your account settings (shown once), then point your client at https://doctagd.com/mcp. That includes agent CLIs and SDKs (Claude Code, OpenAI Agents SDK / ChatGPT developer mode, Gemini CLI), IDE assistants (Cursor, VS Code, Cline, Windsurf, Zed), open agents (Goose, Continue), and automation tools with an MCP client node (n8n) — plus anything you build with the official MCP SDKs.
{
"mcpServers": {
"doctagd": {
"type": "http",
"url": "https://doctagd.com/mcp",
"headers": { "Authorization": "Bearer dtgd_…" }
}
}
}claude mcp add doctagd \
--transport http \
https://doctagd.com/mcp \
--header "Authorization: Bearer dtgd_…"npx @modelcontextprotocol/inspector
# Transport: Streamable HTTP
# URL: https://doctagd.com/mcp
# Header: Authorization: Bearer dtgd_…Config-key names vary slightly by client (VS Code uses servers; most others use mcpServers), but the URL and Authorization header are the same everywhere. Discovery manifest: /.well-known/doctagd-manifest.json.
A typical agent loop
From a plain-language request to a finished document, with the agent self-correcting before it spends a slot:
1. list_configs → find "Service Agreement"
2. inspect_config → 13 columns, types, which are required
3. (assemble a row from the user's request)
4. validate_input → catches a missing field / coercion note
5. validate_input → valid: true
6. generate_documents → jobId + downloadUrl (idempotencyKey
keeps retries safe). No human mapping
step anywhere in the chain.The user just asks
“Draft a service agreement for Acme, £12k retainer, starting 1 June.”
The agent assembles + checks
It maps the sentence onto the config's columns and validates — fixing a missing jurisdiction or a date it could not parse — before generating.
You get a file back
A ready .docx (or a .zip for a multi-row batch), fetched from the returned download URL.
Auth, quota & errors
MCP shares the v1 API's auth, limits, and error contract — the tools just forward your key and surface the same responses, so an agent can act on them:
- The returned
downloadUrlis a time-limited signed link (about 24h) — open it or hand it to the user directly, no header needed. TheAuthorization: Bearer dtgd_…header also works (e.g. for fixed automations). - A
409drift error listsmissingColumnsandsuggestions— the agent should remap and retry. - A
402means the monthly document quota is exhausted, or PDF was requested on a Free plan — stop, don't retry. - Requests are rate-limited to 60/min (
429).
For key creation, input formats, idempotency, and the full error table, see the REST API docs and plans & limits.
