Use templates from an AI assistant (MCP)
Since Template API 3.7.0, the Template API includes a Carbone MCP server. An AI assistant that supports MCP can use it to work with your Carbone templates and generate documents, without going through the ERP.
The assistant can:
-
list, upload, rename, download and delete your templates;
-
generate a document (PDF, DOCX, XLSX and the other formats of the Template API) from a template and JSON data;
-
help you write or fix a template, then preview it with sample data.
The assistant only sees the templates of your Template API account. Each document it generates counts in your monthly document limit, like a print from the ERP.
Before you start
You need:
-
a Template API account (username and password), the same one the template module uses;
-
an AI assistant that supports MCP servers over HTTP and lets you add an
Authorizationheader, for example Claude Code, Cursor or VS Code. The AI agent of AOP 10 uses the same server.
Assistants that only accept MCP servers with an OAuth sign-in cannot connect.
The server address is:
https://template-api.saas.axelor.com/v3/mcp
Get a token
The assistant authenticates with a token of your Template API account. Request it with your username and password:
curl -s -X POST https://template-api.saas.axelor.com/v3/auth \
-d "username=<username>&password=<password>" | jq -r .access_token
The command prints the token. Keep it private: anyone who has it can use your templates and your document limit.
The token expires.
When the assistant reports 401 errors, request a new token and update the assistant settings.
Connect your assistant
In the examples below, replace <token> with your token.
Claude Code
claude mcp add --transport http carbone https://template-api.saas.axelor.com/v3/mcp \
--header "Authorization: Bearer <token>"
Generate a document
Ask the assistant in plain language, for example:
-
"List my templates."
-
"Generate the quote template as a PDF with this data: …"
-
"Upload this DOCX as a new template, then render it with sample data."
The assistant returns the document, or a download link if you ask for one. A download link:
-
works without signing in, so share it only with people who may see the document;
-
can be opened several times;
-
expires after one hour.
Limits
-
The assistant generates documents only from templates stored in your account. Upload a template first, then generate from it.
-
Inspecting a template to list its tags is not available. Ask the assistant to download the template and read its tags instead.
-
Categories, tags, comments and expiry dates of Carbone Cloud do not exist in the Template API. The assistant gets an error if it tries to set them.
-
Only administrators of the account can delete a template.
-
When the monthly document limit is reached, the assistant gets a
403error.