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

# MCP Quickstart

> Set up the Rastro MCP server in Claude Code, Claude Desktop, Cursor, or Codex

Set up the Rastro MCP server to run catalog operations from your AI agent. Pull snapshots, transform data locally, stage changes for review, and apply from the dashboard.

<Note>
  No database credentials needed — the MCP server talks only to the Rastro API.
</Note>

## Prerequisites

* A Rastro account at [dashboard.rastro.ai](https://dashboard.rastro.ai)
* [uv](https://docs.astral.sh/uv/) installed (`curl -LsSf https://astral.sh/uv/install.sh | sh`)

## Authenticate

```bash theme={null}
uvx rastro.ai login
```

This opens [dashboard.rastro.ai](https://dashboard.rastro.ai) in your browser. Log in, and your credentials are saved automatically.

<Note>
  Alternatively, create an API key at [dashboard.rastro.ai/settings/api-keys](https://dashboard.rastro.ai/settings/api-keys) and pass it as `RASTRO_API_KEY` in your client config below.
</Note>

## Configure your client

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={null}
    claude mcp add rastro -- uvx rastro.ai
    ```

    If using an API key instead of browser login:

    ```bash theme={null}
    claude mcp add rastro \
      -e RASTRO_API_KEY=rastro_pk_... \
      -- uvx rastro.ai
    ```
  </Tab>

  <Tab title="Claude Desktop">
    Open your config file:

    * **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
    * **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

    If you ran `uvx rastro.ai login` above:

    ```json theme={null}
    {
      "mcpServers": {
        "rastro": {
          "command": "uvx",
          "args": ["rastro.ai"]
        }
      }
    }
    ```

    Or with an API key:

    ```json theme={null}
    {
      "mcpServers": {
        "rastro": {
          "command": "uvx",
          "args": ["rastro.ai"],
          "env": {
            "RASTRO_API_KEY": "rastro_pk_..."
          }
        }
      }
    }
    ```

    Restart Claude Desktop after saving.
  </Tab>

  <Tab title="Cursor">
    Open **Cursor Settings** (Cmd/Ctrl + Shift + J) → **MCP** tab → **Add new MCP server**.

    Or add to `.cursor/mcp.json` in your project root:

    ```json theme={null}
    {
      "mcpServers": {
        "rastro": {
          "command": "uvx",
          "args": ["rastro.ai"]
        }
      }
    }
    ```

    If using an API key instead of browser login, add an `"env"` field:

    ```json theme={null}
    "env": {
      "RASTRO_API_KEY": "rastro_pk_..."
    }
    ```
  </Tab>

  <Tab title="Codex">
    Add to `~/.codex/config.toml`:

    ```toml theme={null}
    [mcp_servers.rastro]
    command = "uvx"
    args = ["rastro.ai"]
    ```

    If using an API key instead of browser login:

    ```toml theme={null}
    [mcp_servers.rastro]
    command = "uvx"
    args = ["rastro.ai"]
    env = { RASTRO_API_KEY = "rastro_pk_..." }
    ```
  </Tab>
</Tabs>

## Verify

Ask your agent:

```text theme={null}
List my Rastro catalogs
```

If the server is connected, it will call `catalog_list` and return your catalogs.

## First workflow

Prompt your agent:

```text theme={null}
For catalog <catalog_id>, pull a snapshot, update price/cost by my rules,
compute diff, validate, and stage one pending-review activity.
Do not apply automatically.
```

Expected flow:

1. `execution_catalog_snapshot_pull`
2. Local transform (agent-generated Python)
3. `execution_local_diff_compute`
4. `execution_bundle_validate`
5. `catalog_activity_create_transform` (or `execution_catalog_stage_dataset`)
6. Review and apply in the [dashboard](https://dashboard.rastro.ai)

## Safety defaults

* Programmatic approve/apply is blocked — all changes require dashboard review.
* Large change sets are staged into one activity (chunked internally).
* Always review the dashboard diff before applying.

## Next

<CardGroup cols={2}>
  <Card title="MCP Reference" icon="book" href="/mcp/reference">
    Full tool reference and troubleshooting
  </Card>

  <Card title="Catalog API" icon="database" href="/catalogs/reference">
    Underlying API endpoints
  </Card>
</CardGroup>
