|
| 1 | +--- |
| 2 | +title: Claude CLI |
| 3 | +description: Connect Claude CLI (Claude Code) to CoreClaw MCP Server via Streamable HTTP. |
| 4 | +sidebar: |
| 5 | + order: 11 |
| 6 | +--- |
| 7 | + |
| 8 | +Connect [Claude CLI](https://github.com/anthropics/claude-code) (also known as Claude Code) to the CoreClaw MCP Server so you can search for scrapers, run them, and retrieve data directly from your terminal conversations. |
| 9 | + |
| 10 | +## Prerequisites |
| 11 | + |
| 12 | +- [Claude CLI](https://github.com/anthropics/claude-code) installed (`npm install -g @anthropics/claude-code`) |
| 13 | +- A CoreClaw account with an API key — get it from [Console → Settings → API & Integrations](https://console.coreclaw.com/settings/integrations) |
| 14 | + |
| 15 | +## Configuration |
| 16 | + |
| 17 | +Claude CLI supports MCP via **Streamable HTTP** transport. You can configure it via a JSON config file. |
| 18 | + |
| 19 | +### Step 1: Create or edit the MCP configuration file |
| 20 | + |
| 21 | +Create a file named `claude-mcp.json` in your project directory (or anywhere you prefer): |
| 22 | + |
| 23 | +```json |
| 24 | +{ |
| 25 | + "mcpServers": { |
| 26 | + "coreclaw": { |
| 27 | + "url": "https://mcp.coreclaw.com/mcp", |
| 28 | + "headers": { |
| 29 | + "api-key": "scraper_api_YOUR_KEY_HERE" |
| 30 | + } |
| 31 | + } |
| 32 | + } |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +Replace `scraper_api_YOUR_KEY_HERE` with your actual CoreClaw API key. |
| 37 | + |
| 38 | +### Step 2: Launch Claude CLI with the MCP config |
| 39 | + |
| 40 | +```bash |
| 41 | +claude --mcp-config claude-mcp.json |
| 42 | +``` |
| 43 | + |
| 44 | +Alternatively, you can place the config at `~/.config/claude/mcp.json` (macOS/Linux) or `%APPDATA%\claude\mcp.json` (Windows) for automatic loading. |
| 45 | + |
| 46 | +## Verify the connection |
| 47 | + |
| 48 | +1. Start Claude CLI with the MCP configuration |
| 49 | +2. Ask Claude: *"Search for Amazon scrapers on CoreClaw"* |
| 50 | +3. Claude should invoke `search_scrapers` and return results |
| 51 | + |
| 52 | +## Example conversation |
| 53 | + |
| 54 | +Once connected, you can perform scraping tasks directly from your terminal: |
| 55 | + |
| 56 | +> **You:** Find a Twitter scraper and extract the latest tweets from @elonmusk |
| 57 | +> |
| 58 | +> **Claude:** I'll search for a Twitter scraper and run it for you. *[Calls `search_scrapers` → `get_scraper_details` → `run_scraper` → polls status → returns results]* |
| 59 | +
|
| 60 | +## Troubleshooting |
| 61 | + |
| 62 | +### MCP config not loading |
| 63 | + |
| 64 | +- Verify the JSON file path is correct when using `--mcp-config` |
| 65 | +- Ensure the JSON is valid (no trailing commas, proper quotes) |
| 66 | +- Check Claude CLI version — MCP support requires recent versions |
| 67 | + |
| 68 | +### Authentication errors |
| 69 | + |
| 70 | +- Ensure the `api-key` header value matches your CoreClaw API key exactly |
| 71 | +- Verify your key is active in the [Console](https://console.coreclaw.com/settings/integrations) |
| 72 | + |
| 73 | +### Tools not available |
| 74 | + |
| 75 | +- Confirm Claude CLI supports Streamable HTTP transport |
| 76 | +- Try restarting the Claude session after config changes |
| 77 | + |
| 78 | +## Next steps |
| 79 | + |
| 80 | +- [→ Back to MCP overview](/integrations/ai/mcp/) |
| 81 | +- [→ CoreClaw API documentation](/api/) |
0 commit comments