Automate Your GitHub Workflow with AI and MCP
The GitHub MCP server connects your AI directly to the GitHub API. Create issues, review pull requests, search code, and manage your repos — all through conversation, without switching to the browser.
Servers You'll Need
Step-by-Step Setup
- 1
Create a GitHub Personal Access Token
Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic). Create a token with repo scope (and optionally read:org if you want org access).
- 2
Install the server
`npm install -g @modelcontextprotocol/server-github`
- 3
Add the config with your token
Add the server to your AI client config. Set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable to your token.
- 4
Start automating
Ask the AI to create issues, review open PRs, or search your codebase. The AI uses the GitHub API directly.
Example Prompts to Try
- “List the open issues in my-username/my-repo”
- “Create a bug report issue: the login page crashes on mobile Safari”
- “Summarize the changes in PR #42”
- “Search for all uses of deprecated_function across the repo”
- “What are the most recent commits to the main branch?”
Tips
- Use a token with minimal required scopes to reduce risk.
- Combine with the filesystem server to let the AI read local code and create GitHub issues about what it finds.
- The AI can draft PR descriptions from your local git diff if you combine git + GitHub servers.
FAQ
Can the AI push code to GitHub?
The GitHub MCP server uses the GitHub API, which doesn't support raw git pushes. It can create files and commits via the API, but for full git workflows you'd also need the git server.
Does this work with GitHub Enterprise?
The server supports a GITHUB_API_URL environment variable for Enterprise deployments.