Clatri MCP
The Clatri MCP lets you connect your Clatri information to external AI clients like Claude Desktop, Cursor, Claude Code, or Codex. The external assistant reads and, if you authorize it, writes to your data — always within the permissions you grant to the token.
For the curious: MCP stands for Model Context Protocol, an open standard created by Anthropic. Any compatible client can connect to Clatri without us having to build a proprietary integration.
If you already talk to Claude or Cursor all day and would like them to have access to your Clatri data without opening the app. For example: "how much did I spend on restaurants this month?" directly in Claude Desktop, no copy-paste.
If what you want is to connect your own apps or scripts, use the Clatri API. It works with the same token you create for the MCP.
How it works, in one picture
Every time the AI client asks a question, it sends the token to the Clatri backend. The backend validates the token, checks which entities and permissions it has, runs the requested tool, and returns the response. It never exposes your password, your app session, or impersonates you outside Clatri.
Requirements
You need an active Clatri subscription
The MCP is a premium feature. Without a subscription:
- You can't create tokens — the button returns an error asking you to renew.
- If your subscription expires with active tokens, those tokens stop working (they respond 402) until you reactivate. They're not deleted — they go back to working automatically when you renew.
This covers the cost of processing your requests with low latency and keeping the infrastructure secure.
You need an MCP-compatible client
The most popular ones:
- Claude Desktop (Mac, Windows) — graphical install
- Claude Code (CLI) —
claude mcp add - Cursor (IDE) — Settings → MCP
- Codex (desktop, CLI, or extension) — local MCP configuration; see its setup tab for Windows and macOS paths.
Other clients that also work: Continue, Cline, Zed, mcp-cli, any integration that speaks streamable HTTP MCP.
Codex desktop, a terminal, and ChatGPT in a browser can have different connection settings. Local Codex configuration does not automatically install a ChatGPT web connector. This guide covers direct connections using a Clatri token; if your client offers OAuth, follow its authorization screen.
The OpenAI account you use for Codex and the token granting access to Clatri are separate credentials. After switching AI accounts, check which MCP connection and token remain configured in that client.
Step 1 — Create your token
- Open the Clatri app → Settings → Connections → Agents and APIs. On the web: Settings → Agents and APIs.
- Tap Create token.
- Give it a name you'll recognize (e.g. "Claude Desktop on my Mac").
- Choose the permission level:
- Read only — the client can query but doesn't modify anything.
- Read and write — can create and edit (expenses, episodes, notes, etc.).
- Full access — also includes delete.
- Optionally, limit the areas (Money, Health, Administration, General) and entities it can use. By default it has all of them.
- Tap Create token.
The token is shown only once. If you lose it, we can't recover it — you have to revoke it and create a new one. Paste it immediately into your client or save it in your password manager.
The token expires automatically after 6 months. You can revoke it manually anytime from the same screen. The same token also works for the Clatri API.
Step 2 — Connect it to your client
- Claude Code
- Claude Desktop
- Cursor
- Codex (desktop and CLI)
The following command is on one line so it works in Windows PowerShell/cmd and in macOS/Linux terminals. Replace the token only on your own computer:
claude mcp add clatri --transport http --scope user https://api.clatri.com/mcp/ --header "Authorization: Bearer clt_mcp_YOUR_TOKEN_HERE"
--scope userregisters it globally (available in every project). Use--scope projectif you only want it in this repo (lives in.mcp.json).--transport httpis required because the Clatri MCP is remote.
Verify it connected:
claude mcp list
You should see clatri: connected ✓. In your next Claude Code session, the whoami, list_entities and other tools will appear automatically.
This manual setup uses mcp-remote to connect Clatri's remote server through Claude Desktop's local MCP servers settings.
- Install Node.js LTS, which includes npm and npx. They must be available on your system for this method. Check in a new terminal:
node --version
npm --version
On Windows, use Command Prompt (cmd) and also run where npx.cmd. If you just installed Node.js, fully quit and reopen Claude so it receives the updated PATH.
- Open Claude Desktop → Settings → Desktop app → Developer → Edit Config to edit
claude_desktop_config.json:- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
- Add
clatriinsidemcpServers. Preserve any existingpreferencesobject:mcpServersbelongs at the same top level, outsidepreferences. Keep your other servers too.
Windows:
{
"mcpServers": {
"clatri": {
"command": "npx.cmd",
"args": [
"-y",
"mcp-remote",
"https://api.clatri.com/mcp/",
"--header",
"Authorization:${CLATRI_AUTH_HEADER}"
],
"env": {
"CLATRI_AUTH_HEADER": "Bearer clt_mcp_YOUR_TOKEN_HERE"
}
}
}
}
macOS: use the same block, replacing "command": "npx.cmd" with "command": "npx".
Replace the example token with yours. Keep the space between Bearer and the token in the environment variable. Do not add spaces to Authorization:${CLATRI_AUTH_HEADER}: this avoids the Windows argument issue documented by mcp-remote.
- Save the JSON and fully quit Claude Desktop. On Windows, check that it is no longer running in the system tray. Then reopen it.
- Check that
clatriis Running in Developer settings. Open a new chat and check + → Connectors to make sure Clatri is available and enabled. You do not need a special Clatri section or chat. - Ask: “Use Clatri MCP and list my entities.” Claude should actually invoke the tool rather than answer from memory.
These instructions cover manual JSON setup. Desktop .mcpb extensions can use Claude's bundled Node.js runtime; they are a different installation method.
- Cursor → Settings → Cursor Settings → MCP (or edit
~/.cursor/mcp.jsondirectly). - Click + Add new MCP server.
- Pick the HTTP transport and paste:
- Name:
clatri - URL:
https://api.clatri.com/mcp - Headers:
Authorization: Bearer clt_mcp_YOUR_TOKEN_HERE
- Name:
- Save. Cursor shows the connection status with a green dot if it connected OK.
Equivalent via file:
{
"mcpServers": {
"clatri": {
"url": "https://api.clatri.com/mcp/",
"headers": {
"Authorization": "Bearer clt_mcp_YOUR_TOKEN_HERE"
}
}
}
}
In the desktop client, open Settings → MCP servers. Add or edit clatri, choose Streamable HTTP, and use https://api.clatri.com/mcp/. If header settings are available, set Authorization to Bearer followed by a space and your complete token.
You can also edit the local configuration file:
| System | Default file |
|---|---|
| Windows | %USERPROFILE%\.codex\config.toml |
| macOS and Linux | ~/.codex/config.toml |
OpenAI's documentation explains configuration shared by local clients. If you use another profile or environment, check its configuration. A trusted project can also define the server in .codex/config.toml.
Add or update the existing block. Keep other servers and do not duplicate [mcp_servers.clatri]:
[mcp_servers.clatri]
url = "https://api.clatri.com/mcp/"
http_headers = { "Authorization" = "Bearer clt_mcp_YOUR_TOKEN_HERE" }
Replace clt_mcp_YOUR_TOKEN_HERE with the complete token Clatri showed when you created it. The abbreviated prefix in the token list is not a usable credential. Keep this file private.
CLI alternative: an environment variable. Use this block instead of the previous one; choose one source for the authorization header:
[mcp_servers.clatri]
url = "https://api.clatri.com/mcp/"
bearer_token_env_var = "CLATRI_MCP_TOKEN"
On Windows with PowerShell 7.1 or later, prompt for the token without displaying it or putting its value in the command:
$env:CLATRI_MCP_TOKEN = Read-Host "Complete Clatri token" -MaskInput
codex
On macOS/Linux, open Terminal, run bash, then:
read -r -s -p "Complete Clatri token: " CLATRI_MCP_TOKEN
printf '\n'
export CLATRI_MCP_TOKEN
codex
These variables belong to that terminal and the processes started from it. A desktop app already running, or launched from the Windows menu/Dock, may not receive them. Use the client's header settings or an environment configured for that process. For Windows PowerShell 5.1, use the file method above or PowerShell 7.1+ for these examples.
Save and fully quit the desktop client before reopening it. For the CLI, stop it with Ctrl+C and restart from the terminal containing the variable. Open a new conversation and ask “Use Clatri's whoami tool and list my entities.”
If the CLI is installed, codex mcp list shows configured servers. A saved server entry does not prove authentication works: verify an actual whoami call.
Step 3 — Check that it works
In your freshly configured client, type one of these:
Who am I in Clatri and which entities do I have access to?
List my Clatri entities.
If everything is OK, the client will use the whoami and list_entities tools and reply with your name, the available entities (Personal, Company, etc.) and the token's permissions.
Check for an actual tool call. The model saying “it was already configured” or “I tested the key” does not establish a successful connection. The key's last use in Clatri shows whether the server accepted authentication; its activity lists executed tools.
What you can ask it (examples)
The server exposes tools from every domain — the same ones the Clatri agent uses internally, plus whoami and list_entities, which only exist in the MCP. Once connected, these prompts work in any client:
| Question | Tools it uses |
|---|---|
| "How much did I spend on restaurants last month from my personal account?" | list_entities, read_income_statement |
| "Summarize my accounts and current balances." | list_entities, read_user_accounts, read_account_and_savings |
| "Log a $45 USD Uber expense for today on Gurwi LLC." | list_entities, create_expense (requires write scope) |
| "When is my next obligation due and how much is it?" | read_obligations |
| "What medications am I currently taking." | read_medications |
If you don't know exactly which tool to use, just ask the client in natural language. Modern LLMs pick the right tools automatically.
Security
The token never grants access outside Clatri
Even if the token leaks:
- It only applies the scopes you granted (read / write / delete).
- It only reaches data inside Clatri — no access to your password, no email change, no 2FA reset.
- It can't create more tokens, revoke others, or touch your subscription.
- You can revoke it instantly from Settings → Connections → Agents and APIs.
Every operation is logged in the audit log (Settings → Connections → Agents and APIs → tap a token → view recent activity). If you see unusual usage, revoke it.
Restrict a token to specific entities
By default a token has access to the same entities as your account — own and shared. When you create or edit a token you can select only the entities the AI client will see. Useful for:
- A token for your accountant that only sees the company.
- A test token that only accesses a sandbox entity.
- An AI client on your personal computer that can't touch work data.
After creation you can change entities, areas, permissions, and the name from Settings → Connections → Agents and APIs → tap the menu (···) → Edit. You don't have to generate a new token every time you tweak its scope.
The token expires after 6 months
For security. When it expires, you simply create a new one and replace it in the client. There's no way to extend the expiration — that's by design.
Troubleshooting
The client says "401 unauthorized"
First identify the error code, not just the HTTP status:
| Code or symptom | What to check |
|---|---|
token_missing / Missing bearer token | The server did not receive a usable Authorization: Bearer ... header. Check settings, environment variables, and redirects. A new key cannot fix an absent header. |
token_invalid | The received credential does not match an active token: it may be incomplete, revoked, or expired. Check the saved credential and its status in Clatri. |
| A new key never shows last use | Check that you replaced the credential in the client actually being used and restarted it. This alone does not prove the key is invalid. |
307 to /mcp/, then 401 in PowerShell | Use https://api.clatri.com/mcp/ directly. PowerShell removes Authorization by default when following redirects. |
Current Clatri versions accept both /mcp and /mcp/ without redirecting. The trailing-slash URL also avoids the redirect in older deployments. Microsoft documents PowerShell's behavior.
Do not broaden permissions to resolve a 401. Replace a token when it expired, was lost, was revoked, or was exposed. After creating a new token, update the connection: the client does not discover it automatically.
Codex stopped connecting after switching OpenAI accounts
- Check
clatriin MCP settings or the active profile'sconfig.toml, including possible project overrides. - Check that its header or environment variable contains the current Clatri token, rather than the shortened prefix or a revoked previous key. You do not need to give Clatri an OpenAI API key.
- Fully quit the client after saving, reopen it, and start a new conversation.
- Ask for
whoamiand verify the returned identity and entities before writing data.
Keep other servers and service credentials. Do not publish your entire configuration file or paste a token into a conversation for the model to “test.”
Manual read-only check on Windows (PowerShell 7.1+)
This initializes MCP and returns server metadata. It does not create expenses, change data, or read your transactions. Use the trailing-slash URL to avoid redirects. -MaskInput requires PowerShell 7.1 or later.
$clatriToken = Read-Host "Complete Clatri token" -MaskInput
$headers = @{
Authorization = "Bearer $clatriToken"
Accept = "application/json, text/event-stream"
}
$body = @{
jsonrpc = "2.0"
id = 1
method = "initialize"
params = @{
protocolVersion = "2025-11-25"
capabilities = @{}
clientInfo = @{ name = "clatri-diagnostic"; version = "1.0" }
}
} | ConvertTo-Json -Depth 5
try {
Invoke-RestMethod -Uri "https://api.clatri.com/mcp/" -Method Post -Headers $headers -ContentType "application/json" -Body $body
} finally {
Remove-Variable clatriToken, headers -ErrorAction SilentlyContinue
}
A response containing result.serverInfo confirms this authentication and initialization. It does not yet verify access to a particular entity: run whoami and an entity read in your MCP client. If it fails, keep the error code/message, URL, and time; do not share the key or header.
The client says "402 subscription_inactive"
Your Clatri subscription isn't active. Renew it in the app and try again — the same token keeps working.
The client says "403 scope_denied", "domain_denied" or "entity_denied"
- scope_denied: the token doesn't have the required permission (e.g. it wants to write but you only gave it read). Edit the token and give it more permissions.
- domain_denied: the tool belongs to an area (Money, Health, Administration, General) the token doesn't have. Edit the token and add the area.
- entity_denied: the client tried to touch an entity the token doesn't allow. Edit the token and add the entity.
"Browser origins not allowed"
The endpoint rejected that request's Origin header. Connect through the assistant's MCP client, which may be a desktop process or an AI provider's service, rather than a manual browser-tab fetch. Use a compatible client or its connection flow. Origin protection also applies to both supported URL variants.
The client doesn't detect the tools after installing
- Fully restart the client (not just minimize).
- Claude Code: run
claude mcp listto see if it appears. If it says "failed", check the header format. - Codex: check
codex mcp list, start a new conversation, and ask forwhoami. Default logs are in%USERPROFILE%\.codex\log\on Windows and~/.codex/log/on macOS/Linux.
For support, share the client and version, operating system, URL, time with timezone, and error code/message. Hide keys, authorization headers, and private data in screenshots or logs. Revoke any exposed token.
Frequently asked questions
How many tokens can I create?
Up to 10 active tokens per user. If you reach the limit, revoke an old one before creating a new one.
Can I share a token with someone else?
Technically yes (it's just a string), but not recommended. If that person needs access to your Clatri, share the entity from Settings → Sharing with their link code instead: they sign in with their own account and only see the domains you allow. More in Sharing entities. Tokens are personal.
Do AI-client actions show up in my Clatri chat history?
After a task that changes data, the external agent is instructed to call registrar_resumen_actividad. This saves one External activity · MCP card in the entity chat, with a summary, expandable changes and local time. Read-only tasks do not create a card. Delivery depends on the client following the instruction; it is not an automatic session detector or a push notification. The card is the external agent’s report, not independent verification by Clatri.
What happens to my token when I rotate my Supabase API keys or JWT signing keys?
Nothing. The MCP token is independent from Supabase's internal auth system. Backend key rotations are transparent to MCP tokens.
Are there rate limits?
There's no per-minute request limit today. What does control access are three other things, and they're what you'll see if something fails:
- Your subscription — if it's not active, the token responds
402 subscription_inactive. - The token's scopes — if it tries to write with a read-only token,
403 scope_denied. - The token's entities — if it tries to touch an entity outside its scope,
403 entity_denied.
The MCP is designed for normal human usage through an AI client, not for mass automation. If you want to automate from your own code, use the Clatri API with the same token; it does have per-minute limits.
Personal context through MCP
read_user_context returns the active entity’s description, behavioral defaults, personality and preferences shared across channels. The client is instructed to read it at the start of a task; MCP does not automatically inject it into every external conversation. buscar_memoria retrieves relevant historical memories.
edit_entity_context and remember_user_preference can use an exact user quote from the external conversation when source_message_id is omitted. That evidence is labeled client-reported, not verified Clatri chat history. Chat-only preferences remain excluded from external context; use channel_scope=all only when the user authorizes sharing across channels.
Reconnect the MCP after updates so the client refreshes tools and instructions. Existing tokens remain valid within their permissions. The documentation link remains available after creating tokens in Flutter and web.
Totals and usage when querying from Claude
For “How much did I spend or earn this month/year?”, request the income statement (read_income_statement). It uses the same accounting basis as Earned and spent: transfers between your own accounts and debt principal payments are not income or expenses. Use read_cashflow_report for money entering or leaving accounts.
read_expenses and read_incomes show movement details and a separate accounting total. The detail list can be limited; do not sum it to calculate the period total.
Example: “Use Clatri MCP to read my income statement from September 1 through September 30, 2026. Report income, expenses, and the tool used.”
These direct data queries do not run Clatri's conversational model. Adding “without spending Clatri tokens” does not change billing. Claude has its own usage, and MCP access requires an active Clatri subscription.
“Server disconnected” on Windows
- Check
node --version,npm --version, andwhere npx.cmdincmd. - Use
npx.cmdand the environment-variable configuration above. If the executable cannot be found, use the full path returned bywhere, escaping backslashes as\\in JSON. - Fully quit and reopen Claude.
- If it still fails, open Developer → clatri → View logs. “Server disconnected” alone cannot distinguish installation, authentication, and network errors. Hide tokens before sharing logs or screenshots; revoke and replace any exposed token.