CARTO MCP Server
The CARTO MCP Server enables AI Agents to use geospatial tools built with Workflows. By exposing workflows as MCP Tools, GIS teams can empower agents to answer spatial questions with organization-specific logic. Each tool follows the MCP specification, including a description, input parameters, and output, making them accessible to any MCP-compliant agentic application.
This approach allows organizations to:
Build custom tools in Workflows that reflect their own data and processes.
Securely expose those tools through an MCP Server.
Integrate with agents such as Gemini CLI, enabling them to resolve spatial problems automatically.
In the future CARTO will expand support by exposing core GIS operations (e.g., geocoding, isochrones, routing) directly as MCP Tools. Please get in touch if you're interested in this feature.
Using CARTO MCP Server
Create a Workflow
MCP Tools in CARTO are powered by Workflows. For each type of question you want your AI Agent to answer, you will need to design one or more workflows. These workflows define the logic, inputs, and outputs that the agent can use.
At a high level, the process is:
Design a Workflow that resolves a specific spatial problem.
Expose the Workflow as an MCP Tool by adding descriptions, inputs, and outputs that follow the MCP specification.
Keep the Tool updated by syncing the workflow whenever changes are made.
For step-by-step guidance on building MCP Tools in Workflows, see the Workflows as MCP Tools documentation.
Get the MCP Server URL
In CARTO Workspace, go to Developers > Workflow API & MCP Server.
Copy the MCP Server URL displayed under the CARTO AI section.
The MCP Server URL follows this pattern: https://<region>.api.carto.com/mcp/<account_id>
Connect to the MCP Server
Once your workflows are ready, connect an AI agent to the CARTO MCP Server using one of the following methods:
Connecting with OAuth — for web-based platforms like Claude.ai that handle authentication natively.
Connecting with API Access Tokens — for CLI-based agents like Gemini CLI.
Best Practices
To ensure reliable performance and accurate results when exposing Workflows as MCP Tools, consider the following guidelines:
Keep tool descriptions clear and specific: Write concise descriptions that explain what the tool does and when it should be used. This helps the agent choose the right tool.
Define inputs precisely: Use descriptive names and types for all parameters. Avoid ambiguous labels that could confuse the agent.
Test workflows thoroughly: Run workflows manually before exposing them to confirm that the outputs match expectations.
Choose the right output mode: Use Sync for lightweight, fast queries; use Async for long-running processes.
Bear in mind that with Async mode, the agent will need to poll for the status of the execution and make an additional query to get results when the job is finalized. Implementing this logic in your agent's prompt might require additional work.
Version and update carefully: When making changes to workflows, sync updates promptly and communicate changes to relevant users of the MCP Server.
Monitor usage and errors: Track how tools are used and review errors to refine workflows or adjust descriptions as needed.
Last updated
Was this helpful?
