GitHub MCP Server
Preserves Git history for repository operations, with support for branch creation, commit management, and maintaining proper version control without force pushing.
Provides comprehensive access to GitHub's API, enabling file operations (creating, updating, retrieving), repository management (creating, forking, branching), search functionality across code/issues/users, and issue/PR workflows (creating, commenting, reviewing, merging).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitHub MCP Server create a new issue in my-app repo: 'Fix login bug' with label 'bug'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GitHub MCP Server
MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.
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
Project Management: Complete toolset for GitHub Projects (classic) management, including creating projects, managing columns, and working with cards
Tools
create_or_update_fileCreate or update a single file in a repository
Inputs:
owner(string): Repository owner (username or organization)repo(string): Repository namepath(string): Path where to create/update the filecontent(string): Content of the filemessage(string): Commit messagebranch(string): Branch to create/update the file insha(optional string): SHA of file being replaced (for updates)
Returns: File content and commit details
push_filesPush multiple files in a single commit
Inputs:
owner(string): Repository ownerrepo(string): Repository namebranch(string): Branch to push tofiles(array): Files to push, each withpathandcontentmessage(string): Commit message
Returns: Updated branch reference
search_repositoriesSearch for GitHub repositories
Inputs:
query(string): Search querypage(optional number): Page number for paginationperPage(optional number): Results per page (max 100)
Returns: Repository search results
create_repositoryCreate a new GitHub repository
Inputs:
name(string): Repository namedescription(optional string): Repository descriptionprivate(optional boolean): Whether repo should be privateautoInit(optional boolean): Initialize with README
Returns: Created repository details
get_file_contentsGet contents of a file or directory
Inputs:
owner(string): Repository ownerrepo(string): Repository namepath(string): Path to file/directorybranch(optional string): Branch to get contents from
Returns: File/directory contents
create_issueCreate a new issue
Inputs:
owner(string): Repository ownerrepo(string): Repository nametitle(string): Issue titlebody(optional string): Issue descriptionassignees(optional string[]): Usernames to assignlabels(optional string[]): Labels to addmilestone(optional number): Milestone number
Returns: Created issue details
create_pull_requestCreate a new pull request
Inputs:
owner(string): Repository ownerrepo(string): Repository nametitle(string): PR titlebody(optional string): PR descriptionhead(string): Branch containing changesbase(string): Branch to merge intodraft(optional boolean): Create as draft PRmaintainer_can_modify(optional boolean): Allow maintainer edits
Returns: Created pull request details
fork_repositoryFork a repository
Inputs:
owner(string): Repository ownerrepo(string): Repository nameorganization(optional string): Organization to fork to
Returns: Forked repository details
create_branchCreate a new branch
Inputs:
owner(string): Repository ownerrepo(string): Repository namebranch(string): Name for new branchfrom_branch(optional string): Source branch (defaults to repo default)
Returns: Created branch reference
list_issuesList and filter repository issues
Inputs:
owner(string): Repository ownerrepo(string): Repository namestate(optional string): Filter by state ('open', 'closed', 'all')labels(optional string[]): Filter by labelssort(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 numberper_page(optional number): Results per page
Returns: Array of issue details
update_issueUpdate an existing issue
Inputs:
owner(string): Repository ownerrepo(string): Repository nameissue_number(number): Issue number to updatetitle(optional string): New titlebody(optional string): New descriptionstate(optional string): New state ('open' or 'closed')labels(optional string[]): New labelsassignees(optional string[]): New assigneesmilestone(optional number): New milestone number
Returns: Updated issue details
add_issue_commentAdd a comment to an issue
Inputs:
owner(string): Repository ownerrepo(string): Repository nameissue_number(number): Issue number to comment onbody(string): Comment text
Returns: Created comment details
search_codeSearch for code across GitHub repositories
Inputs:
q(string): Search query using GitHub code search syntaxsort(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
search_issuesSearch for issues and pull requests
Inputs:
q(string): Search query using GitHub issues search syntaxsort(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
search_usersSearch for GitHub users
Inputs:
q(string): Search query using GitHub users search syntaxsort(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
list_commits
Gets commits of a branch in a repository
Inputs:
owner(string): Repository ownerrepo(string): Repository namepage(optional string): page numberper_page(optional string): number of record per pagesha(optional string): branch name
Returns: List of commits
get_issue
Gets the contents of an issue within a repository
Inputs:
owner(string): Repository ownerrepo(string): Repository nameissue_number(number): Issue number to retrieve
Returns: Github Issue object & details
delete_issue
Deletes an issue from a GitHub repository using GraphQL API
Inputs:
owner(string): Repository ownerrepo(string): Repository nameissue_number(number): Issue number to delete
Returns: Deletion confirmation with repository information
get_pull_request
Get details of a specific pull request
Inputs:
owner(string): Repository ownerrepo(string): Repository namepull_number(number): Pull request number
Returns: Pull request details including diff and review status
list_pull_requests
List and filter repository pull requests
Inputs:
owner(string): Repository ownerrepo(string): Repository namestate(optional string): Filter by state ('open', 'closed', 'all')head(optional string): Filter by head user/org and branchbase(optional string): Filter by base branchsort(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
create_pull_request_review
Create a review on a pull request
Inputs:
owner(string): Repository ownerrepo(string): Repository namepull_number(number): Pull request numberbody(string): Review comment textevent(string): Review action ('APPROVE', 'REQUEST_CHANGES', 'COMMENT')commit_id(optional string): SHA of commit to reviewcomments(optional array): Line-specific comments, each with:path(string): File pathposition(number): Line position in diffbody(string): Comment text
Returns: Created review details
merge_pull_request
Merge a pull request
Inputs:
owner(string): Repository ownerrepo(string): Repository namepull_number(number): Pull request numbercommit_title(optional string): Title for merge commitcommit_message(optional string): Extra detail for merge commitmerge_method(optional string): Merge method ('merge', 'squash', 'rebase')
Returns: Merge result details
get_pull_request_files
Get the list of files changed in a pull request
Inputs:
owner(string): Repository ownerrepo(string): Repository namepull_number(number): Pull request number
Returns: Array of changed files with patch and status details
get_pull_request_status
Get the combined status of all status checks for a pull request
Inputs:
owner(string): Repository ownerrepo(string): Repository namepull_number(number): Pull request number
Returns: Combined status check results and individual check details
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 ownerrepo(string): Repository namepull_number(number): Pull request numberexpected_head_sha(optional string): The expected SHA of the pull request's HEAD ref
Returns: Success message when branch is updated
get_pull_request_comments
Get the review comments on a pull request
Inputs:
owner(string): Repository ownerrepo(string): Repository namepull_number(number): Pull request number
Returns: Array of pull request review comments with details like the comment text, author, and location in the diff
get_pull_request_reviews
Get the reviews on a pull request
Inputs:
owner(string): Repository ownerrepo(string): Repository namepull_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
create_project
Create a new project in a GitHub repository
Inputs:
owner(string): Repository owner (username or organization)repo(string): Repository namename(string): Name of the projectbody(optional string): Description of the project
Returns: Created project details
get_project
Get details about a specific project
Inputs:
owner(string): Repository owner (username or organization)repo(string): Repository nameproject_number(number): The project number
Returns: Project details
update_project
Update an existing project's details
Inputs:
project_id(number): The unique identifier of the projectname(optional string): New name of the projectbody(optional string): New description of the projectstate(optional string): State of the project ('open' or 'closed')
Returns: Updated project details
list_projects
List all projects in a GitHub repository
Inputs:
owner(string): Repository owner (username or organization)repo(string): Repository namestate(optional string): Filter projects by state ('open', 'closed', 'all')page(optional number): Page number for pagination (starts at 1)per_page(optional number): Number of results per page (max 100)
Returns: Array of project details
create_project_column
Create a new column in a project
Inputs:
owner(string): Repository owner (username or organization)repo(string): Repository nameproject_number(number): The project numbername(string): Name of the column
Returns: Created column details
list_project_columns
List all columns in a project
Inputs:
project_id(number): The unique identifier of the projectpage(optional number): Page number for pagination (starts at 1)per_page(optional number): Number of results per page (max 100)
Returns: Array of project column details
update_project_column
Update an existing project column
Inputs:
column_id(number): The unique identifier of the columnname(string): New name of the column
Returns: Updated column details
delete_project_column
Delete a project column
Inputs:
column_id(number): The unique identifier of the column
Returns: Success message
add_card_to_column
Add a new card to a project column
Inputs:
owner(string): Repository owner (username or organization)repo(string): Repository namecolumn_id(string): The ID of the column to add card tocontent_type(string): Type of content for the card ('Issue', 'PullRequest', 'Note')content_id(optional number): ID of the issue or pull request (required if content_type is Issue or PullRequest)note(optional string): The note content for the card (required if content_type is Note)
Returns: Created card details
list_column_cards
List all cards in a project column
Inputs:
column_id(number): The unique identifier of the columnarchived_state(optional string): Filter by card archived state ('all', 'archived', 'not_archived')page(optional number): Page number for pagination (starts at 1)per_page(optional number): Number of results per page (max 100)
Returns: Array of card details
move_card
Move a card to a different position or column
Inputs:
card_id(number): The unique identifier of the cardposition(string): The position of the card ('top', 'bottom', or 'after:<card_id>')column_id(optional number): The column ID to move the card to
Returns: Success message
delete_card
Delete a card from a project
Inputs:
card_id(number): The unique identifier of the card
Returns: Success message
list_organization_projects
List all projects in a GitHub organization (at organization level, not repository level)
Inputs:
org(string): Organization namestate(optional string): Filter projects by state ('open', 'closed', 'all')page(optional number): Page number for paginationper_page(optional number): Number of results per page (max 100)
Returns: Array of organization project details
Related MCP server: GitHub Enterprise MCP Server
Projects V2 Tools (GitHub's New Projects Experience)
list_organization_projects_v2
List projects V2 in a GitHub organization using GraphQL API
Inputs:
org(string): Organization namefirst(optional number): Number of projects to fetch (max 100)after(optional string): Cursor for paginationorderBy(optional object): How to order the projects
Returns: Array of projects with pagination info
get_project_v2
Get details of a GitHub project V2 using GraphQL API
Inputs:
id(string): The node ID of the project
Returns: Detailed project information including fields and views
create_project_v2
Create a new GitHub project V2 using GraphQL API
Inputs:
ownerId(string): The node ID of the organization or usertitle(string): Title of the projectdescription(optional string): Description of the project
Returns: Created project details
update_project_v2
Update a GitHub project V2 using GraphQL API
Inputs:
projectId(string): The node ID of the projecttitle(optional string): New title for the projectdescription(optional string): New description for the projectclosed(optional boolean): Whether to close the project
Returns: Updated project details
add_item_to_project_v2
Add an issue or pull request to a GitHub project V2 using GraphQL API
Inputs:
projectId(string): The node ID of the projectcontentId(string): The node ID of the issue or pull request to add
Returns: Added item details
list_project_v2_items
List items in a GitHub project V2 using GraphQL API
Inputs:
projectId(string): The node ID of the projectfirst(optional number): Number of items to fetch (max 100)after(optional string): Cursor for paginationfilterBy(optional object): Filters for the items
Returns: Array of project items with their field values
update_project_v2_item_field
Update a field value for an item in a GitHub project V2 using GraphQL API
Inputs:
projectId(string): The node ID of the projectitemId(string): The node ID of the itemfieldId(string): The node ID of the fieldvalue(any): The new value for the field
Returns: Updated item details
Project Management Notes
Deprecation Warning: GitHub has announced that Projects (classic) is being deprecated in favor of the new Projects experience. Tools 27-39 work with the classic version of Projects, which may be removed in the future. For the new GitHub Projects experience, use tools 40-46 instead.
Search Query Syntax
Code Search
language:javascript: Search by programming languagerepo:owner/name: Search in specific repositorypath:app/src: Search in specific pathextension:js: Search by file extensionExample:
q: "import express" language:typescript path:src/
Issues Search
is:issueoris:pr: Filter by typeis:openoris:closed: Filter by statelabel:bug: Search by labelauthor:username: Search by authorExample:
q: "memory leak" is:issue is:open label:bug
Users Search
type:userortype:org: Filter by account typefollowers:>1000: Filter by followerslocation:London: Search by locationExample:
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
reposcope ("Full control of private repositories")Alternatively, if working only with public repositories, select only the
public_reposcopeFor using the Projects V2 tools, make sure to include the
projectscope as well
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",
"ghcr.io/tuanle96/mcp-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}NPX
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@earnbasejs/mcp-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
47 toolsadd_card_to_columnC
Add a new card to a project column
Inputs: column_id (required), content_type (required), owner (required), repo (required), +2 more.
add_issue_commentC
Add a comment to an existing issue
Inputs: body (required), issue_number (required), owner (required), repo (required).
add_item_to_project_v2C
Add an issue or pull request to a GitHub project V2 using GraphQL API
Inputs: contentId (required), projectId (required).
create_branchC
Create a new branch in a GitHub repository
Inputs: branch (required), owner (required), repo (required), from_branch.
create_issueC
Create a new issue in a GitHub repository
Inputs: owner (required), repo (required), title (required), assignees, +3 more.
create_or_update_fileC
Create or update a single file in a GitHub repository
Inputs: branch (required), content (required), message (required), owner (required), +3 more.
create_projectC
Create a new project in a GitHub repository
Inputs: name (required), owner (required), repo (required), body.
create_project_columnC
Create a new column in a project
Inputs: name (required), owner (required), project_number (required), repo (required).
create_project_v2C
Create a new GitHub project V2 using GraphQL API
Inputs: ownerId (required), title (required), description.
create_pull_requestC
Create a new pull request in a GitHub repository
Inputs: base (required), head (required), owner (required), repo (required), +4 more.
create_pull_request_reviewC
Create a review on a pull request
Inputs: body (required), event (required), owner (required), pull_number (required), +3 more.
create_repositoryC
Create a new GitHub repository in your account
Inputs: name (required), autoInit, description, private.
delete_cardC
Delete a card from a project
Inputs: card_id (required).
delete_issueC
Delete an issue from a GitHub repository using GraphQL API
Inputs: issue_number (required), owner (required), repo (required).
delete_project_columnC
Delete a project column
Inputs: column_id (required).
fork_repositoryC
Fork a GitHub repository to your account or specified organization
Inputs: owner (required), repo (required), organization.
get_file_contentsC
Get the contents of a file or directory from a GitHub repository
Inputs: owner (required), path (required), repo (required), branch.
get_issueC
Get details of a specific issue in a GitHub repository.
Inputs: issue_number (required), owner (required), repo (required).
get_projectC
Get details about a specific project
Inputs: owner (required), project_number (required), repo (required).
get_project_v2C
Get details of a GitHub project V2 using GraphQL API
Inputs: id (required).
get_pull_requestC
Get details of a specific pull request
Inputs: owner (required), pull_number (required), repo (required).
get_pull_request_commentsC
Get the review comments on a pull request
Inputs: owner (required), pull_number (required), repo (required).
get_pull_request_filesC
Get the list of files changed in a pull request
Inputs: owner (required), pull_number (required), repo (required).
get_pull_request_reviewsC
Get the reviews on a pull request
Inputs: owner (required), pull_number (required), repo (required).
get_pull_request_statusC
Get the combined status of all status checks for a pull request
Inputs: owner (required), pull_number (required), repo (required).
list_column_cardsC
List all cards in a project column
Inputs: column_id (required), archived_state, page, per_page.
list_commitsC
Get list of commits of a branch in a GitHub repository
Inputs: owner (required), repo (required), page, perPage, +1 more.
list_issuesC
List issues in a GitHub repository with filtering options
Inputs: owner (required), repo (required), direction, labels, +5 more.
list_organization_projectsB
List all projects in a GitHub organization (at organization level, not repository level)
Inputs: org (required), page, per_page, state.
list_organization_projects_v2C
List projects V2 in a GitHub organization using GraphQL API
Inputs: org (required), after, first, orderBy.
list_project_columnsC
List all columns in a project
Inputs: project_id (required), page, per_page.
list_projectsC
List all projects in a GitHub repository
Inputs: owner (required), repo (required), page, per_page, +1 more.
list_project_v2_itemsC
List items in a GitHub project V2 using GraphQL API
Inputs: projectId (required), after, first.
list_pull_requestsC
List and filter repository pull requests
Inputs: owner (required), repo (required), base, direction, +5 more.
merge_pull_requestC
Merge a pull request
Inputs: owner (required), pull_number (required), repo (required), commit_message, +2 more.
move_cardC
Move a card to a different position or column
Inputs: card_id (required), position (required), column_id.
push_filesB
Push multiple files to a GitHub repository in a single commit
Inputs: branch (required), files (required), message (required), owner (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.
update_issueC
Update an existing issue in a GitHub repository
Inputs: issue_number (required), owner (required), repo (required), assignees, +5 more.
update_projectC
Update an existing project's details
Inputs: project_id (required), body, name, state.
update_project_columnC
Update an existing project column
Inputs: column_id (required), name (required).
update_project_v2C
Update a GitHub project V2 using GraphQL API
Inputs: projectId (required), closed, description, title.
update_project_v2_item_fieldC
Update a field value for an item in a GitHub project V2 using GraphQL API
Inputs: fieldId (required), itemId (required), projectId (required), value.
update_pull_request_branchB
Update a pull request branch with the latest changes from the base branch
Inputs: owner (required), pull_number (required), repo (required), expected_head_sha.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 47 tools
Most tools have distinct purposes targeting specific GitHub resources and actions, such as add_card_to_column vs. move_card. However, some overlap exists between project-related tools (e.g., create_project vs. create_project_v2) and search tools (search_code, search_issues, search_repositories, search_users), which could cause minor confusion. Descriptions help clarify, but the sheer number of tools increases cognitive load.
Tool names follow a highly consistent verb_noun pattern throughout, such as create_issue, get_file_contents, and list_pull_requests. There are no deviations in style (e.g., no camelCase mixed in), making the naming predictable and readable. This consistency aids in understanding and using the tool set effectively.
With 47 tools, the count is borderline high for a GitHub server, feeling heavy and potentially overwhelming. While GitHub is a broad domain, this many tools might indicate over-specialization or fragmentation. A more streamlined set could improve usability without sacrificing functionality, as some tools could be consolidated.
The tool set provides comprehensive coverage of GitHub's core functionalities, including repositories, issues, pull requests, projects, files, and search. It supports full CRUD/lifecycle operations (e.g., create, get, update, delete for issues and projects) and handles advanced workflows like project management and pull request reviews. No obvious gaps are present for the intended domain.
Related MCP Connectors
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Manage repositories, users, releases, and automate GitHub workflows
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with GitHub through the GitHub API, supporting file operations, repository management, advanced search, and issue tracking with comprehensive error handling and automatic branch creation.489 npm1ISC
- AlicenseBqualityDmaintenanceEnables interaction with GitHub repositories through the GitHub API, allowing file operations, repository management, issue tracking, and code search through natural language commands.3321 npm4MIT
- AlicenseNot gradedqualityDmaintenanceEnables comprehensive interaction with the GitHub API, including file operations, repository management, issue tracking, pull request workflows, and advanced search functionality across code, issues, and users.127,455 npmMIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables comprehensive interaction with GitHub repositories, including code management, issues, pull requests, and full GitHub Actions workflow control with triggering, monitoring, and artifact management capabilities.475 npm-