MCP — Connect AI assistants to DATTA data
Any MCP-compatible client (Model Context Protocol) can query DATTA data directly, with the same authentication and the same permissions that apply in the interface. Your team already uses AI assistants, IDEs such as Cursor or n8n automations, but the data that matters lives in the platform — and the usual alternative is exporting a spreadsheet and pasting content into a prompt. DATTA's MCP server closes that gap and keeps the operation visible in the console: who connected, what they ran and how long it took.
The Sistema > MCP screen
The whole operation lives in (the screens/config-mcp.html page, served inside the console), which brings together:
- the registered tools, each with name, parameter schema and the required permission — the exact list of what an external client can do;
- the capability catalog, with how many operations the platform publishes today, which meaning-based search engine indexed them, and a button to rebuild the catalog without waiting for the automatic refresh;
- the client sessions active at that moment;
- the recent invocations, with user, tool, duration and outcome — the first place to look when something seems slow or fails;
- the connection addresses, ready to copy and paste into the clients.
Validating after installation
Before handing the addresses to the team, confirm three things, in order:
- The server responds. The MCP service health check must be healthy.
- The tools are registered. The tool list on the screen must show the 8 published tools.
- The channel really answers. A smoke test through the JSON-RPC channel, asking for the tool listing, must return the same list. The message format and the channel used are in the API reference.
Step by step: connecting an AI assistant
- Open and copy the server's connection address (the event channel, at the
/mcp/ssepath) and a valid access token. - On your computer, edit the MCP server configuration file of the client you use (each client documents where it lives — usually a JSON file in the user profile) and declare DATTA as a server:
{
"mcpServers": {
"datta": {
"url": "<endereco-de-conexao-copiado-do-console>",
"headers": {
"Authorization": "Bearer <seu-token-de-acesso>"
}
}
}
}- Restart the client. DATTA's 8 tools become available in the conversation — ask, for instance, "how many cases came in this month?" and watch the assistant query the platform for real.
Other clients
- n8n — in the MCP Client node, provide the same connection address and the
Authorization: Bearer <token>header. Use List Tools to confirm the connection. - Cursor — under
Settings›MCP Servers, add the same address.
Permissions: every tool has its own
No tool runs without authorization: each one requires its own permission, in the MCP_TOOL_<NAME> format, checked against the profile of the user who owns the token. The tool list shows the required permission next to each one.
If a client receives permission denied, that tool's permission is missing from the user's profile: adjust it in → edit the profile → check whether MCP_TOOL_<NAME> is listed, and add it if missing. See the roles and permissions guide.
Usage limits
Default limits protect the platform:
| Limit | Default value | Tuning variable |
|---|---|---|
| Calls per minute, per user | 100 | DATTA_MCP_RATE_LIMIT_PER_USER_PER_MINUTE |
| Calls per minute, per user + tool | 10 | DATTA_MCP_RATE_LIMIT_PER_TOOL_PER_USER_PER_MINUTE |
A client that receives rate limited has hit one of those ceilings. The values can be raised temporarily by the operations team when a legitimate use case requires more.
Rotating the service token
The platform's internal integrations use their own service token, kept as a secret under the name MCP_SERVICE_ACCOUNT_TOKEN. Rotation is done by the operations team, with no downtime for users:
- Generate a new random token.
- Update the
MCP_SERVICE_ACCOUNT_TOKENsecret in the platform's vault. - Restart the modules that read it — the Copilot/chat and the MCP server itself — so they pick up the new secret.
Monitoring
The recent invocations on the screen answer the day-to-day questions — which tool is used most, how long it takes, who called it and what failed — without leaving the console. The same measurements are collected automatically and feed the platform's observability dashboard:
# Volume per tool
sum by (tool) (rate(datta_mcp_invocations_total[5m]))
# Error rate per tool
sum by (tool) (rate(datta_mcp_invocations_total{outcome="error"}[5m]))
/ sum by (tool) (rate(datta_mcp_invocations_total[5m]))
# p95 latency per tool
histogram_quantile(0.95,
sum by (tool, le) (rate(datta_mcp_invocation_latency_ms_bucket[5m])))
# Usage limits triggered
sum by (tool) (rate(datta_mcp_rate_limited_total[1h]))Troubleshooting
| Symptom | Probable cause | What to do |
|---|---|---|
| Client does not connect | Wrong address or token (an expired token is the most common cause) | Copy the address again from ; the session list shows whether the connection was ever established |
permission denied | The MCP_TOOL_<NAME> permission is missing from the user's profile | Adjust the profile in |
rate limited | Calls-per-minute ceiling reached | Wait a minute or ask the operations team to adjust the limits |
| The platform's Copilot cannot call MCP (authentication error) | The service token is not reaching the MCP server | Check the MCP_SERVICE_ACCOUNT_TOKEN secret on both ends |
| The event channel drops after ~60 s | The platform's entry proxy closes long-lived connections | Ask the operations team to raise the read and send timeouts (3600 s) on the MCP path |
See also
- Roles and permissions
- API reference — JSON-RPC channel, event channel and the listing resources the screen uses.