grysonbaltazar/github-mcp
If you are the rightful owner of github-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
An MCP server for interacting with the GitHub API, enabling AI assistants to query various GitHub resources.
GitHub MCP Server
An MCP (Model Context Protocol) server that provides tools for interacting with the GitHub API. This server enables AI assistants to query repositories, pull requests, issues, commits, users, and more.
Features
- 🔍 Search repositories and users
- 📦 Get repository information
- 🔀 List and view pull requests
- 🐛 List and view issues
- 📝 View commits and compare branches
- 👤 Get user information
- 📄 Read file contents from repositories
- 🏷️ List releases and branches
Prerequisites
- Node.js (v18 or higher)
- A GitHub Personal Access Token
Installation
- Clone this repository:
git clone https://github.com/grysonbaltazar/github-mcp.git
cd github-mcp
- Install dependencies:
npm install
- Build the TypeScript code:
npm run build
Configuration
Get a GitHub Token
- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token (classic)"
- Give it a name (e.g., "MCP Server")
- Select scopes:
repo- Full control of private repositoriesread:user- Read user profile dataread:org- Read org and team membership (optional)
- Generate and copy the token
For Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"github": {
"command": "node",
"args": ["/path/to/github-mcp/build/index.js"],
"env": {
"GITHUB_TOKEN": "your_github_token_here"
}
}
}
}
For Cursor
Edit ~/.cursor/mcp_config.json:
{
"mcpServers": {
"github": {
"command": "node",
"args": ["/path/to/github-mcp/build/index.js"],
"env": {
"GITHUB_TOKEN": "your_github_token_here"
}
}
}
}
Usage
Once configured, the MCP server provides the following tools:
get_repository- Get detailed information about a repositorylist_user_repos- List repositories for a user or organizationsearch_repositories- Search for repositories on GitHubget_pull_request- Get details about a specific pull requestlist_pull_requests- List pull requests for a repositoryget_pr_files- Get the list of files changed in a pull requestget_pr_comments- Get review comments on a pull requestget_commit- Get details about a specific commitlist_commits- List commits in a repositorycompare_commits- Compare two commits or branchesget_issue- Get details about a specific issuelist_issues- List issues for a repositoryget_issue_comments- Get comments on an issuelist_branches- List branches in a repositoryget_branch- Get details about a specific branchget_user- Get information about a GitHub usersearch_users- Search for users on GitHubget_file_contents- Get the contents of a file in a repositorylist_releases- List releases for a repositoryget_latest_release- Get the latest release for a repository
Development
Testing with MCP Inspector
npx @modelcontextprotocol/inspector node build/index.js
This will open a web interface where you can test all the tools interactively.
Watch Mode
npm run watch
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.