MCP 服务
CCG 安装器支持一键配置多个 MCP(Model Context Protocol)服务,为 Claude Code 提供代码检索和文档查询能力。
支持的 MCP 服务
Section titled “支持的 MCP 服务”fast-context(推荐)
Section titled “fast-context(推荐)”Windsurf Fast Context 提供的代码语义检索服务。
特点:
- 自然语言搜索代码库
- 支持中英文双语查询
- API Key 可选(有则增强)
- 支持
FC_INCLUDE_SNIPPETS参数返回代码片段
配置:
{ "mcpServers": { "fast-context": { "command": "npx", "args": ["fast-context-mcp"], "env": { "FC_API_KEY": "your-key-here" } } }}ace-tool
Section titled “ace-tool”代码检索 MCP 工具,提供 search_context 和 enhance_prompt 功能。
特点:
- 代码语义搜索
- Prompt 增强
- 中转地址可用:
https://acemcp.heroman.wtf/
context7
Section titled “context7”免费的库文档查询 MCP,无需 API Key。安装时自动配置。
特点:
- 查询任何库/框架的最新文档
- 支持 React、Next.js、Prisma 等主流库
- 无需 API Key,开箱即用
配置:
{ "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@context7/mcp"] } }}MCP 同步
Section titled “MCP 同步”CCG 安装器会将 MCP 配置同步到多个模型的配置文件:
| 目标 | 配置文件 | 同步函数 |
|---|---|---|
| Claude Code | ~/.claude.json | 安装时自动写入 |
| Codex CLI | ~/.codex/config.toml | syncMcpToCodex() |
| Gemini CLI | ~/.gemini/settings.json | syncMcpToGemini() |
这确保所有三个模型 CLI 都能使用相同的 MCP 工具集。
运行 npx ccg-workflow 安装时,第三步是 MCP 工具选择:
Step 3/4: MCP 工具配置
选择要安装的 MCP 服务: [1] fast-context (推荐) — 语义代码检索 [2] ace-tool — 代码检索 + prompt 增强 [3] context7 — 免费库文档查询(自动安装) [4] 跳过 MCP 配置如果 MCP 工具不工作,使用诊断命令:
npx ccg-workflow diagnose-mcp该命令会检查:
- MCP 服务配置是否存在
- 对应的 npm 包是否已安装
- 服务是否可连接
- API Key 是否有效(如需要)