Skip to content

Commit 4ad9fce

Browse files
author
Cowork 3P
committed
docs: add Claude CLI MCP configuration guide
Add Claude CLI (Claude Code) documentation for terminal-based MCP configuration via JSON config file. No screenshots needed. - New pages: integrations/ai/mcp/claude-cli.md (EN + ZH) - Updated index.md to include Claude CLI link - Updated astro.config.mjs sidebar navigation
1 parent 29848fe commit 4ad9fce

5 files changed

Lines changed: 171 additions & 0 deletions

File tree

astro.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,13 @@ export default defineConfig({
677677
'zh-CN': 'Claude Desktop',
678678
},
679679
},
680+
{
681+
label: 'Claude CLI',
682+
slug: 'integrations/ai/mcp/claude-cli',
683+
translations: {
684+
'zh-CN': 'Claude CLI',
685+
},
686+
},
680687
{
681688
label: 'Codex Desktop',
682689
slug: 'integrations/ai/mcp/codex-desktop',
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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/)

src/content/docs/integrations/ai/mcp/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Configure CoreClaw MCP on your favorite AI agent platform:
109109
| Platform | Configuration | Guide |
110110
|----------|--------------|-------|
111111
| **Claude Desktop** | Streamable HTTP | [→ Setup Guide](/integrations/ai/mcp/claude-desktop/) |
112+
| **Claude CLI** | Streamable HTTP | [→ Setup Guide](/integrations/ai/mcp/claude-cli/) |
112113
| **Codex Desktop** | Streamable HTTP | [→ Setup Guide](/integrations/ai/mcp/codex-desktop/) |
113114
| **Cursor** | Streamable HTTP | [→ Setup Guide](/integrations/ai/mcp/cursor/) |
114115
| **ChatGPT** | Streamable HTTP | [→ Setup Guide](/integrations/ai/mcp/chatgpt/) |
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: Claude CLI
3+
description: 通过 Streamable HTTP 将 Claude CLI (Claude Code) 连接到 CoreClaw MCP 服务。
4+
sidebar:
5+
order: 11
6+
---
7+
8+
[Claude CLI](https://github.com/anthropics/claude-code)(也称为 Claude Code)连接到 CoreClaw MCP 服务,让您可以直接从终端对话中搜索爬虫、运行任务并获取数据。
9+
10+
## 前提条件
11+
12+
- 已安装 [Claude CLI](https://github.com/anthropics/claude-code)`npm install -g @anthropics/claude-code`
13+
- CoreClaw 账户及 API 密钥 — 从 [控制台 → 设置 → API & 集成](https://console.coreclaw.com/settings/integrations) 获取
14+
15+
## 配置步骤
16+
17+
Claude CLI 通过 **Streamable HTTP** 传输协议支持 MCP。您可以通过 JSON 配置文件进行配置。
18+
19+
### 步骤 1:创建或编辑 MCP 配置文件
20+
21+
在项目目录(或任意位置)创建名为 `claude-mcp.json` 的文件:
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+
`scraper_api_YOUR_KEY_HERE` 替换为您的实际 CoreClaw API 密钥。
37+
38+
### 步骤 2:使用 MCP 配置启动 Claude CLI
39+
40+
```bash
41+
claude --mcp-config claude-mcp.json
42+
```
43+
44+
您也可以将配置放在 `~/.config/claude/mcp.json`(macOS/Linux)或 `%APPDATA%\claude\mcp.json`(Windows)以实现自动加载。
45+
46+
## 验证连接
47+
48+
1. 使用 MCP 配置启动 Claude CLI
49+
2. 询问 Claude:*"在 CoreClaw 上搜索 Amazon 爬虫"*
50+
3. Claude 应该调用 `search_scrapers` 并返回结果
51+
52+
## 对话示例
53+
54+
连接成功后,您可以直接从终端执行抓取任务:
55+
56+
> **您:** 找个 Twitter 爬虫,提取 @elonmusk 的最新推文
57+
>
58+
> **Claude:** 我来搜索 Twitter 爬虫并为您运行。*[调用 `search_scrapers``get_scraper_details``run_scraper` → 轮询状态 → 返回结果]*
59+
60+
## 故障排除
61+
62+
### MCP 配置未加载
63+
64+
- 使用 `--mcp-config` 时验证 JSON 文件路径是否正确
65+
- 确保 JSON 格式有效(无尾随逗号,引号正确)
66+
- 检查 Claude CLI 版本 — MCP 支持需要较新版本
67+
68+
### 认证错误
69+
70+
- 确保 `api-key` 请求头的值与您的 CoreClaw API 密钥完全匹配
71+
-[控制台](https://console.coreclaw.com/settings/integrations) 中验证密钥是否有效
72+
73+
### 工具不可用
74+
75+
- 确认 Claude CLI 支持 Streamable HTTP 传输
76+
- 配置变更后尝试重启 Claude 会话
77+
78+
## 下一步
79+
80+
- [→ 返回 MCP 概览](/zh-cn/integrations/ai/mcp/)
81+
- [→ CoreClaw API 文档](/zh-cn/api/)

src/content/docs/zh-cn/integrations/ai/mcp/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ search_scrapers("amazon")
109109
| 平台 | 配置方式 | 指南 |
110110
|------|---------|------|
111111
| **Claude Desktop** | Streamable HTTP | [→ 配置指南](/zh-cn/integrations/ai/mcp/claude-desktop/) |
112+
| **Claude CLI** | Streamable HTTP | [→ 配置指南](/zh-cn/integrations/ai/mcp/claude-cli/) |
112113
| **Codex Desktop** | Streamable HTTP | [→ 配置指南](/zh-cn/integrations/ai/mcp/codex-desktop/) |
113114
| **Cursor** | Streamable HTTP | [→ 配置指南](/zh-cn/integrations/ai/mcp/cursor/) |
114115
| **ChatGPT** | Streamable HTTP | [→ 配置指南](/zh-cn/integrations/ai/mcp/chatgpt/) |

0 commit comments

Comments
 (0)