Claude Code / Codex MCP 与 Plugins 配置指南
本文档整理我当前使用的 MCP 和 Plugins,方便后续查阅、维护和扩展。
适用环境:Claude Code(终端)+ Codex(终端)
1. MCP
1.1 codegraph — 代码智能知识图谱
提供代码的 符号、依赖关系和文件结构 索引查询。
- 项目地址:https://github.com/colbymchenry/codegraph
- 包名:
@colbymchenry/codegraph
能力一览
| 工具 | 作用 | 典型问题 |
|---|---|---|
codegraph_context | 按任务描述返回入口、关键符号、调用关系和代码上下文 | "这个功能怎么实现?" |
codegraph_search | 按名称搜索符号 | "有没有 login 方法?" |
codegraph_node | 查看单个符号详情 | "UserService 在哪?" |
codegraph_explore | 一次查看多个相关符号/文件源码 | "认证相关函数一起看" |
codegraph_callers | 查询"谁调用了这个符号" | "谁在用这个函数?" |
codegraph_callees | 查询"这个符号调用了谁" | "函数内部依赖了什么?" |
codegraph_trace | 追踪从 A 到 B 的调用路径 | "请求怎么走到数据库?" |
codegraph_impact | 评估修改某个符号的影响范围 | "改这个方法会波及哪?" |
codegraph_files | 查看文件树和符号分布 | "项目目录结构?" |
codegraph_status | 查看索引状态 | "索引是否正常?" |
适用场景
- 阅读陌生项目时快速建立结构认知
- 调试时梳理调用链
- 重构前评估影响面
- 比
grep + Read更快地定位关键实现
安装
# 第一步:全局安装
npm install -g @colbymchenry/codegraph
# 第二步:运行,自动配置 Claude Code 和 Codex
npx @colbymchenry/codegraphnpx @colbymchenry/codegraph 会自动向 Claude Code 和 Codex 的配置文件写入 MCP server,无需手动编辑 settings.json。
更新
npm install -g @colbymchenry/codegraph@latest
npx @colbymchenry/codegraph更新后重新执行一次自动配置,确保 Claude Code / Codex 的配置与新版本一致。
卸载
npm uninstall -g @colbymchenry/codegraph卸载后还需手动清理 Claude Code 和 Codex 配置文件中对应的 MCP server 条目:
~/.claude/settings.json→ 删除mcpServers.codegraph
验证
- 在 Claude Code 会话中调用
codegraph_status,能正常返回即说明接入成功 - 检查
~/.claude/settings.json中是否包含codegraph的 MCP server 配置
使用方式
初始化索引
codegraph init -i用途:
- 在当前项目中初始化 codegraph 索引
- 为后续的符号查询、调用链分析、影响面分析建立本地数据
适用场景:
- 第一次在某个仓库中使用 codegraph
- 新仓库还没有建立索引时
建议:
- 进入项目根目录后执行
- 初始化完成后,再在 Claude Code 或 Codex 中使用相关 MCP 工具
同步索引
codegraph sync用途:
- 同步当前项目代码到 codegraph 索引
- 在代码新增、修改较多后,刷新索引内容
适用场景:
- 拉取新代码后
- 大量修改代码后
- 发现查询结果与当前代码不一致时
建议:
- 在重要改动后执行一次
- 如果怀疑索引过旧,优先先执行
codegraph sync
使用建议
| 场景 | 推荐工具 |
|---|---|
| 理解某个功能怎么实现 | codegraph_context → codegraph_explore |
| 追踪调用链 | codegraph_trace → codegraph_callers / codegraph_callees |
| 评估改动影响 | codegraph_impact → codegraph_callers |
| 按名字定位符号 | codegraph_search → codegraph_node |
2. Plugins
2.1 Superpowers — 终端 Agent 工作流技能包
为 Claude Code / Codex 提供系统化的工作流方法论,覆盖从规划到验收的完整开发周期。
主要 Skills
流程与规划
| Skill | 作用 |
|---|---|
superpowers:using-superpowers | 总控规则,约束 skill 使用流程 |
superpowers:brainstorming | 需求梳理、方案设计前的脑暴 |
superpowers:writing-plans | 多步骤任务的实施计划 |
superpowers:executing-plans | 按计划执行并检查 |
superpowers:subagent-driven-development | 多子 agent 协作开发 |
superpowers:dispatching-parallel-agents | 并行分派独立任务 |
开发与调试
| Skill | 作用 |
|---|---|
superpowers:test-driven-development | TDD 工作流 |
superpowers:systematic-debugging | 系统化排查 bug |
superpowers:verification-before-completion | 完工前验证 |
评审与收尾
| Skill | 作用 |
|---|---|
superpowers:requesting-code-review | 主动请求代码审查 |
superpowers:receiving-code-review | 处理收到的 review 意见 |
superpowers:finishing-a-development-branch | 分支收尾:合并、提 PR |
配套增强
| Skill | 作用 |
|---|---|
superpowers:using-git-worktrees | git worktree 隔离工作区 |
superpowers:writing-skills | 编写/修改 skill 本身 |
安装
# Claude Code
claude plugins install superpowers安装完成后,相关 skills 会出现在可用技能列表中。Codex 也会自动配置。
更新
claude plugins update superpowers卸载
claude plugins uninstall superpowers验证
- 在 Claude Code 会话中输入
/superpowers:brainstorming,能正常触发即说明安装成功
使用建议
| 场景 | 推荐组合 |
|---|---|
| 新功能开发 | brainstorming → writing-plans → test-driven-development → verification-before-completion |
| 修 bug | systematic-debugging → verification-before-completion |
| 代码审查 | requesting-code-review / receiving-code-review |
| 分支收尾 | finishing-a-development-branch |
3. Superpowers 与 Codegraph 配合使用
- Superpowers 决定“应该怎么做”
- Codegraph 帮助“快速看清代码结构”
| 场景 | 流程 |
|---|---|
| 做功能前 | brainstorming → codegraph_context → writing-plans |
| 修 bug 时 | systematic-debugging → codegraph_trace → verification-before-completion |
| 改公共模块 | codegraph_impact → writing-plans → requesting-code-review |
评论