一键导入
gitcode-mcp-install
安装和配置 GitCode MCP Server,使 AI 客户端能与 GitCode 平台交互(仓库/分支/Issue/PR 管理)。触发词:安装 gitcode mcp、配置 gitcode mcp、gitcode mcp server。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
安装和配置 GitCode MCP Server,使 AI 客户端能与 GitCode 平台交互(仓库/分支/Issue/PR 管理)。触发词:安装 gitcode mcp、配置 gitcode mcp、gitcode mcp server。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | gitcode-mcp-install |
| description | 安装和配置 GitCode MCP Server,使 AI 客户端能与 GitCode 平台交互(仓库/分支/Issue/PR 管理)。触发词:安装 gitcode mcp、配置 gitcode mcp、gitcode mcp server。 |
⚠️ 禁止在屏幕、日志、错误信息中打印
GITCODE_TOKEN环境变量
Token 仅存储在安全位置(环境变量或配置文件),不要在终端输出中暴露。文档/代码示例必须用占位符 <YOUR_GITCODE_TOKEN>。
两种安装方式按环境选择。
go install gitcode.com/gitcode-ai/gitcode_mcp_server@latest
注意:Go 二进制方式在国内网络可能失败(GitCode 不支持 Go module 代理)。 若失败请使用 Python 方式。
标准安装:
git clone https://gitcode.com/gitcode-ai/gitcode_mcp_server.git /tmp/gitcode_mcp_server
pip3 install -e /tmp/gitcode_mcp_server
安装 PR #3 版本(推荐,修复分页截断问题):
PR #3 修复了
list_pull_request_comments分页截断问题,新增评论类型过滤、回复评论等功能。
# 克隆仓库
git clone https://gitcode.com/gitcode-ai/gitcode_mcp_server.git /tmp/gitcode_mcp_server
cd /tmp/gitcode_mcp_server
# 获取并切换到 PR #3
git fetch origin +refs/merge-requests/3/head:pr_3
git checkout pr_3
# 安装
pip3 install -e .
Python >= 3.8
重要:Python 安装方式会自动注册
gitcode-mcp命令,配置方式与 Go 二进制相同。
脚本会在 ~/.config/opencode/opencode.json 不存在时创建默认配置,并把 token 写成占位符。
你只需要在安装完成后把占位符替换成真实 token,修改后需重启 OpenCode 才能生效。
模板如下(按需求固定格式):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"gitcode": {
"type": "local",
"command": [
"gitcode-mcp"
],
"enabled": true,
"environment": {
"GITCODE_TOKEN": "<YOUR_GITCODE_TOKEN>",
"GITCODE_API_URL": "https://api.gitcode.com/api/v5"
}
}
}
}
注意:不要在对话里发送或者询问GITCODE_TOKEN,若用户主动提供需要提醒用户存在泄露风险。只需要修改本机文件 ~/.config/opencode/opencode.json。
repo、read:user 权限)手动验证:
# 1. 检查命令是否存在
which gitcode-mcp
# 2. 检查配置文件
cat ~/.config/opencode/opencode.json | grep -A5 gitcode
# 3. 测试 API 连接(替换 <YOUR_TOKEN> 为真实 token)
curl -s "https://api.gitcode.com/api/v5/user/repos?access_token=<YOUR_TOKEN>&per_page=5" | jq '.[].full_name'
验证要点:
which gitcode-mcp 返回路径GITCODE_TOKEN 不是占位符注意:修改
~/.config/opencode/opencode.json后需重启 OpenCode 才能生效。
如需代理访问 GitCode API,把代理环境变量加入 OpenCode 的 environment:
"environment": {
"GITCODE_TOKEN": "<YOUR_GITCODE_TOKEN>",
"GITCODE_API_URL": "https://api.gitcode.com/api/v5",
"HTTP_PROXY": "http://proxy:8080",
"HTTPS_PROXY": "http://proxy:8080"
}
| 问题 | 处理 |
|---|---|
gitcode-mcp: command not found | 确认 PATH:which gitcode-mcp |
| API 401/403 | token 无效/权限不足,更新 ~/.config/opencode/opencode.json |
| 连接超时 | 检查网络或配置代理 |
| 配置文件不存在 | 手动创建 ~/.config/opencode/opencode.json |
PyPTO Pass 编译性能优化技能。用于分析和优化 Pass 模块的编译性能,当 Pass 编译耗时过长需要优化时使用此技能。
定位测试案例中出现 aicore error 时的问题 CCE 文件和问题代码行。当用户说"aicore error"、"定位 aicore error 的原因"、"帮我定位 aicore error 报错"时使用此技能。也适用于用户直接提供 CCE 文件希望定位问题代码行或映射到源码的场景。
PyPTO 环境安装与环境问题修复,包括 CANN、torch_npu、编译工具链、第三方依赖和 PyPTO 编译运行等。触发词:PyPTO environment setup, CANN install, torch_npu, NPU environment, Ascend toolkit, compile PyPTO, build PyPTO, NPU driver, prepare_env, diagnose environment, fix import error, torch_npu import fail, DT_FP8E8M0, pto-isa, ASCEND_HOME_PATH, npu-smi, softmax verify, pip dependency conflict
分析当前 session 上下文,识别 PyPTO 框架或文档不完善导致的断裂点,产出可转化为 Issue 的结构化报告。当用户在 pypto 相关 skill 运行结束后提到"断裂点"、"识别断裂点"、"检测断裂点"、"fracture point"时触发此 skill。也适用于用户对 session 中遇到的问题进行复盘、想要生成问题报告、或希望改进 pypto 框架/文档质量的场景。
分析 host 侧捕获异常后的堆栈信息,通过地址到源码行映射和符号解析,定位问题代码位置。支持 Python traceback、C++ stack trace 和混合堆栈的自动识别与分析。支持编译Debug版本PyPTO包并定位具体代码行。Triggers:"堆栈分析"、"堆栈反汇编"、"分析堆栈信息"、"地址到源码行"、"stack trace"、"backtrace"
PyPTO MACHINE 内存重叠检测与修复技能。通过系统化流程检测和修复 workspace 内存重叠、内存管理策略问题导致的精度异常。当怀疑精度问题由内存重叠、workspace 不足、内存管理异常引起时使用此技能。触发词:内存重叠、内存重叠检测、workspace问题、内存管理异常、内存复用错误。