MCP GitHub Integration Setup
Configure your AI agentic IDE (Windsurf, Cursor, ...) to manage your GitHub repositories through the GitHub MCP server. The MCP server gives the AI access to repository code, Actions logs, issues, pull requests, and workflow management.
On This Page
- Overview
- Token Requirements
- Creating the Fine-grained PAT
- Windsurf Configuration
- Security Notes
- Troubleshooting
- Limitations
- References
Overview
The GitHub MCP server allows your AI assistant to:
- Read and manage repository code
- Check GitHub Actions workflow logs
- Create and manage issues and pull requests
- Verify package publishes
- Manage repository settings
Token Requirements
Fine-grained PATs do not support GitHub Packages (GitHub limitation). The MCP server uses repository permissions to access most features.
Creating the Fine-grained PAT
- Go to github.com > Settings > Developer settings > Personal access tokens > Fine-grained tokens
- Click Generate new token
- Token name:
mcp-ai-assistant-superloomdev - Description:
AI assistant IDE access to superloomdev organization. Allows reading code, checking Actions logs, creating PRs/issues, and managing workflows across all repos. Created: [Date]. No expiration. - Resource owner: Select your organization (
superloomdev) - Repository access: All repositories
- Permissions - Add these in order (matches GitHub UI):
Repository Permissions (Read and write)
Add permissions in this order:
- Actions - Workflows, workflow runs and artifacts
- Commit statuses - Commit statuses
- Contents - Repository contents, commits, branches, downloads, releases, and merges
- Environments - Manage repository environments
- Issues - Issues and related comments, assignees, labels, and milestones
- Metadata - (Required, read-only by default)
- Pages - Retrieve Pages statuses, configuration, and builds
- Pull requests - Pull requests and related comments, assignees, labels, milestones, and merges
- Repository security advisories - View and manage repository security advisories
- Secrets - Manage Actions repository secrets
- Variables - Manage Actions repository variables
- Webhooks - Manage the post-receive hooks for a repository
- Workflows - Update GitHub Action workflow files
Account Permissions
None required for basic MCP functionality.
Windsurf Configuration
Step 1: Locate MCP Config
Find your Windsurf MCP config file:
- macOS:
~/.codeium/windsurf/mcp_config.json - Windows:
%USERPROFILE%\.codeium\windsurf\mcp_config.json - Linux:
~/.codeium/windsurf/mcp_config.json
Step 2: Add GitHub MCP Server
Edit mcp_config.json:
json
{
"mcpServers": {
"github": {
"serverUrl": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "github_pat_xxx_YOUR_TOKEN_HERE"
}
}
}
}Replace github_pat_xxx_YOUR_TOKEN_HERE with your generated token.
Step 3: Store Token Reference (Personal)
Save your token name (not the token itself) to __dev__/me.md for your records:
markdown
# My Developer Context
## GitHub Tokens
| Name | Purpose | Location |
|------|---------|----------|
| `mcp-ai-superloomdev` | MCP server access | Windsurf config |
| `GITHUB_READ_PACKAGES_TOKEN` | Local package install | `__dev__/.env` |
## MCP Server Status
- GitHub MCP: Enabled (fine-grained PAT)
- Permissions: All repositories in superloomdevSecurity Notes
- Never commit tokens - The actual token lives in Windsurf config only
- Fine-grained scope - Token is limited to specific organization repositories
- No expiration - Set to your preference (recommend 90 days or 1 year)
- Audit trail - GitHub logs all API calls made via PAT
Troubleshooting
MCP Not Connecting
- Verify token is correctly pasted (no extra spaces)
- Check that
serverUrlis exactlyhttps://api.githubcopilot.com/mcp/ - Restart Windsurf IDE
Permission Errors
If MCP reports insufficient permissions:
- Go to token settings
- Verify the permission exists and is set to "Read and write"
- Note: GitHub Packages requires Classic PAT (fine-grained not supported)
Token Expired
- Generate new token with same permissions
- Update
mcp_config.json - Update
__dev__/me.mdwith new token name
Limitations
- GitHub Packages (Fine-grained PATs): Fine-grained PATs do not currently include
read:packagesorwrite:packagespermissions in the UI. Package publishing is handled via CI/CD using the built-inGITHUB_TOKENwithpackages: writejob permission. Seecicd-publishing.mdfor details. - Org-level settings: Some organization settings require Classic PAT or direct API access.
References
- GitHub MCP Server
- Fine-grained PAT Docs
- GitHub Packages Permissions - Note: Only Classic PATs supported