Skip to content

nhevers/mcp-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mcp-github

MCP server for GitHub operations. Provides tools for repository management, issues, pull requests and code search.

Installation

pip install -r requirements.txt

Quick Start

from mcpgithub import GitHubServer

server = GitHubServer(token="ghp_...")
server.run()

Features

  • Repository listing and management
  • Issue and PR operations
  • Code and repository search
  • File read and write operations
  • Branch management

MCP Tools

list_repos

List repositories for a user or organization.

{
  "name": "list_repos",
  "arguments": {
    "owner": "username",
    "type": "all"
  }
}

get_file

Get contents of a file from a repository.

{
  "name": "get_file",
  "arguments": {
    "owner": "username",
    "repo": "repo-name",
    "path": "src/main.py"
  }
}

create_issue

Create a new issue.

{
  "name": "create_issue",
  "arguments": {
    "owner": "username",
    "repo": "repo-name",
    "title": "Bug report",
    "body": "Description..."
  }
}

search_code

Search for code across repositories.

{
  "name": "search_code",
  "arguments": {
    "query": "function authenticate",
    "language": "python"
  }
}

create_pr

Create a pull request.

{
  "name": "create_pr",
  "arguments": {
    "owner": "username",
    "repo": "repo-name",
    "title": "Add feature",
    "head": "feature-branch",
    "base": "main"
  }
}

Configuration

server = GitHubServer(
    token="ghp_...",
    default_owner="myorg"
)

Environment variables:

GITHUB_TOKEN=ghp_...
GITHUB_DEFAULT_OWNER=myorg

Examples

Claude Desktop configuration

{
  "mcpServers": {
    "github": {
      "command": "python",
      "args": ["-m", "mcpgithub"],
      "env": {
        "GITHUB_TOKEN": "ghp_..."
      }
    }
  }
}

License

MIT

About

MCP server for GitHub operations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages