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

# Claude MCP setup

> Connect Claude Desktop or Cursor to Chartcastr via the Model Context Protocol. Generate an API key and configure MCP for natural-language control.

Use Claude Desktop or Cursor to manage your Chartcastr automations with natural language. The Model Context Protocol (MCP) allows Claude to directly access your Chartcastr data.

## Prerequisites

* [Claude Desktop](https://claude.ai/download) installed
* A Chartcastr account with at least one source configured

## Step 1: Generate an API Key

1. Go to [Settings → Credentials](https://chartcastr.com/admin/settings) in your Chartcastr dashboard
2. Click **Generate Key** to create a new API key
3. Copy the key immediately - you won't be able to see it again

<Warning>
  Store your API key securely. Never share it publicly or commit it to version control.
</Warning>

## Step 2: Configure Claude Desktop

Open your Claude Desktop configuration file:

<Tabs>
  <Tab title="macOS">
    ```bash theme={null}
    ~/Library/Application Support/Claude/claude_desktop_config.json
    ```
  </Tab>

  <Tab title="Windows">
    ```bash theme={null}
    %APPDATA%\Claude\claude_desktop_config.json
    ```
  </Tab>
</Tabs>

Add the Chartcastr MCP server configuration:

```json theme={null}
{
  "mcpServers": {
    "chartcastr": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://api.chartcastr.com/api/mcp",
        "--header",
        "X-API-Key: ${CHARTCASTR_API_KEY}"
      ],
      "env": {
        "CHARTCASTR_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

Replace `your_api_key_here` with your actual API key from Step 1.

<Info>
  The `mcp-remote` package is a bridge that connects Claude Desktop to remote MCP servers via Server-Sent Events (SSE). It's installed automatically when you start Claude Desktop.
</Info>

## Step 3: Restart Claude Desktop

After saving your configuration file, completely quit and restart Claude Desktop to load the MCP server.

## Step 4: Verify the Connection

1. Open a new conversation in Claude Desktop
2. Ask: "List my Chartcastr sources"
3. If configured correctly, Claude will use the MCP tools to fetch your data

## Running Multiple Environments

If you're developing locally, you can configure both production and local development servers:

```json theme={null}
{
  "mcpServers": {
    "chartcastr": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://api.chartcastr.com/api/mcp",
        "--header",
        "X-API-Key: ${CHARTCASTR_API_KEY}"
      ],
      "env": {
        "CHARTCASTR_API_KEY": "your_production_key"
      }
    },
    "chartcastr_local": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8109/api/mcp",
        "--header",
        "X-API-Key: ${CHARTCASTR_API_KEY}"
      ],
      "env": {
        "CHARTCASTR_API_KEY": "your_local_key"
      }
    }
  }
}
```

## Available Tools

The MCP server provides these tools to Claude:

| Tool                | Description                               |
| ------------------- | ----------------------------------------- |
| `list_sources`      | List all your chart sources               |
| `list_destinations` | List all your destinations (Slack, email) |
| `list_connections`  | List all scheduled connections            |
| `get_latest_pulse`  | Get the latest AI analysis for a source   |
| `verify_connection` | Verify your setup with a code             |
| `open_chartcastr`   | Get the dashboard URL                     |

## Troubleshooting

<AccordionGroup>
  <Accordion title="MCP server not appearing in Claude">
    1. Check that the config file path is correct
    2. Ensure the JSON is valid (no trailing commas)
    3. Completely quit Claude Desktop (not just close the window)
    4. Check the Claude logs for errors
  </Accordion>

  <Accordion title="Getting authentication errors">
    Verify your API key is correctly set in the `env` section. Make sure there are no extra spaces or newlines.
  </Accordion>

  <Accordion title="Tools not working">
    Try asking Claude to "use the chartcastr tools to list sources" to explicitly invoke the MCP server.
  </Accordion>
</AccordionGroup>

## What You Can Do

Once connected, you can ask Claude to:

* "List all my chart sources in Chartcastr"
* "Show my Slack destinations"
* "What connections do I have scheduled?"
* "Get the latest pulse for my sales dashboard"
* "Help me verify my Chartcastr connection"
