Files
agent-fox/docs/getting-started/connect-first-client.md
2026-04-12 20:15:41 +08:00

76 lines
1.8 KiB
Markdown
Raw 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.

# 连接第一个 LLM 客户端
现在你已经有了项目和 API Key可以将 AI 工具连接到 AgentFox 的 MCP 服务。
## 获取 MCP 配置信息
在项目详情页的「MCP」标签页中你可以找到
1. **MCP 服务 URL**`https://www.agentfoxapp.com/mcp/{你的项目ID}`
2. **配置代码片段**:可一键复制的 JSON 配置
## 通用配置模板
所有支持 MCP 的 AI 工具都使用类似的配置格式:
```json
{
"mcpServers": {
"my-api": {
"type": "http",
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
"headers": {
"Authorization": "Bearer {your-api-key}"
}
}
}
}
```
`{projectId}` 替换为你的项目 ID从 MCP 标签页复制),将 `{your-api-key}` 替换为你的 API Key。
## 快速示例Claude Code
以 Claude Code 为例,最快的连接方式:
1. 在项目根目录创建 `.mcp.json` 文件:
```json
{
"mcpServers": {
"my-api": {
"type": "http",
"url": "https://www.agentfoxapp.com/mcp/你的项目ID",
"headers": {
"Authorization": "Bearer 你的API-Key"
}
}
}
}
```
2. 重启 Claude Code即可使用
## 验证连接
连接成功后,你可以让 AI 助手执行一个简单的测试:
```
你:调用 get_project_overview 查看 API 概览
```
如果返回了项目名称、版本和模块列表,说明连接成功。
## 各客户端详细配置
不同 AI 工具的配置方式略有差异,请参考对应的详细指南:
- [Claude Desktop](../clients/claude-desktop.md)
- [Claude Code](../clients/claude-code.md)
- [Cursor](../clients/cursor.md)
- [Windsurf](../clients/windsurf.md)
- [GitHub Copilot](../clients/github-copilot.md)
- [Cline](../clients/cline.md)
- [Codex (OpenAI)](../clients/codex.md)
- [其他客户端](../clients/other-clients.md)