GitHub集成
STDIO用于GitHub API的文件操作和仓库管理服务器
用于GitHub API的文件操作和仓库管理服务器
MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.
create_or_update_file
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)push_files
owner
(string): Repository ownerrepo
(string): Repository namebranch
(string): Branch to push tofiles
(array): Files to push, each with path
and content
message
(string): Commit messagesearch_repositories
query
(string): Search querypage
(optional number): Page number for paginationperPage
(optional number): Results per page (max 100)create_repository
name
(string): Repository namedescription
(optional string): Repository descriptionprivate
(optional boolean): Whether repo should be privateautoInit
(optional boolean): Initialize with READMEget_file_contents
owner
(string): Repository ownerrepo
(string): Repository namepath
(string): Path to file/directorybranch
(optional string): Branch to get contents fromcreate_issue
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 numbercreate_pull_request
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 editsfork_repository
owner
(string): Repository ownerrepo
(string): Repository nameorganization
(optional string): Organization to fork tocreate_branch
owner
(string): Repository ownerrepo
(string): Repository namebranch
(string): Name for new branchfrom_branch
(optional string): Source branch (defaults to repo default)list_issues
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 pageupdate_issue
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 numberadd_issue_comment
owner
(string): Repository ownerrepo
(string): Repository nameissue_number
(number): Issue number to comment onbody
(string): Comment textsearch_code
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 numbersearch_issues
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 numbersearch_users
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 numberlist_commits
owner
(string): Repository ownerrepo
(string): Repository namepage
(optional string): page numberper_page
(optional string): number of record per pagesha
(optional string): branch nameget_issue
owner
(string): Repository ownerrepo
(string): Repository nameissue_number
(number): Issue number to retrievedelete_issue
owner
(string): Repository ownerrepo
(string): Repository nameissue_number
(number): Issue number to deleteget_pull_request
owner
(string): Repository ownerrepo
(string): Repository namepull_number
(number): Pull request numberlist_pull_requests
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 numbercreate_pull_request_review
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 textmerge_pull_request
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')get_pull_request_files
owner
(string): Repository ownerrepo
(string): Repository namepull_number
(number): Pull request numberget_pull_request_status
owner
(string): Repository ownerrepo
(string): Repository namepull_number
(number): Pull request numberupdate_pull_request_branch
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 refget_pull_request_comments
owner
(string): Repository ownerrepo
(string): Repository namepull_number
(number): Pull request numberget_pull_request_reviews
owner
(string): Repository ownerrepo
(string): Repository namepull_number
(number): Pull request numbercreate_project
owner
(string): Repository owner (username or organization)repo
(string): Repository namename
(string): Name of the projectbody
(optional string): Description of the projectget_project
owner
(string): Repository owner (username or organization)repo
(string): Repository nameproject_number
(number): The project numberupdate_project
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')list_projects
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)create_project_column
owner
(string): Repository owner (username or organization)repo
(string): Repository nameproject_number
(number): The project numbername
(string): Name of the columnlist_project_columns
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)update_project_column
column_id
(number): The unique identifier of the columnname
(string): New name of the columndelete_project_column
column_id
(number): The unique identifier of the columnadd_card_to_column
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)list_column_cards
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)move_card
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 todelete_card
card_id
(number): The unique identifier of the cardlist_organization_projects
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)list_organization_projects_v2
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 projectsget_project_v2
id
(string): The node ID of the projectcreate_project_v2
ownerId
(string): The node ID of the organization or usertitle
(string): Title of the projectdescription
(optional string): Description of the projectupdate_project_v2
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 projectadd_item_to_project_v2
projectId
(string): The node ID of the projectcontentId
(string): The node ID of the issue or pull request to addlist_project_v2_items
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 itemsupdate_project_v2_item_field
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 fieldDeprecation 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.
language:javascript
: Search by programming languagerepo:owner/name
: Search in specific repositorypath:app/src
: Search in specific pathextension:js
: Search by file extensionq: "import express" language:typescript path:src/
is:issue
or is:pr
: Filter by typeis:open
or is:closed
: Filter by statelabel:bug
: Search by labelauthor:username
: Search by authorq: "memory leak" is:issue is:open label:bug
type:user
or type:org
: Filter by account typefollowers:>1000
: Filter by followerslocation:London
: Search by locationq: "fullstack developer" location:London followers:>100
For detailed search syntax, see GitHub's searching documentation.
Create a GitHub Personal Access Token with appropriate permissions:
repo
scope ("Full control of private repositories")
public_repo
scopeproject
scope as wellTo use this with Claude Desktop, add the following to your claude_desktop_config.json
:
{ "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>" } } } }
{ "mcpServers": { "github": { "command": "npx", "args": [ "-y", "@earnbasejs/mcp-github" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>" } } } }
Docker build:
docker build -t mcp/github -f src/github/Dockerfile .
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.