Github-MCP
The GitHub MCP Server is an implementation of a Model Context Protocol server that provides a set of tools for programmatically interacting with GitHub repositories. It features user management, repository operations, branch management, file operations, and pull request management. This allows developers to efficiently utilize GitHub's functionalities.
GitHub Stars
1
User Rating
Not Rated
Favorites
0
Views
17
Forks
0
Issues
0
GitHub MCP Server 🚀
A Model Context Protocol (MCP) server implementation that provides a set of tools for interacting with GitHub repositories programmatically.
Features
User Management
- Get user information
- List following users
Repository Operations
- List repositories
- Get repository details
- List repository contents
- Compare branches
Branch Management
- List branches
- Get branch details
- Create new branches
- Get latest commit
File Operations
- Get file contents
- Update files
- Delete files
- Create commits
Pull Request Management
- List pull requests
- Create pull requests
Installation
- Clone the repository
- Install dependencies:
bun install
- Create a
.envfile with your GitHub token:
GITHUB_TOKEN=your_token_here
Usage
Start the MCP server(Claude):
- Install Bun
bun index.ts
- For command you may have to provide the directory of your bun.
which bun
- Add the mcp server to claude_desktop_config.json(currently only claude desktop supports mcp capabilities)
{
"mcpServers": {
"Github-MCP": {
"command": "/Users/<user>>/.bun/bin/bun",
"args": ["index.ts"]
}
}
}
GitHub Copilot
You can also use this MCP server with GitHub Copilot by configuring it in your development environment:
- Install the GitHub Copilot extension in VS Code
- Configure the MCP server in your workspace settings or global settings:
"mcp": {
"servers": {
"github-mcp-test2": {
"command": "/Users/<user>/.bun/bin/bun",
"args": ["/path/to/your/Github-MCP/index.ts"],
"env": {
"GITHUB_TOKEN": "YOUR_PERSONAL_ACCOUNT_TOKEN"
},
}
}
}
- Restart VS Code and GitHub Copilot will have access to the GitHub MCP tools
Available Tools
get-user-info- Gets information about the authenticated user
list-repos- Lists repositories for the authenticated user
get-repo- Parameters:
owner: Repository ownerrepo: Repository name
- Parameters:
list-branches- Parameters:
owner: Repository ownerrepo: Repository name
- Parameters:
list-following- Lists GitHub users you are following
make-a-commit- Parameters:
message: Commit messagecontent: File contentpath: File pathbranch: Target branchrepo: Repository name
- Parameters:
create-branch- Parameters:
owner: Repository ownerrepo: Repository namebranch: New branch namefrom_branch: (Optional) Source branch
- Parameters:
get-file- Parameters:
owner: Repository ownerrepo: Repository namepath: File pathbranch: Branch name
- Parameters:
list-repo-contents- Parameters:
owner: Repository ownerrepo: Repository namepath: Directory pathbranch: Branch name
- Parameters:
compare-branches- Parameters:
owner: Repository ownerrepo: Repository namebase: Base branchhead: Head branch
- Parameters:
delete-file- Parameters:
owner: Repository ownerrepo: Repository namepath: File pathsha: File SHAbranch: Branch name
- Parameters:
update-file- Parameters:
owner: Repository ownerrepo: Repository namepath: File pathcontent: New contentsha: File SHAbranch: Branch name
- Parameters:
get-branch- Parameters:
owner: Repository ownerrepo: Repository namebranch: Branch name
- Parameters:
get-latest-commit- Parameters:
owner: Repository ownerrepo: Repository namebranch: Branch name
- Parameters:
get-pull-requests- Parameters:
owner: Repository ownerrepo: Repository namestate: (Optional) Filter by state ("all", "open", "closed")
- Parameters:
create-pull-request- Parameters:
owner: Repository ownerrepo: Repository namehead: Head branchbase: Base branchtitle: PR titlebody: (Optional) PR description
- Parameters:
Development
This project uses Bun as the runtime environment. Make sure you have Bun installed before running the project.
License
MIT
