> ## 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 Code

> Connect Claude Code to Chartcastr via the Model Context Protocol and query your data, connections, and pulses directly from your AI assistant.

[Claude Code](https://claude.ai/code) supports remote MCP servers natively. The fastest path is one terminal command — no JSON editing required.

## Prerequisites

* A Chartcastr account on any paid plan
* Claude Code installed (`npm install -g @anthropic-ai/claude-code`)
* An API key from [**Settings → API Keys**](https://chartcastr.com/admin/settings/api-keys?create=true)

***

## Setup (recommended: one-liner)

```bash theme={null}
claude mcp add --transport http chartcastr \
  https://api.chartcastr.com/api/mcp \
  --header "X-API-Key: YOUR_API_KEY"
```

Replace `YOUR_API_KEY` with the key from your dashboard. Claude Code persists the server in your user config and loads it on next startup. To restrict the install to one project, add `--scope project`.

Verify with `/mcp` — `chartcastr` should appear in the list.

***

## Setup (alternative: `.mcp.json`)

Prefer to commit a project-scoped config? Create `.mcp.json` at your project root and **add it to `.gitignore`** to keep your key private:

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

Restart Claude Code or run `/mcp` to load.

***

## Available tools

| Tool                | Description                                             |
| ------------------- | ------------------------------------------------------- |
| `list_sources`      | List all data sources connected to your account         |
| `list_destinations` | List all configured destinations (Slack, email, etc.)   |
| `list_connections`  | List all active chart delivery connections              |
| `get_latest_pulse`  | Fetch the most recent pulse analysis for a connection   |
| `verify_connection` | Confirm a connection is active and delivering           |
| `open_chartcastr`   | Generate a deep link to open Chartcastr in your browser |

## Example prompts

* *"What data sources do I have in Chartcastr?"*
* *"Show me all my active connections and their schedules."*
* *"What did the latest pulse say about my HubSpot connection?"*
* *"Is my Google Sheets → Slack connection still running?"*

***

## Local development

Running Chartcastr locally with `bun up`? Point at your local server:

```bash theme={null}
claude mcp add --transport http chartcastr-local \
  http://localhost:8109/api/mcp \
  --header "X-API-Key: YOUR_LOCAL_KEY"
```

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication error (401)">
    Your key is wrong, expired, or revoked. Regenerate at [Settings → API Keys](https://chartcastr.com/admin/settings/api-keys?create=true) and re-run `claude mcp add` (it overwrites the existing entry).
  </Accordion>

  <Accordion title="Tool not found or unavailable">
    Some tools may be disabled during rollout. Run `/mcp` to see what's exposed by the server, and contact support if you need access to a specific capability.
  </Accordion>

  <Accordion title="Claude Code doesn't see the chartcastr server">
    Run `claude mcp list` to confirm it's registered. If it's there but Claude Code doesn't show it, fully quit and relaunch. If it's missing, the install command failed — re-run it and check the terminal output.
  </Accordion>
</AccordionGroup>
