> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datafold.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP

> Connect your AI agent to Datafold and interact with your data through natural language

MCP (Model Context Protocol) is the easiest way to interact with Datafold by empowering AI agents like Claude Code, Cursor, or Windsurf with Datafold's tools. Run data diffs, query data sources, manage monitors, and more — all through natural language without leaving your development environment.

## Quick Start

All you need is a Datafold API key and a one-line setup in your AI assistant.

<Steps>
  <Step title="Get your API key">
    Go to **Settings > Account** in the [Datafold app](https://app.datafold.com) and click **Create API Key**.
  </Step>

  <Step title="Connect your AI assistant">
    For **Claude Code**, run:

    ```bash theme={null}
    claude mcp add --transport http --scope user \
      datafold https://app.datafold.com/mcp/ \
      --header "Authorization: Key YOUR_API_KEY"
    ```

    For **Cursor**, create `.cursor/mcp.json` in your project:

    ```json theme={null}
    {
      "mcpServers": {
        "datafold": {
          "type": "http",
          "url": "https://app.datafold.com/mcp/",
          "headers": {
            "Authorization": "Key YOUR_API_KEY"
          }
        }
      }
    }
    ```

    For other AI assistants, see the [full setup guide](/api-reference/mcp-server-setup).
  </Step>

  <Step title="Start using Datafold">
    Ask your AI assistant to interact with Datafold. For example:

    * *"List my Datafold data sources"*
    * *"Run a data diff between table A and table B"*
    * *"Show me the latest monitor alerts"*
  </Step>
</Steps>

## Tool Visibility and Permissions

The tools available to your AI agent depend on the permissions of the API key's owner. Tools that require permissions the user doesn't have are automatically hidden from the agent.

To scope an agent to a specific set of tools, create a [custom group](/security/user-roles-and-permissions#custom-groups) with only the permissions you need, assign it to a [service account](/security/service-accounts), and use that service account's API key.

See [MCP Tool Permissions](/security/mcp-tool-permissions) for the exact permissions each MCP tool requires.

## Supported Clients

Datafold's MCP server works with any client that supports the [Model Context Protocol](https://modelcontextprotocol.io/), including Claude Desktop, Claude Code, Cursor, VS Code with Cline, Windsurf, Continue.dev, Zed, OpenCode, Gemini CLI, and Kiro.

<Card title="Full MCP Setup Guide" icon="gear" href="/api-reference/mcp-server-setup">
  Detailed setup instructions for all supported clients, troubleshooting, and best practices.
</Card>
