Github-MCP
GitHub MCP Serverは、GitHubリポジトリとプログラム的に対話するためのツールセットを提供するMCPサーバーの実装です。ユーザー管理、リポジトリ操作、ブランチ管理、ファイル操作、プルリクエスト管理などの機能を備えています。これにより、開発者はGitHubの機能を効率的に利用できます。
GitHubスター
1
ユーザー評価
未評価
お気に入り
0
閲覧数
18
フォーク
0
イシュー
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
