The GitHub MCP Server Plus provides a powerful interface to the GitHub API, allowing you to perform file operations, manage repositories, search through GitHub, and more through the Model Context Protocol (MCP).
You need to obtain a GitHub Personal Access Token (PAT) before using this server.
repo
scope for full control of repositories
public_repo
scopeAdd the GitHub MCP server to your Claude Desktop configuration by updating your claude_desktop_config.json
file.
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"mcp/github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
The GitHub MCP Server offers numerous tools for interacting with GitHub. Here are examples of common operations:
// Create or update a single file
{
"owner": "username",
"repo": "repository-name",
"path": "path/to/file.js",
"content": "console.log('Hello World');",
"message": "Add hello world script",
"branch": "main"
}
// Push multiple files in a single commit
{
"owner": "username",
"repo": "repository-name",
"branch": "feature-branch",
"files": [
{
"path": "src/index.js",
"content": "console.log('App starting...');"
},
{
"path": "README.md",
"content": "# My Project\nThis is a sample project."
}
],
"message": "Add initial files"
}
{
"name": "new-project",
"description": "A new project repository",
"private": true,
"autoInit": true
}
{
"owner": "original-owner",
"repo": "original-repo"
}
{
"owner": "username",
"repo": "repository-name",
"branch": "new-feature",
"from_branch": "main"
}
{
"owner": "username",
"repo": "repository-name",
"title": "Bug: Application crashes on startup",
"body": "When running the app, it crashes immediately with the following error...",
"labels": ["bug", "priority-high"],
"assignees": ["developer-username"]
}
{
"owner": "username",
"repo": "repository-name",
"title": "Add login feature",
"body": "This PR implements the login functionality as described in issue #42",
"head": "feature-login",
"base": "main",
"draft": false
}
{
"q": "import express language:typescript path:src/",
"sort": "indexed",
"order": "desc",
"per_page": 20
}
{
"q": "memory leak is:issue is:open label:bug",
"sort": "created",
"order": "desc",
"per_page": 10
}
{
"q": "fullstack developer location:London followers:>100",
"sort": "followers",
"order": "desc",
"per_page": 25
}
language:javascript
- Filter by programming languagerepo:owner/name
- Search in specific repositorypath:app/src
- Search in specific pathextension:js
- Search by file extensionis:issue
or is:pr
- Filter by typeis:open
or is:closed
- Filter by statelabel:bug
- Search by labelauthor:username
- Search by authortype:user
or type:org
- Filter by account typefollowers:>1000
- Filter by followerslocation:London
- Search by locationFor complete search syntax documentation, refer to GitHub's searching documentation.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "github" '{"command":"npx","args":["-y","@modelcontextprotocol/server-github"],"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"<YOUR_TOKEN>"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect