Github-MCP

A Model Context Protocol (MCP) server implementation that provides a set of tools for interacting with GitHub repositories programmatically. Written in Typescript.

GitHubスター

1

ユーザー評価

未評価

フォーク

0

イシュー

0

閲覧数

1

お気に入り

0

README
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
  1. Clone the repository
  2. Install dependencies:
bun install
  1. Create a .env file with your GitHub token:
GITHUB_TOKEN=your_token_here
Usage

Start the MCP server(Claude):

  1. Install Bun
bun index.ts
  1. For command you may have to provide the directory of your bun.
which bun
  1. 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:

  1. Install the GitHub Copilot extension in VS Code
  2. 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"
        }, 
    }
  }
}
  1. Restart VS Code and GitHub Copilot will have access to the GitHub MCP tools
Available Tools
  1. get-user-info

    • Gets information about the authenticated user
  2. list-repos

    • Lists repositories for the authenticated user
  3. get-repo

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
  4. list-branches

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
  5. list-following

    • Lists GitHub users you are following
  6. make-a-commit

    • Parameters:
      • message: Commit message
      • content: File content
      • path: File path
      • branch: Target branch
      • repo: Repository name
  7. create-branch

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • branch: New branch name
      • from_branch: (Optional) Source branch
  8. get-file

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • path: File path
      • branch: Branch name
  9. list-repo-contents

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • path: Directory path
      • branch: Branch name
  10. compare-branches

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • base: Base branch
      • head: Head branch
  11. delete-file

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • path: File path
      • sha: File SHA
      • branch: Branch name
  12. update-file

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • path: File path
      • content: New content
      • sha: File SHA
      • branch: Branch name
  13. get-branch

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • branch: Branch name
  14. get-latest-commit

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • branch: Branch name
  15. get-pull-requests

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • state: (Optional) Filter by state ("all", "open", "closed")
  16. create-pull-request

    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • head: Head branch
      • base: Base branch
      • title: PR title
      • body: (Optional) PR description
Development

This project uses Bun as the runtime environment. Make sure you have Bun installed before running the project.

MCP Server Video Showcase

License

MIT

作者情報
Aditya Anand

Jadavpur University '27 | iOS Developer | Swift | C++ | Python | TypeScript

Kolkata

8

フォロワー

10

リポジトリ

0

Gist

18

貢献数

トップ貢献者

スレッド