GitHub MCP Server enables AI agents to manage repos, read/update files, handle issues/PRs, branches, and automate GitHub workflows via the API.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install github-mcp或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install github-mcp⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/github-mcp/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: github-mcp description: GitHub MCP Server for repository management, file operations, PR/issue tracking, branch management, and GitHub API integration. Enable AI agents to clone repos, read code, create/update files, manage issues and pull requests, search code, and interact with the GitHub platform. Essential for development workflows, code review automation, CI/CD management, and repository operations. Use when agents need to work with Git repositories, manage development workflows, automate GitHub tasks, or interact with source code. ---
> Complete GitHub Integration for AI Agents
Connect AI agents to GitHub for repository management, code operations, issue tracking, pull requests, and the full GitHub API.
Enable agents to perform complex GitHub operations that previously required manual API integration:
OAuth-based authentication with fine-grained permissions. Agents access only what you authorize.
Pre-configured tools for the most common GitHub workflows. No manual API calls required.
# Community-maintained GitHub MCP server
npm install -g @modelcontextprotocol/server-github
# Or build from source
git clone https://github.com/modelcontextprotocol/servers-archived
cd servers-archived/src/github
npm install
npm run build
Several community implementations available. Check the MCP Registry for current options.
Add to your MCP client config:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}
- repo - Full repository access - read:user - Read user profile - read:org - Read organization data (if needed)
Fine-Grained Token (recommended):
Agent: "Create a new repository called 'my-project'"
Agent: "Clone the OpenAI GPT-4 repository"
Agent: "What files are in the src/ directory?"
Agent: "Show me the README.md file"
Agent: "Read the contents of src/index.ts"
Agent: "Create a new file docs/API.md with API documentation"
Agent: "Update the version in package.json to 2.0.0"
Agent: "Search for files containing 'authentication logic'"
Agent: "Find where the DatabaseConnection class is defined"
Agent: "Create an issue: 'Add dark mode support'"
Agent: "Show me all open bugs"
Agent: "What issues are assigned to me?"
Agent: "Create a PR to merge feature/login into main"
Agent: "Review PR #42 and check for security issues"
Agent: "Create a new branch called 'feature/user-auth'"
Agent: "Show all branches in this repo"
Agent: "Merge 'develop' into 'main'"
Agent: "Create a release v2.0.0 with the latest changes"
Agent: "Find popular React component libraries"
Agent: "Fork the Vue.js repository to my account"
Human: "Review all PRs and flag security issues"
Agent:
1. list_pull_requests(state="open")
2. For each PR:
- get_pull_request(pr_number)
- read_changed_files()
- analyze for security vulnerabilities
- create_review_comment(security_findings)
Human: "Label all new issues with 'needs-triage'"
Agent:
1. list_issues(state="open", labels=null)
2. For each unlabeled issue:
- read_issue(issue_number)
- add_label("needs-triage")
Human: "Prepare v2.0.0 release"
Agent:
1. create_branch("release/v2.0.0")
2. update_file("package.json", version="2.0.0")
3. update_file("CHANGELOG.md", new_release_notes)
4. create_pull_request("release/v2.0.0" -> "main")
5. create_release(tag="v2.0.0", notes=changelog)
Human: "Update documentation from code comments"
Agent:
1. search_code(query="* @description")
2. extract_docstrings()
3. generate_markdown_docs()
4. update_file("docs/API.md", generated_docs)
5. create_pull_request("Update API documentation")
Agents that help developers with repetitive GitHub tasks: creating issues, managing labels, updating documentation, code review.
Build agents that trigger workflows, check build status, create releases, manage deployments.
Analyze code quality, track issue resolution time, monitor PR velocity, generate reports.
Find code patterns, identify dependencies, discover similar implementations, locate technical debt.
Sync code comments to docs, generate API references, update changelogs, maintain README files.
Prefer fine-grained tokens over classic PATs. Limit scope to specific repositories and permissions.
If the agent only needs to read code/issues, grant read-only access.
Never hard-code tokens. Always use environment variables.
Rotate tokens regularly. Set expiration dates.
Monitor what the agent does. GitHub activity log tracks all API operations.
Authenticated Requests:
Best Practices:
If-None-Match headers)| Task | Manual API | GitHub MCP | |------|------------|-----------| | Setup Time | Hours (auth, SDK, error handling) | Minutes (config file) | | Code Required | Yes (HTTP client, auth, parsing) | No (MCP tools auto-discovered) | | Agent Integration | Manual tool definitions | Automatic via MCP | | Auth Management | Custom implementation | Built-in OAuth flow | | Error Handling | Custom retry logic | Handled by server |
repo, read:user)owner/repoX-RateLimit-Reset header)...
安装 GitHub MCP Server 后,可以对 AI 说这些话来触发它
Help me get started with GitHub MCP Server
Explains what GitHub MCP Server does, walks through the setup, and runs a quick demo based on your current project
Use GitHub MCP Server to gitHub MCP Server enables AI agents to manage repos, read/update fi...
Invokes GitHub MCP Server with the right parameters and returns the result directly in the conversation
What can I do with GitHub MCP Server in my developer & devops workflow?
Lists the top use cases for GitHub MCP Server, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/github-mcp/ 目录(个人级,所有项目可用),或 .claude/skills/github-mcp/(项目级)。重启 AI 客户端后,用 /github-mcp 主动调用,或让 AI 根据上下文自动发现并使用。
GitHub MCP Server 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
GitHub MCP Server 可免费安装使用。请查阅仓库了解许可证信息。
GitHub MCP Server enables AI agents to manage repos, read/update files, handle issues/PRs, branches, and automate GitHub workflows via the API.
GitHub MCP Server 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using GitHub MCP Server
Identifies repetitive steps in your workflow and sets up GitHub MCP Server to handle them automatically