PT EN
Back to site

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 SistemaMCP (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:

  1. The server responds. The MCP service health check must be healthy.
  2. The tools are registered. The tool list on the SistemaMCP screen must show the 8 published tools.
  3. 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

  1. Open SistemaMCP and copy the server's connection address (the event channel, at the /mcp/sse path) and a valid access token.
  2. 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:
json
{
  "mcpServers": {
    "datta": {
      "url": "<endereco-de-conexao-copiado-do-console>",
      "headers": {
        "Authorization": "Bearer <seu-token-de-acesso>"
      }
    }
  }
}
  1. 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 SettingsMCP 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 SistemaUsuários → 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:

LimitDefault valueTuning variable
Calls per minute, per user100DATTA_MCP_RATE_LIMIT_PER_USER_PER_MINUTE
Calls per minute, per user + tool10DATTA_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:

  1. Generate a new random token.
  2. Update the MCP_SERVICE_ACCOUNT_TOKEN secret in the platform's vault.
  3. 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 SistemaMCP 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:

promql
# 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

SymptomProbable causeWhat to do
Client does not connectWrong address or token (an expired token is the most common cause)Copy the address again from SistemaMCP; the session list shows whether the connection was ever established
permission deniedThe MCP_TOOL_<NAME> permission is missing from the user's profileAdjust the profile in SistemaUsuários
rate limitedCalls-per-minute ceiling reachedWait 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 serverCheck the MCP_SERVICE_ACCOUNT_TOKEN secret on both ends
The event channel drops after ~60 sThe platform's entry proxy closes long-lived connectionsAsk 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.