Connecting with API Access Tokens
An API Access Token is the quickest way to connect an agent for read and discovery work — browsing connections, querying data, and searching the Data Observatory. It's also the only option on hosts that don't run an interactive OAuth flow (such as Oracle OCI). You create a token in CARTO Workspace, then pass it as an authorization header when registering the MCP Server in your agent.
The token's Allowed APIs decide which tools appear — and the MCP Server scope alone unlocks only four. See What a token unlocks below before you create the token; the difference between four tools and fourteen is which data APIs you add.
Step 1: Create an API Access Token
The MCP Server requires authentication via an API Access Token:
In CARTO Workspace, create a new token.
In Allowed APIs, switch on the MCP Server scope — this admits the token to the server. Then add the data APIs the agent actually needs: SQL to query at all, Maps for table stats (
describe), LDS for geocoding and routing, Imports/Exports to load and export data. See What a token unlocks — the MCP Server scope on its own reaches only four tools.Under Grants, add at least one grant naming a connection.
Copy the token securely, using the copy button — you'll need it to connect the agent.

Get the SQL grant source right, or queries will fail. A grant is a {connection, source} pair, and what source must contain depends on the API:
For the SQL API (
execute_query),sourcemust be the query text itself, or*for any query — not a table name. A table-scoped grant returns403for aSELECTagainst that table.For map and table reads,
sourceis a fully-qualified table name.
For an agent that composes its own SQL, granting * is usually the practical choice.
What a token unlocks
Which tools a token session sees depends entirely on its Allowed APIs. The MCP Server scope is only the admission ticket — on its own it reaches four tools. Each additional data API adds more:
MCP Server (alone)
explore_data (list connections, browse and search resources — not describe), search_data_observatory, validate_map, validate_workflow. Four tools.
+ SQL
execute_query and execute_async_query (the agent can't query at all without this), plus run_workflow status only — it can poll a run, but starting one and fetching results needs OAuth.
+ Maps
describe on explore_data — table and column statistics, which data-aware map styling depends on.
+ LDS
geocode, route, calculate_isolines, calculate_od_matrix.
+ Imports / Exports
import_data, export_data, transfer_data.
With SQL, Maps, LDS, Imports and Exports all enabled, a token reaches fourteen tools. Everything beyond that — creating and editing maps, authoring and running Workflows, connections, and admin — is OAuth only.
Step 2: Add the MCP Server to your agent
Use the MCP Server URL (from the overview page) and the API Access Token to register the server. The exact command varies by agent — most take a URL, a transport, and an Authorization: Bearer <token> header. For example, with Gemini CLI:
Replace
<region>and<account_id>with the values from your MCP Server URL (copy the full URL from Developers > Workflow API & MCP Server).-t httpsets the transport protocol (Streamable HTTP).The
Authorizationheader carries the API Access Token from Step 1.
After setup, the agent can browse your connections, inspect tables, run SQL, and search the Data Observatory in response to your questions — the exact set depends on the token's Allowed APIs (see What a token unlocks). Running a saved Workflow end to end needs OAuth.
Last updated
Was this helpful?
