{
  "name": "github",
  "display_name": "GitHub",
  "description": "MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.",
  "repository": {
    "type": "git",
    "url": "https://github.com/modelcontextprotocol/servers"
  },
  "homepage": "https://github.com/modelcontextprotocol/servers/tree/main/src/github#readme",
  "author": {
    "name": "MCP Team"
  },
  "license": "MIT",
  "categories": [
    "Dev Tools"
  ],
  "tags": [
    "github",
    "code",
    "repository",
    "git"
  ],
  "arguments": {
    "GITHUB_PERSONAL_ACCESS_TOKEN": {
      "description": "Personal Access Token for GitHub to authenticate API requests",
      "required": true,
      "example": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
  },
  "installations": {
    "npm": {
      "type": "npm",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "package": "@modelcontextprotocol/server-github",
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
      },
      "description": "Install and run using NPX",
      "recommended": true
    },
    "docker": {
      "type": "docker",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "mcp/github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
      },
      "description": "Run with Docker"
    }
  },
  "examples": [
    {
      "title": "Search GitHub repositories",
      "description": "Find repositories related to machine learning",
      "prompt": "Find GitHub repositories about machine learning with more than 1000 stars."
    },
    {
      "title": "View repository contents",
      "description": "Browse files in a GitHub repository",
      "prompt": "Show me the main Python files in the Hugging Face transformers repository."
    }
  ],
  "tools": [
    {
      "name": "create_or_update_file",
      "description": "Create or update a single file in a GitHub repository",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "path": {
            "type": "string",
            "description": "Path where to create/update the file"
          },
          "content": {
            "type": "string",
            "description": "Content of the file"
          },
          "message": {
            "type": "string",
            "description": "Commit message"
          },
          "branch": {
            "type": "string",
            "description": "Branch to create/update the file in"
          },
          "sha": {
            "type": "string",
            "description": "SHA of the file being replaced (required when updating existing files)"
          }
        },
        "required": [
          "owner",
          "repo",
          "path",
          "content",
          "message",
          "branch"
        ]
      }
    },
    {
      "name": "search_repositories",
      "description": "Search for GitHub repositories",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Search query (see GitHub search syntax)"
          },
          "page": {
            "type": "number",
            "description": "Page number for pagination (default: 1)"
          },
          "perPage": {
            "type": "number",
            "description": "Number of results per page (default: 30, max: 100)"
          }
        },
        "required": [
          "query"
        ]
      }
    },
    {
      "name": "create_repository",
      "description": "Create a new GitHub repository in your account",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Repository name"
          },
          "description": {
            "type": "string",
            "description": "Repository description"
          },
          "private": {
            "type": "boolean",
            "description": "Whether the repository should be private"
          },
          "autoInit": {
            "type": "boolean",
            "description": "Initialize with README.md"
          }
        },
        "required": [
          "name"
        ]
      }
    },
    {
      "name": "get_file_contents",
      "description": "Get the contents of a file or directory from a GitHub repository",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "path": {
            "type": "string",
            "description": "Path to the file or directory"
          },
          "branch": {
            "type": "string",
            "description": "Branch to get contents from"
          }
        },
        "required": [
          "owner",
          "repo",
          "path"
        ]
      }
    },
    {
      "name": "push_files",
      "description": "Push multiple files to a GitHub repository in a single commit",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "branch": {
            "type": "string",
            "description": "Branch to push to (e.g., 'main' or 'master')"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "content": {
                  "type": "string"
                }
              },
              "required": [
                "path",
                "content"
              ],
              "additionalProperties": false
            },
            "description": "Array of files to push"
          },
          "message": {
            "type": "string",
            "description": "Commit message"
          }
        },
        "required": [
          "owner",
          "repo",
          "branch",
          "files",
          "message"
        ]
      }
    },
    {
      "name": "create_issue",
      "description": "Create a new issue in a GitHub repository",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "assignees": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "milestone": {
            "type": "number"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "owner",
          "repo",
          "title"
        ]
      }
    },
    {
      "name": "create_pull_request",
      "description": "Create a new pull request in a GitHub repository",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "title": {
            "type": "string",
            "description": "Pull request title"
          },
          "body": {
            "type": "string",
            "description": "Pull request body/description"
          },
          "head": {
            "type": "string",
            "description": "The name of the branch where your changes are implemented"
          },
          "base": {
            "type": "string",
            "description": "The name of the branch you want the changes pulled into"
          },
          "draft": {
            "type": "boolean",
            "description": "Whether to create the pull request as a draft"
          },
          "maintainer_can_modify": {
            "type": "boolean",
            "description": "Whether maintainers can modify the pull request"
          }
        },
        "required": [
          "owner",
          "repo",
          "title",
          "head",
          "base"
        ]
      }
    },
    {
      "name": "fork_repository",
      "description": "Fork a GitHub repository to your account or specified organization",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "organization": {
            "type": "string",
            "description": "Optional: organization to fork to (defaults to your personal account)"
          }
        },
        "required": [
          "owner",
          "repo"
        ]
      }
    },
    {
      "name": "create_branch",
      "description": "Create a new branch in a GitHub repository",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "branch": {
            "type": "string",
            "description": "Name for the new branch"
          },
          "from_branch": {
            "type": "string",
            "description": "Optional: source branch to create from (defaults to the repository's default branch)"
          }
        },
        "required": [
          "owner",
          "repo",
          "branch"
        ]
      }
    },
    {
      "name": "list_commits",
      "description": "Get list of commits of a branch in a GitHub repository",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          },
          "sha": {
            "type": "string"
          },
          "page": {
            "type": "number"
          },
          "perPage": {
            "type": "number"
          }
        },
        "required": [
          "owner",
          "repo"
        ]
      }
    },
    {
      "name": "list_issues",
      "description": "List issues in a GitHub repository with filtering options",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "page": {
            "type": "number"
          },
          "per_page": {
            "type": "number"
          },
          "since": {
            "type": "string"
          },
          "sort": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "comments"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "closed",
              "all"
            ]
          }
        },
        "required": [
          "owner",
          "repo"
        ]
      }
    },
    {
      "name": "update_issue",
      "description": "Update an existing issue in a GitHub repository",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          },
          "issue_number": {
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "assignees": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "milestone": {
            "type": "number"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ]
          }
        },
        "required": [
          "owner",
          "repo",
          "issue_number"
        ]
      }
    },
    {
      "name": "add_issue_comment",
      "description": "Add a comment to an existing issue",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          },
          "issue_number": {
            "type": "number"
          },
          "body": {
            "type": "string"
          }
        },
        "required": [
          "owner",
          "repo",
          "issue_number",
          "body"
        ]
      }
    },
    {
      "name": "search_code",
      "description": "Search for code across GitHub repositories",
      "inputSchema": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "page": {
            "type": "number",
            "minimum": 1
          },
          "per_page": {
            "type": "number",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [
          "q"
        ]
      }
    },
    {
      "name": "search_issues",
      "description": "Search for issues and pull requests across GitHub repositories",
      "inputSchema": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "page": {
            "type": "number",
            "minimum": 1
          },
          "per_page": {
            "type": "number",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "type": "string",
            "enum": [
              "comments",
              "reactions",
              "reactions-+1",
              "reactions--1",
              "reactions-smile",
              "reactions-thinking_face",
              "reactions-heart",
              "reactions-tada",
              "interactions",
              "created",
              "updated"
            ]
          }
        },
        "required": [
          "q"
        ]
      }
    },
    {
      "name": "search_users",
      "description": "Search for users on GitHub",
      "inputSchema": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "page": {
            "type": "number",
            "minimum": 1
          },
          "per_page": {
            "type": "number",
            "minimum": 1,
            "maximum": 100
          },
          "sort": {
            "type": "string",
            "enum": [
              "followers",
              "repositories",
              "joined"
            ]
          }
        },
        "required": [
          "q"
        ]
      }
    },
    {
      "name": "get_issue",
      "description": "Get details of a specific issue in a GitHub repository.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string"
          },
          "repo": {
            "type": "string"
          },
          "issue_number": {
            "type": "number"
          }
        },
        "required": [
          "owner",
          "repo",
          "issue_number"
        ]
      }
    },
    {
      "name": "get_pull_request",
      "description": "Get details of a specific pull request",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "pull_number": {
            "type": "number",
            "description": "Pull request number"
          }
        },
        "required": [
          "owner",
          "repo",
          "pull_number"
        ]
      }
    },
    {
      "name": "list_pull_requests",
      "description": "List and filter repository pull requests",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "closed",
              "all"
            ],
            "description": "State of the pull requests to return"
          },
          "head": {
            "type": "string",
            "description": "Filter by head user or head organization and branch name"
          },
          "base": {
            "type": "string",
            "description": "Filter by base branch name"
          },
          "sort": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "popularity",
              "long-running"
            ],
            "description": "What to sort results by"
          },
          "direction": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ],
            "description": "The direction of the sort"
          },
          "per_page": {
            "type": "number",
            "description": "Results per page (max 100)"
          },
          "page": {
            "type": "number",
            "description": "Page number of the results"
          }
        },
        "required": [
          "owner",
          "repo"
        ]
      }
    },
    {
      "name": "create_pull_request_review",
      "description": "Create a review on a pull request",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "pull_number": {
            "type": "number",
            "description": "Pull request number"
          },
          "commit_id": {
            "type": "string",
            "description": "The SHA of the commit that needs a review"
          },
          "body": {
            "type": "string",
            "description": "The body text of the review"
          },
          "event": {
            "type": "string",
            "enum": [
              "APPROVE",
              "REQUEST_CHANGES",
              "COMMENT"
            ],
            "description": "The review action to perform"
          },
          "comments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The relative path to the file being commented on"
                },
                "position": {
                  "type": "number",
                  "description": "The position in the diff where you want to add a review comment"
                },
                "body": {
                  "type": "string",
                  "description": "Text of the review comment"
                }
              },
              "required": [
                "path",
                "position",
                "body"
              ],
              "additionalProperties": false
            },
            "description": "Comments to post as part of the review"
          }
        },
        "required": [
          "owner",
          "repo",
          "pull_number",
          "body",
          "event"
        ]
      }
    },
    {
      "name": "merge_pull_request",
      "description": "Merge a pull request",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "pull_number": {
            "type": "number",
            "description": "Pull request number"
          },
          "commit_title": {
            "type": "string",
            "description": "Title for the automatic commit message"
          },
          "commit_message": {
            "type": "string",
            "description": "Extra detail to append to automatic commit message"
          },
          "merge_method": {
            "type": "string",
            "enum": [
              "merge",
              "squash",
              "rebase"
            ],
            "description": "Merge method to use"
          }
        },
        "required": [
          "owner",
          "repo",
          "pull_number"
        ]
      }
    },
    {
      "name": "get_pull_request_files",
      "description": "Get the list of files changed in a pull request",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "pull_number": {
            "type": "number",
            "description": "Pull request number"
          }
        },
        "required": [
          "owner",
          "repo",
          "pull_number"
        ]
      }
    },
    {
      "name": "get_pull_request_status",
      "description": "Get the combined status of all status checks for a pull request",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "pull_number": {
            "type": "number",
            "description": "Pull request number"
          }
        },
        "required": [
          "owner",
          "repo",
          "pull_number"
        ]
      }
    },
    {
      "name": "update_pull_request_branch",
      "description": "Update a pull request branch with the latest changes from the base branch",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "pull_number": {
            "type": "number",
            "description": "Pull request number"
          },
          "expected_head_sha": {
            "type": "string",
            "description": "The expected SHA of the pull request's HEAD ref"
          }
        },
        "required": [
          "owner",
          "repo",
          "pull_number"
        ]
      }
    },
    {
      "name": "get_pull_request_comments",
      "description": "Get the review comments on a pull request",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "pull_number": {
            "type": "number",
            "description": "Pull request number"
          }
        },
        "required": [
          "owner",
          "repo",
          "pull_number"
        ]
      }
    },
    {
      "name": "get_pull_request_reviews",
      "description": "Get the reviews on a pull request",
      "inputSchema": {
        "type": "object",
        "properties": {
          "owner": {
            "type": "string",
            "description": "Repository owner (username or organization)"
          },
          "repo": {
            "type": "string",
            "description": "Repository name"
          },
          "pull_number": {
            "type": "number",
            "description": "Pull request number"
          }
        },
        "required": [
          "owner",
          "repo",
          "pull_number"
        ]
      }
    }
  ],
  "is_official": true,
  "is_archived": true,
  "docker_url": "https://hub.docker.com/r/mcp/github"
}