用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/gautam-achieveai/ClaudePlugins --skill setup-gh-mcp命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | setup-gh-mcp |
| description | Internal helper. Load only when explicitly named by another skill or agent. |
| user-invocable | true |
| disable-model-invocation | false |
| allowed-tools | ["Read","Write","Edit","Bash"] |
Set up GitHub MCP without making the user hand-edit config files. Prefer existing repo examples and git remote detection over questions.
Configure all local MCP entrypoints needed for this repo in one run:
.mcp.json for Claude Code.claude/settings.local.json only if the GitHub MCP server is not already enabled~/.copilot/mcp-config.json for GitHub Copilot CLIUse the committed examples as the canonical shapes. Reference files are in the
plugin's examples/ directory.
Resolve settings in this order:
GITHUB_PERSONAL_ACCESS_TOKENGITHUB_REPOSITORYGH_HOSTgit remote get-url originhttps://github.com/{owner}/{repo}.gitgit@github.com:{owner}/{repo}.githttps://{host}/{owner}/{repo}.gitgit@{host}:{owner}/{repo}.gitGH_HOST=github.comGITHUB_REPOSITORY=<owner>/<repo> from the remote when availableOnly ask the user for input if both environment variables and git remote detection fail to produce the required host/repository values.
If a PAT is not present, still write the config using the
${GITHUB_PERSONAL_ACCESS_TOKEN} placeholder from the examples. Do not hardcode
secret values into config files.
Target file: .mcp.json
.mcp.json does not exist, create it with a top-level mcpServers object.mcpServers.github entry and preserve all other servers.github server entry using the remote GitHub MCP server:{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
},
"defer_loading": true
}
}
}
Notes:
${GITHUB_PERSONAL_ACCESS_TOKEN}
placeholder.Target file: .claude/settings.local.json
enableAllProjectMcpServers is trueenabledMcpjsonServers exists and includes "github" exactly onceDo not remove unrelated permissions or settings.
Target file: ~/.copilot/mcp-config.json
~/.copilot directory exists.mcpServers object.mcpServers.github entry and preserve all other servers.github server entry with this shape:{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
}
}
}
}
Guidelines:
github so it can coexist with Copilot CLI's built-in
github-mcp-server.Validate all JSON files you touched:
.mcp.json.claude/settings.local.json~/.copilot/mcp-config.jsonUse the available shell to parse the JSON rather than assuming it is valid.
Examples:
Get-Content '<path>' -Raw | ConvertFrom-Json | Out-Nullpython -c "import json; json.load(open('<path>'))"node -e "JSON.parse(require('fs').readFileSync('<path>', 'utf8'))"If parsing fails, fix the file before reporting success.
At the end, summarize:
.claude/settings.local.json/mcp or claude mcp list/mcp show github and /mcp show github-mcp-server基于 SOC 职业分类