feat: deploy skill
This commit is contained in:
87
docs/clients/README.md
Normal file
87
docs/clients/README.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# 客户端配置概述
|
||||
|
||||
AgentFox 使用 MCP 协议的 Streamable HTTP 传输方式,兼容所有支持 MCP 的 AI 工具。
|
||||
|
||||
## 通用配置模板
|
||||
|
||||
所有 MCP 客户端都使用类似的 JSON 配置格式:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 配置字段说明
|
||||
|
||||
| 字段 | 说明 |
|
||||
|------|------|
|
||||
| `mcpServers` | MCP 服务器配置的顶层对象 |
|
||||
| `my-api` | 服务器名称,可自定义(建议使用 API 名称,如 `stripe-api`) |
|
||||
| `type` | 传输类型,必须为 `http` |
|
||||
| `url` | MCP 服务 URL,从项目详情的 MCP 标签页复制 |
|
||||
| `headers.Authorization` | 认证头,格式为 `Bearer {你的API-Key}` |
|
||||
|
||||
### 获取配置信息
|
||||
|
||||
1. 登录 [AgentFox 控制台](https://www.agentfoxapp.com)
|
||||
2. 进入项目详情页 → 「MCP」标签
|
||||
3. 复制 MCP 服务 URL
|
||||
4. 从「设置」中获取 API Key
|
||||
|
||||
> **提示**:MCP 标签页中有预生成的配置代码片段,可一键复制。
|
||||
|
||||
## 多项目配置
|
||||
|
||||
如果你有多个项目,可以在 `mcpServers` 中添加多个服务器:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"stripe-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/project-id-1",
|
||||
"headers": {
|
||||
"Authorization": "Bearer afk_your-api-key"
|
||||
}
|
||||
},
|
||||
"github-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/project-id-2",
|
||||
"headers": {
|
||||
"Authorization": "Bearer afk_your-api-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 支持的客户端
|
||||
|
||||
| 客户端 | 类型 | 配置指南 |
|
||||
|--------|------|---------|
|
||||
| [Claude Desktop](claude-desktop.md) | 桌面应用 | JSON 配置文件 |
|
||||
| [Claude Code](claude-code.md) | CLI 工具 | 项目级或全局配置 |
|
||||
| [Cursor](cursor.md) | AI 编辑器 | 设置或配置文件 |
|
||||
| [Windsurf](windsurf.md) | AI 编辑器 | JSON 配置文件 |
|
||||
| [GitHub Copilot](github-copilot.md) | VS Code 扩展 | VS Code 配置 |
|
||||
| [Cline](cline.md) | VS Code 扩展 | 扩展设置 |
|
||||
| [Codex](codex.md) | CLI 工具 | CLI 参数或配置文件 |
|
||||
| [其他客户端](other-clients.md) | — | 通用配置 |
|
||||
|
||||
## 连接排障
|
||||
|
||||
如果连接失败,请检查:
|
||||
|
||||
1. **URL 是否正确**:确认 projectId 无误
|
||||
2. **API Key 是否有效**:确认 Key 未被轮换
|
||||
3. **网络是否通畅**:确认能访问 `www.agentfoxapp.com`
|
||||
4. **配置格式**:确认 `type` 为 `http`(不是 `sse` 或 `stdio`)
|
||||
70
docs/clients/claude-code.md
Normal file
70
docs/clients/claude-code.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Claude Code
|
||||
|
||||
Claude Code 是 Anthropic 的 CLI 编程助手,支持项目级和全局两种 MCP 配置方式。
|
||||
|
||||
## 方式一:项目级配置(推荐)
|
||||
|
||||
在项目根目录创建 `.mcp.json` 文件:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
优点:配置跟随项目,团队成员可共享(注意不要将 API Key 提交到版本控制)。
|
||||
|
||||
## 方式二:全局配置
|
||||
|
||||
编辑 `~/.claude.json`,在顶层添加 `mcpServers`:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
全局配置对所有项目生效。
|
||||
|
||||
## 验证连接
|
||||
|
||||
启动 Claude Code 后,可以通过以下方式验证:
|
||||
|
||||
```bash
|
||||
# 列出已配置的 MCP 服务器
|
||||
claude mcp list
|
||||
```
|
||||
|
||||
或在对话中直接使用:
|
||||
|
||||
```
|
||||
你:帮我看看这个 API 有哪些模块
|
||||
Claude:[调用 get_project_overview]
|
||||
这个 API 包含以下模块:...
|
||||
```
|
||||
|
||||
## 安全提示
|
||||
|
||||
如果使用项目级配置,建议将 `.mcp.json` 添加到 `.gitignore`,避免 API Key 泄露:
|
||||
|
||||
```bash
|
||||
echo ".mcp.json" >> .gitignore
|
||||
```
|
||||
|
||||
或者使用环境变量(如果客户端支持)来管理 API Key。
|
||||
77
docs/clients/claude-desktop.md
Normal file
77
docs/clients/claude-desktop.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# 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 的工具。
|
||||
51
docs/clients/cline.md
Normal file
51
docs/clients/cline.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Cline
|
||||
|
||||
Cline 是一个 VS Code 扩展,提供 AI 编程助手功能,支持 MCP 协议。
|
||||
|
||||
## 配置步骤
|
||||
|
||||
### 1. 打开 MCP 设置
|
||||
|
||||
1. 打开 VS Code
|
||||
2. 点击侧栏的 Cline 图标
|
||||
3. 点击 MCP Servers 设置(齿轮图标)
|
||||
|
||||
### 2. 添加 AgentFox 服务器
|
||||
|
||||
在 MCP 配置中添加:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 保存并验证
|
||||
|
||||
保存配置后,Cline 会自动连接 MCP 服务器。你可以在 MCP Servers 列表中看到连接状态。
|
||||
|
||||
## 使用方法
|
||||
|
||||
在 Cline 的对话中直接使用:
|
||||
|
||||
```
|
||||
你:根据 API 文档帮我实现用户登录功能
|
||||
Cline:让我先查看 API 文档...
|
||||
[调用 search_endpoints keyword="login"]
|
||||
[调用 get_endpoint_detail endpointId="..."]
|
||||
根据文档,登录接口是 POST /auth/login...
|
||||
```
|
||||
|
||||
## 验证连接
|
||||
|
||||
在 Cline 的 MCP Servers 面板中:
|
||||
- 绿色状态表示已连接
|
||||
- 可以查看已注册的 5 个 AgentFox 工具
|
||||
61
docs/clients/codex.md
Normal file
61
docs/clients/codex.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# Codex (OpenAI)
|
||||
|
||||
Codex 是 OpenAI 推出的 CLI 编程助手,支持 MCP 协议。
|
||||
|
||||
## 配置步骤
|
||||
|
||||
### 方式一:通过 CLI 参数
|
||||
|
||||
```bash
|
||||
codex --mcp-config '{"my-api":{"type":"http","url":"https://www.agentfoxapp.com/mcp/{projectId}","headers":{"Authorization":"Bearer {your-api-key}"}}}'
|
||||
```
|
||||
|
||||
### 方式二:通过配置文件
|
||||
|
||||
编辑 `~/.codex/config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 方式三:项目级配置
|
||||
|
||||
在项目根目录创建 `.codex/mcp.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 验证连接
|
||||
|
||||
启动 Codex 后,在对话中测试:
|
||||
|
||||
```
|
||||
你:调用 get_project_overview 查看 API 信息
|
||||
Codex:[调用 get_project_overview]
|
||||
项目信息如下:...
|
||||
```
|
||||
|
||||
## 安全提示
|
||||
|
||||
使用项目级配置时,建议将 `.codex/` 添加到 `.gitignore`。
|
||||
56
docs/clients/cursor.md
Normal file
56
docs/clients/cursor.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# Cursor
|
||||
|
||||
Cursor 是一款 AI 代码编辑器,支持通过 MCP 协议连接外部工具。
|
||||
|
||||
## 配置步骤
|
||||
|
||||
### 方式一:通过配置文件
|
||||
|
||||
在项目根目录创建 `.cursor/mcp.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 方式二:通过设置界面
|
||||
|
||||
1. 打开 Cursor 设置(`Cmd/Ctrl + ,`)
|
||||
2. 搜索 "MCP"
|
||||
3. 在 MCP Servers 配置区域添加服务器信息
|
||||
|
||||
## 使用方法
|
||||
|
||||
配置完成后,在 Cursor 的 AI 对话中(Agent 模式)即可使用 AgentFox 的 MCP 工具:
|
||||
|
||||
```
|
||||
你:帮我调用用户注册接口,参考 API 文档
|
||||
Cursor:[调用 search_endpoints keyword="register"]
|
||||
[调用 get_endpoint_detail endpointId="..."]
|
||||
根据 API 文档,注册接口是 POST /api/users/register...
|
||||
```
|
||||
|
||||
> **提示**:确保使用 Cursor 的 Agent 模式(而非 Ask 模式),Agent 模式才能调用 MCP 工具。
|
||||
|
||||
## 验证连接
|
||||
|
||||
1. 打开 Cursor 设置 → MCP 区域
|
||||
2. 检查 AgentFox 服务器状态是否显示为已连接(绿色指示灯)
|
||||
3. 在对话中要求调用 `get_project_overview` 测试
|
||||
|
||||
## 安全提示
|
||||
|
||||
建议将 `.cursor/mcp.json` 添加到 `.gitignore`:
|
||||
|
||||
```bash
|
||||
echo ".cursor/mcp.json" >> .gitignore
|
||||
```
|
||||
71
docs/clients/github-copilot.md
Normal file
71
docs/clients/github-copilot.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# GitHub Copilot
|
||||
|
||||
GitHub Copilot 通过 VS Code 的 MCP 支持连接 AgentFox。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- VS Code 版本 1.99 或更高
|
||||
- GitHub Copilot 扩展已安装并激活
|
||||
- GitHub Copilot Chat 扩展已安装
|
||||
|
||||
## 配置步骤
|
||||
|
||||
### 方式一:项目级配置(推荐)
|
||||
|
||||
在项目根目录创建 `.vscode/mcp.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> **注意**:VS Code MCP 配置的顶层键是 `servers`,不是 `mcpServers`。
|
||||
|
||||
### 方式二:用户级配置
|
||||
|
||||
在 VS Code 的 `settings.json` 中添加:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcp": {
|
||||
"servers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
在 Copilot Chat 中使用 Agent 模式(`@workspace` 或直接对话):
|
||||
|
||||
```
|
||||
你:帮我查看支付相关的 API 端点
|
||||
Copilot:[调用 search_endpoints keyword="payment"]
|
||||
找到以下支付相关端点:...
|
||||
```
|
||||
|
||||
## 验证连接
|
||||
|
||||
1. 打开 VS Code 命令面板(`Cmd/Ctrl + Shift + P`)
|
||||
2. 搜索 "MCP: List Servers"
|
||||
3. 确认 AgentFox 服务器状态为已连接
|
||||
|
||||
## 安全提示
|
||||
|
||||
建议将 `.vscode/mcp.json` 添加到 `.gitignore`,或使用 VS Code 的用户级配置来避免 API Key 泄露。
|
||||
82
docs/clients/other-clients.md
Normal file
82
docs/clients/other-clients.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# 其他 MCP 客户端
|
||||
|
||||
任何支持 MCP 协议 Streamable HTTP 传输的 AI 工具都可以连接 AgentFox。
|
||||
|
||||
## 连接要素
|
||||
|
||||
连接 AgentFox 只需要三个信息:
|
||||
|
||||
| 要素 | 值 |
|
||||
|------|-----|
|
||||
| **传输类型** | HTTP(Streamable HTTP) |
|
||||
| **URL** | `https://www.agentfoxapp.com/mcp/{projectId}` |
|
||||
| **认证** | `Authorization: Bearer {your-api-key}` |
|
||||
|
||||
## 通用配置格式
|
||||
|
||||
大多数 MCP 客户端使用 JSON 配置:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 其他已知兼容客户端
|
||||
|
||||
### Gemini CLI
|
||||
|
||||
Google 的 Gemini CLI 工具支持 MCP 协议。编辑 `~/.gemini/settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Antigravity
|
||||
|
||||
Antigravity AI 开发平台支持 MCP。在平台的 MCP 配置中添加 AgentFox 服务器即可。
|
||||
|
||||
### OpenClaw
|
||||
|
||||
OpenClaw AI 开发平台同样支持 MCP 协议,配置方式类似。
|
||||
|
||||
## 技术细节
|
||||
|
||||
如果你的工具需要手动实现 MCP 客户端连接,以下是关键技术参数:
|
||||
|
||||
| 参数 | 值 |
|
||||
|------|-----|
|
||||
| 协议 | MCP (Model Context Protocol) |
|
||||
| 传输方式 | Streamable HTTP |
|
||||
| HTTP 方法 | POST(发送请求)、GET(SSE 会话恢复)、DELETE(终止会话) |
|
||||
| 会话管理 | 通过 `mcp-session-id` 响应头建立,后续请求携带 |
|
||||
| 认证方式 | HTTP Bearer Token |
|
||||
| Content-Type | `application/json` |
|
||||
|
||||
## 自检清单
|
||||
|
||||
如果连接不成功,请检查:
|
||||
|
||||
- [ ] 传输类型是 `http`(不是 `sse` 或 `stdio`)
|
||||
- [ ] URL 包含正确的 projectId
|
||||
- [ ] API Key 以 `afk_` 开头
|
||||
- [ ] Authorization 头格式为 `Bearer {key}`(注意 Bearer 后有空格)
|
||||
- [ ] 网络可以访问 `www.agentfoxapp.com`
|
||||
45
docs/clients/windsurf.md
Normal file
45
docs/clients/windsurf.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# Windsurf
|
||||
|
||||
Windsurf 是 Codeium 推出的 AI 代码编辑器,支持 MCP 协议。
|
||||
|
||||
## 配置步骤
|
||||
|
||||
### 1. 找到配置文件
|
||||
|
||||
| 系统 | 路径 |
|
||||
|------|------|
|
||||
| macOS | `~/.codeium/windsurf/mcp_config.json` |
|
||||
| Windows | `%USERPROFILE%\.codeium\windsurf\mcp_config.json` |
|
||||
| Linux | `~/.codeium/windsurf/mcp_config.json` |
|
||||
|
||||
如果文件不存在,手动创建即可。
|
||||
|
||||
### 2. 编辑配置文件
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-api": {
|
||||
"type": "http",
|
||||
"url": "https://www.agentfoxapp.com/mcp/{projectId}",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {your-api-key}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 重启 Windsurf
|
||||
|
||||
保存配置后,重启 Windsurf 使配置生效。
|
||||
|
||||
## 验证连接
|
||||
|
||||
在 Windsurf 的 Cascade 对话中:
|
||||
|
||||
```
|
||||
你:请调用 get_project_overview 查看我的 API 概览
|
||||
```
|
||||
|
||||
如果返回了项目信息,说明配置成功。
|
||||
Reference in New Issue
Block a user