OfficialDeveloper Tools
GitHub
Deprecation Notice: Development for this project has been moved to GitHub in the http://github.com/github/github-mcp-server repo
Quick Install
npx -y @modelcontextprotocol/server-githubGitHub MCP Server
Deprecation Notice: Development for this project has been moved to GitHub in the http://github.com/github/github-mcp-server repo.
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
Tools
create_or_update_file- Create 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_files- Push 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_repositories- Search 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_repository- Create 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_contents- Get 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_issue- Create 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
7