Skip to main content
Use Rastro from Codex or Claude through MCP to run large catalog operations safely: pull a snapshot, transform locally, stage one review activity, then apply from dashboard.
You do not need database (Supabase/Postgres) access. MCP talks only to Rastro API endpoints using your API key.

Prerequisites

1. Clone and install

git clone https://github.com/Rastro-AI/rastro-mcp.git
cd rastro-mcp
uv sync

2. Authenticate

Option A (recommended for automation): API key
export RASTRO_API_KEY="rastro_pk_..."
Option B (no manual token copy): browser login from CLI
uv run rastro-mcp login
# apply the printed export command in your shell
This opens dashboard.rastro.ai, uses your existing session, and returns the token to a localhost callback automatically.

3. Set API base URL

export RASTRO_BASE_URL="https://catalogapi.rastro.ai/api"

4. Test the MCP server

uv run rastro-mcp
If the command starts without errors, your MCP server is ready.

5. Add MCP server to your agent config

Use a workspace .mcp.json entry similar to:
{
  "mcpServers": {
    "rastro": {
      "command": "bash",
      "args": [
        "-lc",
        "cd /ABSOLUTE/PATH/rastro-mcp && export RASTRO_API_KEY='rastro_pk_...' && export RASTRO_BASE_URL='https://catalogapi.rastro.ai/api' && uv run rastro-mcp"
      ]
    }
  }
}
Replace /ABSOLUTE/PATH/rastro-mcp and the API key value with your own.

6. First workflow in Codex / Claude

Prompt example:
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/apply in dashboard

Safety defaults

  • Programmatic approve/apply is blocked in MCP.
  • One large change set is staged into one activity (internally chunked when needed).
  • Always review the dashboard diff before applying.

Next