# CARTO MCP for AI Agents AI Agent Connect

> CARTO MCP lets your AI agents execute spatial SQL, generate travel routes, and bulk geocode addresses directly within your CARTO workspace. It connects your data warehouse to your agent so you can perform complex GIS analysis and data management without clicking through a dashboard.

## Overview
- **Category:** databases
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_6NUh4SJzIYKcgYcjPGz3lmRBTXiut011mCAsyHQM/ai-agent-connect
- **Tags:** spatial-analytics, gis, spatial-sql, location-intelligence, data-warehousing, geospatial-data

## Description

Instead of jumping between a SQL editor, a spreadsheet, and a GIS dashboard, you can just tell your agent what you need to see. If you want to know which stores are within a 15-minute drive of a specific zip code, you just ask. This Connector handles the heavy lifting of calculating those travel-time polygons and joining them with your customer data automatically. It takes the friction out of spatial analysis by letting you run SQL queries against your BigQuery, Snowflake, or Redshift data directly from a chat window. If you need to bring in new data, you can give your agent a URL to a CSV or GeoJSON file, and it handles the import process for you. It's one of the many specialized tools available in the Vinkius catalog that turns your AI into a GIS expert. You get to skip the manual data cleaning and the tedious clicking, moving straight from a business question to a visual map or a data table. You can also monitor long-running jobs or list your existing datasets to keep your workspace organized without ever opening the graphical interface.

## Tools

### poll_async_job_status
Check the status of long-running SQL jobs to see if they've finished. It provides updated timestamps and error messages.

### calculate_isoline
Create travel-time or distance polygons around a specific starting point. This is perfect for service area and reachability analysis.

### calculate_route
Get the optimal driving path between two points. It returns the distance, duration, and route geometry for your maps.

### create_async_sql_job
Run heavy SQL queries that take longer than 60 seconds as background jobs. This handles large table transformations and complex joins.

### execute_sql_query
Run quick SQL queries for data exploration and spatial joins in real time. It returns results directly as JSON rows.

### geocode_address
Turn a single address string into latitude and longitude coordinates. Use this for quick, individual lookups.

### geocode_batch_addresses
Convert a large list of addresses into coordinates in a single batch request. This is the best way to handle customer lists.

### get_import_status
Check the progress of a data import job to see if it's finished or failed. It returns the table name and progress percentage.

### import_external_file
Load CSV, GeoJSON, or Shapefiles into your data warehouse from a URL. It creates a new managed table for your analysis.

### list_map_datasets
See all the maps and tables currently available in your CARTO organization. Use this to audit your assets and check freshness.

## Prompt Examples

**Prompt:** 
```
I have a list of 10 store addresses in Chicago. Can you geocode them for me?
```

**Response:** 
```
I've processed those 10 addresses for you. Here are the coordinates:

| Address | Latitude | Longitude |
| :--- | :--- | :--- |
| 123 Main St | 41.8781 | -87.6298 |
| 456 Oak Ave | 41.8800 | -87.6300 |

I used the batch geocoding tool to ensure they were all mapped accurately in one go.
```

**Prompt:** 
```
Show me the 15-minute drive time area around the downtown Seattle office.
```

**Response:** 
```
I've calculated the 15-minute isoline for downtown Seattle. 

**Results:**
* **Reach:** Approximately 3.2 square miles.
* **Geometry:** [GeoJSON Polygon Data]

You can use this to see your delivery reach. Let me know if you want to adjust the time threshold.
```

**Prompt:** 
```
Run a query to find all stores with over $1M in revenue in California.
```

**Response:** 
```
I've executed that query against your warehouse. Here are the top 5 results:

| Store ID | Revenue | State |
| :--- | :--- | :--- |
| ST-992 | $1.2M | CA |
| ST-441 | $1.1M | CA |

The query joined your sales and store location tables to filter by both revenue and state.
```

## Capabilities

### Run spatial SQL queries
Execute SQL against your BigQuery, Snowflake, or Redshift warehouse to join datasets and find spatial patterns.

### Bulk geocode addresses
Convert hundreds of unstructured addresses into precise latitude and longitude points in a single request.

### Generate travel isolines
Create polygons showing reachable areas based on specific time or distance thresholds from a center point.

### Map out driving routes
Get the optimal driving path between two points including total distance and travel duration.

### Import external files
Load CSV, GeoJSON, or Shapefiles into your data warehouse using a publicly accessible URL.

### Monitor data imports
Track the status of long-running data loading jobs to see when they're finished or if they hit an error.

## Use Cases

### Delivery Zone Planning
A logistics manager asks the agent to find all areas reachable within 20 minutes from a warehouse. The agent uses `calculate_isoline` to generate the map.

### Customer Data Enrichment
A retail lead provides a list of 500 store addresses. The agent uses `geocode_batch_addresses` to add coordinates to the table.

### Warehouse Data Sync
A data engineer needs to move a 5GB GeoJSON file from a cloud bucket. The agent uses `import_external_file` to pull it in automatically.

### Rapid SQL Exploration
A data scientist wants to see the top 10 stores by revenue in a specific region. The agent uses `execute_sql_query` to grab the data instantly.

## Benefits

- Run complex spatial SQL directly in your chat. Use `execute_sql_query` to join datasets and find patterns without leaving your workspace.
- Bulk geocode thousands of rows instantly. Use `geocode_batch_addresses` to turn messy customer lists into usable coordinates.
- Map out delivery zones in seconds. Use `calculate_isoline` to see exactly how far a driver can go in 15 minutes.
- Automate heavy data imports. Use `import_external_file` to pull in CSVs or GeoJSONs from URLs without manual uploads.
- Manage long-running tasks easily. Use `create_async_sql_job` and `poll_async_job_status` to handle massive datasets.
- Audit your organization's assets. Use `list_map_datasets` to quickly see what data is available for your next project.

## How It Works

The bottom line is you get a conversational interface for your entire CARTO spatial analytics stack.

1. Subscribe to the CARTO MCP and grab your active Organization and API keys.
2. Connect the Connector to your preferred AI client like Claude, Cursor, or Windsurf.
3. Start asking your agent to run queries, map routes, or geocode lists in plain English.

## Frequently Asked Questions

**What can I do with the CARTO MCP?**
You can use your AI agent to run spatial SQL, geocode addresses, and generate travel routes directly on your CARTO platform. It turns your natural language into GIS actions.

**Can I use this to calculate delivery zones?**
Yes. You can ask your agent to generate travel-time isolines. It will calculate the reachable area based on time or distance and give you the geometry for your maps.

**Does the CARTO MCP support bulk geocoding?**
Yes, it supports batch geocoding. You can give your agent a list of addresses, and it will convert them all into coordinates in one step.

**How do I run SQL queries on my warehouse with CARTO?**
Simply tell your agent what data you want to see. It will execute the SQL query against your connected warehouse and show you the results in the chat.

**Can I import data files into CARTO using my AI agent?**
Yes. If you provide a public URL for a CSV or GeoJSON file, your agent can trigger a data import to bring that file into your CARTO workspace.

**Does this Connector work with BigQuery or Snowflake?**
Yes, it works with major cloud warehouses including BigQuery, Snowflake, and Redshift, allowing you to run spatial queries on your existing data.

**How does the CARTO MCP handle long-running spatial jobs?**
It handles heavy queries as asynchronous jobs. Your agent can start a long-running task and then check back later to see when it's finished.

**Can my AI agent orchestrate heavy spatial analytics on large datasets directly?**
Yes. While small checks use the immediate SQL endpoint, your agent knows how to use the async Job API to submit massive postGIS or BigQuery geospatial operations on millions of rows. It automatically polls the remote status and notifies you once your heavy data transformation is structurally completed.

**Am I able to geocode raw customer addresses in bulk through the agent?**
Definitely. Give your agent a list of unstructured addresses and it will fire the bulk `geocode_batch_addresses` tool. CARTO’s native LDS engine (powered by TomTom/HERE) returns the validated geo-coordinates for each row, avoiding manual CSV matching.

**Can the agent create travel-time polygons (Isolines)?**
Absolutely. The agent uses the `calculate_isoline` tool passing the desired travel duration and coordinate center. It immediately receives a precise GeoJSON polygon defining the catchment zone or service area, without requiring you to use the map UI.