GitHub MCP¶
GitHub's official MCP server for repository management, issues, pull requests, Actions, and code security. Connects over HTTP using a Personal Access Token.
Source: github/github-mcp-server
Enabling¶
The server is included in servers.yaml with enabled: false. To activate it permanently:
Or enable for the current session only:
Server Config¶
github:
type: http
url: https://api.githubcopilot.com/mcp/
headers:
Authorization: "Bearer ${GITHUB_TOKEN}"
Accept: "application/json, text/event-stream"
timeout: 120
enabled: true
Setup¶
- Create a Personal Access Token at https://github.com/settings/tokens
- Add it to your
secrets.yaml: - Set
enabled: trueinservers.yaml
Tools¶
| Toolset | Description |
|---|---|
repos |
Browse code, search files, analyze commits, manage branches |
issues |
Create, update, list, search, and manage issues |
pull_requests |
Create PRs, review changes, merge, manage reviews |
actions |
Monitor workflows, analyze build failures, trigger runs |
code_security |
Review security findings, Dependabot alerts |
Usage Patterns¶
- Search before creating: Check for existing issues/PRs before creating new ones
- Batch operations: Use list tools to get multiple items at once rather than individual gets
- Code changes: Create branch → push files → create PR
- Issue workflow:
search_issues→issue_read→add_issue_commentorissue_write
Examples¶
1. Check who you're authenticated as¶
Verify your token is working and see your account details.
2. List open PRs waiting for review¶
See what's pending in a repository.
3. Search for bug issues across a repo¶
Find open bugs without browsing the UI.
4. Get the contents of a file¶
Read any file directly from a branch — useful for comparing config across environments.
5. Find code using a specific pattern across GitHub¶
Search for all public usage of an API or function name.
6. Get the latest release of a repository¶
Check the current published version of any project.
github.get_latest_release(owner="microsoft", repo="playwright-mcp")
# Returns: tag_name, published_at, assets, body (release notes)
7. Create a new issue¶
File a bug or feature request with a structured body.
github.issue_write(
owner="myorg",
repo="myrepo",
title="Fix: connection timeout on slow networks",
body="## Description\nConnection drops after 30s on high-latency links.\n\n## Steps to reproduce\n1. ...",
)
8. Push a file change in one call¶
Create or update a file without cloning the repo locally.
github.push_files(
owner="myorg",
repo="myrepo",
branch="main",
message="docs: update changelog",
files=[{"path": "CHANGELOG.md", "content": "## v1.2.0\n- Added X\n- Fixed Y\n"}],
)
Common Mistakes to Avoid¶
- Don't create duplicate issues — search first
- Don't forget to specify the repository in
owner/repoformat - Don't make multiple API calls when a single list or search call works
- Check PR status before attempting to merge