Install
openclaw skills install github-mcpClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
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.
openclaw skills install github-mcpComplete 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 accessread:user - Read user profileread: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){
"mcpServers": {
"github": {
"command": "node",
"args": ["/path/to/github-mcp/build/index.js"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxx",
"GITHUB_API_URL": "https://api.github.com",
"DEFAULT_BRANCH": "main",
"AUTO_PAGINATION": "true"
}
}
}
}
The GitHub integration every coding agent needs: From code review to release automation, GitHub MCP brings the full power of GitHub to AI agents.