github

github

4.3

MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.

The GitHub MCP Server is a powerful tool designed to interact with the GitHub API, facilitating a wide range of operations such as file management, repository creation, and advanced search capabilities. It supports automatic branch creation, comprehensive error handling, and maintains Git history integrity. The server is equipped to handle both single and batch file operations, making it versatile for various development needs. Additionally, it offers advanced search functionalities for code, issues, pull requests, and users, enhancing the ability to navigate and manage GitHub repositories efficiently. The server is designed to integrate seamlessly with different platforms, including Claude Desktop and VS Code, through Docker and NPX configurations, ensuring ease of use and flexibility for developers.

Features

  • Automatic Branch Creation
  • Comprehensive Error Handling
  • Git History Preservation
  • Batch Operations
  • Advanced Search

MCP Tools

  • create_or_update_file: Create or update a single file in a repository
  • push_files: Push multiple files in a single commit
  • search_repositories: Search for GitHub repositories
  • create_repository: Create a new GitHub repository
  • get_file_contents: Get contents of a file or directory

Usage with Different Platforms

Claude Desktop

{'Docker': {'script': '\n{\n  "mcpServers": {\n    "github": {\n      "command": "docker",\n      "args": [\n        "run",\n        "-i",\n        "--rm",\n        "-e",\n        "GITHUB_PERSONAL_ACCESS_TOKEN",\n        "mcp/github"\n      ],\n      "env": {\n        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"\n      }\n    }\n  }\n}\n'}, 'NPX': {'script': '\n{\n  "mcpServers": {\n    "github": {\n      "command": "npx",\n      "args": [\n        "-y",\n        "@modelcontextprotocol/server-github"\n      ],\n      "env": {\n        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"\n      }\n    }\n  }\n}\n'}}

VS Code

{'Docker': {'script': '\n{\n  "mcp": {\n    "inputs": [\n      {\n        "type": "promptString",\n        "id": "github_token",\n        "description": "GitHub Personal Access Token",\n        "password": true\n      }\n    ],\n    "servers": {\n      "github": {\n        "command": "docker",\n        "args": ["run", "-i", "--rm", "mcp/github"],\n        "env": {\n          "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"\n        }\n      }\n    }\n  }\n}\n'}, 'NPX': {'script': '\n{\n  "mcp": {\n    "inputs": [\n      {\n        "type": "promptString",\n        "id": "github_token",\n        "description": "GitHub Personal Access Token",\n        "password": true\n      }\n    ],\n    "servers": {\n      "github": {\n        "command": "npx",\n        "args": [\n          "-y",\n          "@modelcontextprotocol/server-github"\n        ],\n        "env": {\n          "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"\n        }\n      }\n    }\n  }\n}\n'}}