> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-agents/connect-your-platform/github-copilot.md).

# GitHub Copilot

[GitHub Copilot](https://docs.github.com/en/copilot) can work with CARTO in three complementary ways:

* **MCP Server:** gives Copilot access to CARTO tools such as data discovery, SQL, Data Observatory, and other MCP capabilities.
* **CARTO CLI:** provides command-line access to CARTO for scripting, automation, and administration.
* **Agent Skills:** provides Copilot with reusable instructions and workflows for working with CARTO.

The MCP setup differs depending on whether you're using **VS Code** or the **Copilot coding agent**.

> **Before you start:** Copy your **MCP Server URL** from CARTO Workspace under **Workspace > Settings > MCP Server**

## MCP

### In VS Code

VS Code supports remote MCP servers through `.vscode/mcp.json`. You can create the configuration manually or run **MCP: Add Server** from the Command Palette.

Add CARTO as a remote HTTP server:

```json
{
  "servers": {
    "carto": {
      "type": "http",
      "url": "https://<region>.api.carto.com/mcp/<account_id>",
      "headers": { "Authorization": "Bearer ${input:carto_token}" }
    }
  }
}
```

Replace `<region>` and `<account_id>` with the values from your CARTO MCP Server URL.

Using an input variable keeps the CARTO [API Access Token](/carto-for-agents/mcp-server/connecting-with-api-tokens.md) out of the configuration file. Don't hardcode the token in `.vscode/mcp.json`.

If CARTO advertises OAuth, an **Auth** action appears above the server entry. Select **Auth** to sign in and use the full CARTO tool surface. This requires **VS Code 1.101 or later**.

If OAuth isn't available, use a CARTO **API Access Token** instead.

For more information, see [VS Code's MCP documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).

### In the Copilot coding agent

The repository-level **Copilot coding agent** supports remote HTTP MCP servers but does **not support OAuth**. Use a CARTO API Access Token instead.

Store the token as a repository or organization secret with a `COPILOT_MCP_` prefix. For example:

```
COPILOT_MCP_CARTO_TOKEN
```

Configure the MCP server using `mcpServers`:

```json
{
  "mcpServers": {
    "carto": {
      "type": "http",
      "url": "https://<region>.api.carto.com/mcp/<account_id>",
      "headers": { "Authorization": "Bearer $COPILOT_MCP_CARTO_TOKEN" },
      "tools": ["*"]
    }
  }
}
```

Replace `<region>` and `<account_id>` with the values from your CARTO MCP Server URL.

The `tools` field controls which MCP tools the coding agent can use. Replace `"*"` with a focused list if you want to expose only specific CARTO tools.

For more information, see [GitHub's documentation on extending Copilot coding agent with MCP](https://docs.github.com/en/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp).

## CARTO CLI

Copilot has access to a terminal, so you can use the [CARTO CLI](/carto-for-agents/cli.md) alongside MCP for scripting, automation, and administration.

Install the CLI:

```
npm install -g @carto/carto-cli
```

Authenticate:

```
carto auth login
```

The CLI is useful when the agent needs to perform command-line operations or when you want to automate CARTO tasks outside the MCP tool interface.

## Agent Skills

**CARTO Agent Skills** provide reusable instructions and workflows that help Copilot work with CARTO consistently.

Copilot does not currently provide a native installer for the [CARTO Agent Skills](/carto-for-agents/agent-skills.md) catalog. To use the same guidance, add the relevant CARTO skill playbooks to your repository's custom instructions, for example:

```
.github/copilot-instructions.md
```

This gives Copilot the CARTO-specific instructions and workflows, while MCP provides access to the underlying CARTO tools.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.carto.com/carto-for-agents/connect-your-platform/github-copilot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
