Files
agent-fox/docs/clients/claude-desktop.md
2026-04-12 20:15:41 +08:00

78 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Claude Desktop
Claude Desktop 是 Anthropic 的桌面客户端,原生支持 MCP 协议。
## 配置步骤
### 1. 找到配置文件
| 系统 | 路径 |
|------|------|
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
如果文件不存在,手动创建即可。
### 2. 编辑配置文件
```json
{
"mcpServers": {
"my-api": {
"type": "http",
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
"headers": {
"Authorization": "Bearer {your-api-key}"
}
}
}
}
```
`{projectId}``{your-api-key}` 替换为实际值。
### 3. 重启 Claude Desktop
保存配置文件后,完全退出并重新打开 Claude Desktop。
### 4. 验证连接
在 Claude Desktop 中发送消息:
```
请调用 get_project_overview 查看 API 概览
```
如果看到项目信息,说明配置成功。
## 多项目配置
```json
{
"mcpServers": {
"stripe-api": {
"type": "http",
"url": "https://www.agentfoxapp.com/mcp/project-id-1",
"headers": {
"Authorization": "Bearer afk_your-key"
}
},
"internal-api": {
"type": "http",
"url": "https://www.agentfoxapp.com/mcp/project-id-2",
"headers": {
"Authorization": "Bearer afk_your-key"
}
}
}
}
```
## 常见问题
**Q: 修改配置后需要重启吗?**
A: 是的Claude Desktop 需要重启才能加载新的 MCP 配置。
**Q: 如何确认 MCP 服务已连接?**
A: 在对话中Claude 会自动识别可用的 MCP 工具。你可以直接要求它调用 AgentFox 的工具。