> For the complete documentation index, see [llms.txt](https://docs.documentero.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.documentero.com/documentation/ai/documentero-mcp.md).

# Documentero MCP

**Package:** [`@documentero/mcp`](https://www.npmjs.com/package/@documentero/mcp)\
**Source:** [github.com/documentero/documentero-mcp](https://github.com/documentero/documentero-mcp)\
**Website:** [documentero.com](https://documentero.com/)

#### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* A Documentero account with at least one uploaded template ([app.documentero.com](https://app.documentero.com/))
* Your company **API key** (Account settings)
* Node.js 18+ available to the MCP client (`npx` is used to run the server)

#### Connect (API key) <a href="#connect-api-key" id="connect-api-key"></a>

1. Copy your API key from Documentero → **Account settings**.
2. Add the Documentero MCP server to your client config:

```json
{
  "mcpServers": {
    "documentero": {
      "command": "npx",
      "args": ["-y", "@documentero/mcp"],
      "env": {
        "DOCUMENTERO_API_KEY": "your-api-key"
      }
    }
  }
}
```

3. Restart the client (or reload MCP servers) so Documentero tools appear.

#### Use the connected MCP <a href="#use-the-connected-mcp" id="use-the-connected-mcp"></a>

Once connected, the agent can use these tools:

| Tool                  | Description                                                                                                                         |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `list_templates`      | List templates for your API key (`id`, `name`, `kind`, `defaultFormat`, `allowedFormats`)                                           |
| `get_template_fields` | Get field schema and format options for a template                                                                                  |
| `generate_document`   | Generates a document for given template and fields. Returns a signed download URL (\~1 hour) by default, or base64 if `embed: true` |

**How to use**

1. Ask the agent to list your templates and pick one.
2. Ask it to load the template fields (`get_template_fields`) — you can ask what field data is required and which data types (Text/HTML/Markdown/Image/Link) are needed to generate the document.
3. Ask it to generate the document based on the template and data you provide.

**Format rules**

* Word templates (`kind: word`): `docx` or `pdf`
* Excel templates (`kind: excel`): `xlsx` only
* If `format` is omitted, the template `defaultFormat` is used

Quotas and rate limits are the same as the Documentero Cloud API.
