Skip to main content
Glama

GitHub MCP Server

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

Mission Squad modifications

  • github pat is now dynamic per request and does not have to be included via environment variables, but still falls back to environment variables.

  • name: mcp-github

Features

  • Automatic Branch Creation: When creating/updating files or pushing changes, branches are automatically created if they don't exist

  • Comprehensive Error Handling: Clear error messages for common issues

  • Git History Preservation: Operations maintain proper Git history without force pushing

  • Batch Operations: Support for both single-file and multi-file operations

  • Advanced Search: Support for searching code, issues/PRs, and users

Related MCP server: gh-mcp

Tools

  1. create_or_update_file

    • Create or update a single file in a repository

    • Inputs:

      • owner (string): Repository owner (username or organization)

      • repo (string): Repository name

      • path (string): Path where to create/update the file

      • content (string): Content of the file

      • message (string): Commit message

      • branch (string): Branch to create/update the file in

      • sha (optional string): SHA of file being replaced (for updates)

    • Returns: File content and commit details

  2. push_files

    • Push multiple files in a single commit

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • branch (string): Branch to push to

      • files (array): Files to push, each with path and content

      • message (string): Commit message

    • Returns: Updated branch reference

  3. search_repositories

    • Search for GitHub repositories

    • Inputs:

      • query (string): Search query

      • page (optional number): Page number for pagination

      • perPage (optional number): Results per page (max 100)

    • Returns: Repository search results

  4. create_repository

    • Create a new GitHub repository

    • Inputs:

      • name (string): Repository name

      • description (optional string): Repository description

      • private (optional boolean): Whether repo should be private

      • autoInit (optional boolean): Initialize with README

    • Returns: Created repository details

  5. get_file_contents

    • Get contents of a file or directory

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • path (string): Path to file/directory

      • branch (optional string): Branch to get contents from

    • Returns: File/directory contents

  6. create_issue

    • Create a new issue

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • title (string): Issue title

      • body (optional string): Issue description

      • assignees (optional string[]): Usernames to assign

      • labels (optional string[]): Labels to add

      • milestone (optional number): Milestone number

    • Returns: Created issue details

  7. create_pull_request

    • Create a new pull request

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • title (string): PR title

      • body (optional string): PR description

      • head (string): Branch containing changes

      • base (string): Branch to merge into

      • draft (optional boolean): Create as draft PR

      • maintainer_can_modify (optional boolean): Allow maintainer edits

    • Returns: Created pull request details

  8. fork_repository

    • Fork a repository

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • organization (optional string): Organization to fork to

    • Returns: Forked repository details

  9. create_branch

    • Create a new branch

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • branch (string): Name for new branch

      • from_branch (optional string): Source branch (defaults to repo default)

    • Returns: Created branch reference

  10. list_issues

    • List and filter repository issues

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • state (optional string): Filter by state ('open', 'closed', 'all')

      • labels (optional string[]): Filter by labels

      • sort (optional string): Sort by ('created', 'updated', 'comments')

      • direction (optional string): Sort direction ('asc', 'desc')

      • since (optional string): Filter by date (ISO 8601 timestamp)

      • page (optional number): Page number

      • per_page (optional number): Results per page

    • Returns: Array of issue details

  11. update_issue

    • Update an existing issue

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • issue_number (number): Issue number to update

      • title (optional string): New title

      • body (optional string): New description

      • state (optional string): New state ('open' or 'closed')

      • labels (optional string[]): New labels

      • assignees (optional string[]): New assignees

      • milestone (optional number): New milestone number

    • Returns: Updated issue details

  12. add_issue_comment

    • Add a comment to an issue

    • Inputs:

      • owner (string): Repository owner

      • repo (string): Repository name

      • issue_number (number): Issue number to comment on

      • body (string): Comment text

    • Returns: Created comment details

  13. search_code

    • Search for code across GitHub repositories

    • Inputs:

      • q (string): Search query using GitHub code search syntax

      • sort (optional string): Sort field ('indexed' only)

      • order (optional string): Sort order ('asc' or 'desc')

      • per_page (optional number): Results per page (max 100)

      • page (optional number): Page number

    • Returns: Code search results with repository context

  14. search_issues

    • Search for issues and pull requests

    • Inputs:

      • q (string): Search query using GitHub issues search syntax

      • sort (optional string): Sort field (comments, reactions, created, etc.)

      • order (optional string): Sort order ('asc' or 'desc')

      • per_page (optional number): Results per page (max 100)

      • page (optional number): Page number

    • Returns: Issue and pull request search results

  15. search_users

    • Search for GitHub users

    • Inputs:

      • q (string): Search query using GitHub users search syntax

      • sort (optional string): Sort field (followers, repositories, joined)

      • order (optional string): Sort order ('asc' or 'desc')

      • per_page (optional number): Results per page (max 100)

      • page (optional number): Page number

    • Returns: User search results

  16. list_commits

  • Gets commits of a branch in a repository

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • page (optional string): page number

    • per_page (optional string): number of record per page

    • sha (optional string): branch name

  • Returns: List of commits

  1. get_issue

  • Gets the contents of an issue within a repository

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • issue_number (number): Issue number to retrieve

  • Returns: Github Issue object & details

  1. get_pull_request

  • Get details of a specific pull request

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • pull_number (number): Pull request number

  • Returns: Pull request details including diff and review status

  1. list_pull_requests

  • List and filter repository pull requests

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • state (optional string): Filter by state ('open', 'closed', 'all')

    • head (optional string): Filter by head user/org and branch

    • base (optional string): Filter by base branch

    • sort (optional string): Sort by ('created', 'updated', 'popularity', 'long-running')

    • direction (optional string): Sort direction ('asc', 'desc')

    • per_page (optional number): Results per page (max 100)

    • page (optional number): Page number

  • Returns: Array of pull request details

  1. create_pull_request_review

  • Create a review on a pull request

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • pull_number (number): Pull request number

    • body (string): Review comment text

    • event (string): Review action ('APPROVE', 'REQUEST_CHANGES', 'COMMENT')

    • commit_id (optional string): SHA of commit to review

    • comments (optional array): Line-specific comments, each with:

      • path (string): File path

      • position (number): Line position in diff

      • body (string): Comment text

  • Returns: Created review details

  1. merge_pull_request

  • Merge a pull request

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • pull_number (number): Pull request number

    • commit_title (optional string): Title for merge commit

    • commit_message (optional string): Extra detail for merge commit

    • merge_method (optional string): Merge method ('merge', 'squash', 'rebase')

  • Returns: Merge result details

  1. get_pull_request_files

  • Get the list of files changed in a pull request

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • pull_number (number): Pull request number

  • Returns: Array of changed files with patch and status details

  1. get_pull_request_status

  • Get the combined status of all status checks for a pull request

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • pull_number (number): Pull request number

  • Returns: Combined status check results and individual check details

  1. update_pull_request_branch

  • Update a pull request branch with the latest changes from the base branch (equivalent to GitHub's "Update branch" button)

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • pull_number (number): Pull request number

    • expected_head_sha (optional string): The expected SHA of the pull request's HEAD ref

  • Returns: Success message when branch is updated

  1. get_pull_request_comments

  • Get the review comments on a pull request

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • pull_number (number): Pull request number

  • Returns: Array of pull request review comments with details like the comment text, author, and location in the diff

  1. get_pull_request_reviews

  • Get the reviews on a pull request

  • Inputs:

    • owner (string): Repository owner

    • repo (string): Repository name

    • pull_number (number): Pull request number

  • Returns: Array of pull request reviews with details like the review state (APPROVED, CHANGES_REQUESTED, etc.), reviewer, and review body

Webhook Tools

This server now supports the full repository and organization webhook REST surface that is available with the existing github_pat auth model.

Repository webhook tools

  • list_repository_webhooks

  • get_repository_webhook

  • create_repository_webhook

  • update_repository_webhook

  • delete_repository_webhook

  • get_repository_webhook_config

  • update_repository_webhook_config

  • ping_repository_webhook

  • list_repository_webhook_deliveries

  • get_repository_webhook_delivery

  • redeliver_repository_webhook_delivery

Organization webhook tools

  • list_organization_webhooks

  • get_organization_webhook

  • create_organization_webhook

  • update_organization_webhook

  • delete_organization_webhook

  • get_organization_webhook_config

  • update_organization_webhook_config

  • ping_organization_webhook

  • list_organization_webhook_deliveries

  • get_organization_webhook_delivery

  • redeliver_organization_webhook_delivery

Permissions

Repository webhooks:

  • Classic PATs typically need admin:repo_hook (or broader repo) to create, edit, delete, ping, or redeliver.

  • Fine-grained PATs need repository Webhooks permission with read for list/get and write for create/update/delete/ping/redelivery.

Organization webhooks:

  • Classic PATs need admin:org_hook.

  • Fine-grained PATs need organization Webhooks permission with read for list/get and write for create/update/delete/ping/redelivery.

Usage notes

  • Create and update webhook tools hardcode name: "web" internally, which is what GitHub requires.

  • Repository webhook config supports url, content_type, secret, and insecure_ssl.

  • Organization webhook config supports those fields plus optional username and password for basic auth.

  • GitHub strongly recommends setting a webhook secret and validating delivery signatures on the receiving service.

  • insecure_ssl: "1" disables certificate verification and is discouraged.

Debugging flow

  • Use ping_*_webhook to trigger a test delivery after create or update.

  • Use list_*_webhook_deliveries to inspect recent attempts.

  • Use get_*_webhook_delivery to inspect the request payload, headers, and GitHub's captured response.

  • Use redeliver_*_webhook_delivery to replay a failed or stale delivery.

Out of scope

  • This server does not implement an inbound HTTP receiver for webhook deliveries.

  • This server does not perform delivery signature validation for your webhook endpoint.

  • GitHub App webhook endpoints are not included in this phase because those APIs require JWT-based app authentication rather than a PAT.

Search Query Syntax

  • language:javascript: Search by programming language

  • repo:owner/name: Search in specific repository

  • path:app/src: Search in specific path

  • extension:js: Search by file extension

  • Example: q: "import express" language:typescript path:src/

  • is:issue or is:pr: Filter by type

  • is:open or is:closed: Filter by state

  • label:bug: Search by label

  • author:username: Search by author

  • Example: q: "memory leak" is:issue is:open label:bug

  • type:user or type:org: Filter by account type

  • followers:>1000: Filter by followers

  • location:London: Search by location

  • Example: q: "fullstack developer" location:London followers:>100

For detailed search syntax, see GitHub's searching documentation.

Setup

Personal Access Token

Create a GitHub Personal Access Token with appropriate permissions:

  • Go to Personal access tokens (in GitHub Settings > Developer settings)

  • Select which repositories you'd like this token to have access to (Public, All, or Select)

  • Create a token with the repo scope ("Full control of private repositories")

    • Alternatively, if working only with public repositories, select only the public_repo scope

  • Copy the generated token

Usage with Claude Desktop

To use this with Claude Desktop, add the following to your claude_desktop_config.json:

Docker

{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "mcp/github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

NPX

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

Build

Docker build:

docker build -t mcp/github -f src/github/Dockerfile .

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Available Tools

45 tools
add_issue_commentC

Add a comment to an existing issue

Inputs: owner (required), repo (required), issue_number (required), body (required).

create_branchC

Create a new branch in a GitHub repository

Inputs: owner (required), repo (required), branch (required), from_branch.

create_commit_statusC

Create a status for a commit (build passed/failed, etc.)

Inputs: owner (required), repo (required), sha (required), state (required), +3 more.

create_gistC

Create a new gist

Inputs: public (required), files (required), description.

create_issueC

Create a new issue in a GitHub repository

Inputs: owner (required), repo (required), title (required), body, +3 more.

create_or_update_fileC

Create or update a single file in a GitHub repository

Inputs: owner (required), repo (required), path (required), content (required), +3 more.

create_projectC

Create a new project for a repository

Inputs: owner (required), repo (required), name (required), body.

create_project_cardC

Create a new card in a project column

Inputs: column_id (required), note (required).

create_project_columnC

Create a new column for a project

Inputs: project_id (required), name (required).

create_pull_requestC

Create a new pull request in a GitHub repository

Inputs: owner (required), repo (required), title (required), head (required), +4 more.

create_pull_request_reviewC

Create a review for a pull request

Inputs: owner (required), repo (required), pull_number (required), body (required), +3 more.

create_releaseC

Create a new release in a GitHub repository

Inputs: owner (required), repo (required), tag_name (required), target_commitish, +5 more.

create_repositoryC

Create a new GitHub repository in your account

Inputs: name (required), description, private, autoInit.

create_tagC

Create a new tag in a GitHub repository

Inputs: owner (required), repo (required), ref (required), sha (required).

delete_releaseC

Delete a release from a GitHub repository

Inputs: owner (required), repo (required), release_id (required).

dismiss_pull_request_reviewC

Dismiss a pull request review

Inputs: owner (required), repo (required), pull_number (required), review_id (required), +1 more.

fork_repositoryC

Fork a GitHub repository to your account or specified organization

Inputs: owner (required), repo (required), organization.

get_combined_statusC

Get the combined status for a commit

Inputs: owner (required), repo (required), ref (required).

get_commit_statusesC

Get statuses for a commit

Inputs: owner (required), repo (required), ref (required).

get_file_contentsC

Get the contents of a file or directory from a GitHub repository

Inputs: owner (required), repo (required), path (required), encoded, +1 more.

get_gistB

Get a specific gist

Inputs: gist_id (required).

get_issueC

Get details of a specific issue in a GitHub repository.

Inputs: owner (required), repo (required), issue_number (required).

get_org_packageC

Get a package for an organization

Inputs: org (required), package_type (required), package_name (required).

get_pull_request_diffC

Get the diff for a pull request

Inputs: owner (required), repo (required), pull_number (required).

get_rate_limitB

Check the current rate limit status

Inputs: no named parameters.

get_release_assetC

Get a release asset from a GitHub repository

Inputs: owner (required), repo (required), asset_id (required).

get_repo_packageC

Get a package for a repository

Inputs: owner (required), repo (required), package_type (required), package_name (required).

get_user_packageC

Get a package for a user

Inputs: username (required), package_type (required), package_name (required).

list_commitsC

Get list of commits of a branch in a GitHub repository

Inputs: owner (required), repo (required), sha, page, +1 more.

list_gistsC

List gists for the authenticated user

Inputs: since, per_page, page.

list_issuesC

List issues in a GitHub repository with filtering options

Inputs: owner (required), repo (required), direction, labels, +5 more.

list_org_packagesC

List packages for an organization

Inputs: org (required), package_type (required), visibility, per_page, +1 more.

list_project_columnsC

List columns for a project

Inputs: project_id (required), per_page, page.

list_projectsC

List projects for a repository

Inputs: owner (required), repo (required), state, per_page, +1 more.

list_releasesC

List releases for a GitHub repository

Inputs: owner (required), repo (required), per_page, page.

list_repo_packagesC

List packages for a repository

Inputs: owner (required), repo (required), package_type, per_page, +1 more.

list_user_packagesC

List packages for a user

Inputs: username (required), package_type, visibility, per_page, +1 more.

push_filesB

Push multiple files to a GitHub repository in a single commit

Inputs: owner (required), repo (required), branch (required), files (required), +1 more.

search_codeC

Search for code across GitHub repositories

Inputs: q (required), order, page, per_page.

search_issuesC

Search for issues and pull requests across GitHub repositories

Inputs: q (required), order, page, per_page, +1 more.

search_repositoriesC

Search for GitHub repositories

Inputs: query (required), page, perPage.

search_usersC

Search for users on GitHub

Inputs: q (required), order, page, per_page, +1 more.

submit_pull_request_reviewC

Submit a pull request review (approve, request changes, or comment)

Inputs: owner (required), repo (required), pull_number (required), review_id (required), +2 more.

update_issueC

Update an existing issue in a GitHub repository

Inputs: owner (required), repo (required), issue_number (required), title, +5 more.

upload_release_assetC

Upload an asset to a GitHub release

Inputs: owner (required), repo (required), release_id (required), name (required), +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 45 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific GitHub resources and actions, but there is some overlap between search_issues and list_issues (both handle issues), and get_combined_status vs get_commit_statuses (both related to commit statuses). Descriptions help differentiate, but agents might occasionally misselect between these pairs.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout (e.g., create_issue, list_commits, search_code), with no mixing of conventions like camelCase or snake_case. This predictability makes it easy for agents to understand and use the toolset.

    Tool Count2/5

    With 45 tools, this server feels overly heavy for a GitHub integration, as many tools could be consolidated or omitted without losing functionality. A typical well-scoped server has 3-15 tools; this exceeds that range significantly, potentially overwhelming agents and increasing complexity.

    Completeness5/5

    The toolset provides comprehensive coverage of GitHub's domain, including CRUD operations for issues, pull requests, repositories, projects, releases, and packages, along with search, status, and file management. No obvious gaps exist; agents can handle full workflows without dead ends.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      C
      maintenance
      Refined MCP server for GitHub GraphQL API. GitHub's official MCP Server exposes dozens of low-level tools that bloat token usage and are mostly impractical for LLMs. gh-mcp achieves the best of both worlds by providing a single, powerful interface: GitHub GraphQL, wrapped with smart abstractions.
      2
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for the GitHub REST API that enables interaction with repositories, pull requests, issues, branches, commits, reviews, and code search, with configurable write and destructive operations.
      -
    • A
      license
      B
      quality
      D
      maintenance
      MCP (Model Context Protocol) server for GitHub API integration. This server provides comprehensive tools for interacting with GitHub repositories, issues, pull requests, branches, and code search through a unified interface.
      15
      6 npm
      MIT