home / mcp / github mcp server
MCP server providing GitHub API functionality for file ops, repo management, search, and more.
Configuration
View docs{
"mcpServers": {
"asbloom-py-mcp-servers": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}You can use the GitHub MCP Server to automate and extend your interactions with GitHub — from creating or updating files and managing repositories to searching code, issues, and users. This server exposes a rich set of endpoints you can drive from any MCP client to perform common GitHub workflows with proper history and error handling.
You interact with the GitHub MCP Server through an MCP client. Use the provided tools to perform file operations, manage repositories, create issues and pull requests, fork repositories, and run code searches across repositories. Every action preserves Git history and supports batch operations when pushing multiple files.
Prerequisites: Node.js installed on your machine. You can verify by running node -v and npm -v.
Install and run the MCP client configuration locally using the included example setup for Claude Desktop.
Create the Claude Desktop MCP configuration snippet with your GitHub personal access token.
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}The GitHub MCP Server requires a GitHub access token with the appropriate permissions. Keep this token secret and do not expose it in client logs or shared configurations.
Environment variables shown in the example include GITHUB_PERSONAL_ACCESS_TOKEN. You should replace <YOUR_TOKEN> with a token that you generate with the necessary repo scope or public_repo scope if only public repositories are accessed.
Create or update a single file in a repository. Inputs include owner, repo, path, content, message, branch, and optional sha for updates.
Push multiple files in a single commit. Inputs include owner, repo, branch, files (with path and content), and message.
Search for GitHub repositories using a query, with optional pagination.
Create a new GitHub repository with name, description, privacy setting, and optional auto initialization.
Get contents of a file or directory for a given path and branch.
Create a new issue with optional body, assignees, labels, and milestone.
Create a new pull request with title, body, head, base, and optional draft and maintainer modification rights.
Fork a repository, optionally into an organization.
Create a new branch from a source branch.
List and filter issues for a repository by state, labels, sort, direction, and date.
Update an existing issue with new title, body, state, labels, assignees, and milestone.
Add a comment to an issue or pull request.
Search code across repositories using GitHub code search syntax.
Search for issues and pull requests using GitHub issues search syntax.
Search for GitHub users using the GitHub users search syntax.
Retrieve commits for a branch in a repository.
Get details for a specific issue.
Retrieve comments on an issue or pull request.