Banner
GitHub logoGitHub

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

Updated 4 days ago
Official
Go to documentation
npx @mintlify/mcp add github --client claude

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

Search Query Syntax

Code Search

  • 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/

Issues Search

  • 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

Users Search

  • 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

Available 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

create_issue

Create a new issue

create_pull_request

Create a new pull request

fork_repository

Fork a repository

create_branch

Create a new branch

list_issues

List and filter repository issues

update_issue

Update an existing issue

add_issue_comment

Add a comment to an issue

search_code

Search for code across GitHub repositories

search_issues

Search for issues and pull requests

search_users

Search for GitHub users

list_commits

Gets commits of a branch in a repository

get_issue

Gets the contents of an issue within a repository

get_pull_request

Get details of a specific pull request

list_pull_requests

List and filter repository pull requests

create_pull_request_review

Create a review on a pull request

merge_pull_request

Merge a pull request

get_pull_request_files

Get the list of files changed in a pull request

get_pull_request_status

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

update_pull_request_branch

Update a pull request branch with the latest changes from the base branch

get_pull_request_comments

Get the review comments on a pull request

get_pull_request_reviews

Get the reviews on a pull request