modelcontextprotocol-server-github
v0.6.2MCP server for using the GitHub API
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
create_or_update_file
Create or update a single file in a GitHub repository
| Parameter | Type | Description |
|---|---|---|
branch * | string | Branch to create/update the file in |
content * | string | Content of the file |
message * | string | Commit message |
owner * | string | Repository owner (username or organization) |
path * | string | Path where to create/update the file |
repo * | string | Repository name |
sha | string | SHA of the file being replaced (required when updating existing files) |
search_repositories
Search for GitHub repositories
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query (see GitHub search syntax) |
page | number | Page number for pagination (default: 1) |
perPage | number | Number of results per page (default: 30, max: 100) |
create_repository
Create a new GitHub repository in your account
| Parameter | Type | Description |
|---|---|---|
name * | string | Repository name |
autoInit | boolean | Initialize with README.md |
description | string | Repository description |
private | boolean | Whether the repository should be private |
create_org_repository
Create a new GitHub organization repository
| Parameter | Type | Description |
|---|---|---|
name * | string | Repository name |
organization * | string | Name of the organization where the repository should be created |
autoInit | boolean | Initialize with README.md |
description | string | Repository description |
private | boolean | Whether the repository should be private |
get_file_contents
Get the contents of a file or directory from a GitHub repository
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
path * | string | Path to the file or directory |
repo * | string | Repository name |
branch | string | Branch to get contents from |
push_files
Push multiple files to a GitHub repository in a single commit
| Parameter | Type | Description |
|---|---|---|
branch * | string | Branch to push to (e.g., 'main' or 'master') |
files * | array | Array of files to push |
message * | string | Commit message |
owner * | string | Repository owner (username or organization) |
repo * | string | Repository name |
create_issue
Create a new issue in a GitHub repository
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
repo * | string | |
title * | string | |
assignees | array | |
body | string | |
labels | array | |
milestone | number |
create_pull_request
Create a new pull request in a GitHub repository
| Parameter | Type | Description |
|---|---|---|
base * | string | The name of the branch you want the changes pulled into |
head * | string | The name of the branch where your changes are implemented |
owner * | string | Repository owner (username or organization) |
repo * | string | Repository name |
title * | string | Pull request title |
body | string | Pull request body/description |
draft | boolean | Whether to create the pull request as a draft |
maintainer_can_modify | boolean | Whether maintainers can modify the pull request |
fork_repository
Fork a GitHub repository to your account or specified organization
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
repo * | string | Repository name |
organization | string | Optional: organization to fork to (defaults to your personal account) |
create_branch
Create a new branch in a GitHub repository
| Parameter | Type | Description |
|---|---|---|
branch * | string | Name for the new branch |
owner * | string | Repository owner (username or organization) |
repo * | string | Repository name |
from_branch | string | Optional: source branch to create from (defaults to the repository's default branch) |
list_commits
Get list of commits of a branch in a GitHub repository
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
repo * | string | |
page | number | |
perPage | number | |
sha | string |
list_issues
List issues in a GitHub repository with filtering options
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
repo * | string | |
direction | string | |
labels | array | |
page | number | |
per_page | number | |
since | string | |
sort | string | |
state | string |
update_issue
Update an existing issue in a GitHub repository
| Parameter | Type | Description |
|---|---|---|
issue_number * | number | |
owner * | string | |
repo * | string | |
assignees | array | |
body | string | |
labels | array | |
milestone | number | |
state | string | |
title | string |
add_issue_comment
Add a comment to an existing issue
| Parameter | Type | Description |
|---|---|---|
body * | string | |
issue_number * | number | |
owner * | string | |
repo * | string |
search_code
Search for code across GitHub repositories
| Parameter | Type | Description |
|---|---|---|
q * | string | |
order | string | |
page | number | |
per_page | number |
search_issues
Search for issues and pull requests across GitHub repositories
| Parameter | Type | Description |
|---|---|---|
q * | string | |
order | string | |
page | number | |
per_page | number | |
sort | string |
search_users
Search for users on GitHub
| Parameter | Type | Description |
|---|---|---|
q * | string | |
order | string | |
page | number | |
per_page | number | |
sort | string |
get_issue
Get details of a specific issue in a GitHub repository.
| Parameter | Type | Description |
|---|---|---|
issue_number * | number | |
owner * | string | |
repo * | string |
get_pull_request
Get details of a specific pull request
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
pull_number * | number | Pull request number |
repo * | string | Repository name |
list_pull_requests
List and filter repository pull requests
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
repo * | string | Repository name |
base | string | Filter by base branch name |
direction | string | The direction of the sort |
head | string | Filter by head user or head organization and branch name |
page | number | Page number of the results |
per_page | number | Results per page (max 100) |
sort | string | What to sort results by |
state | string | State of the pull requests to return |
create_pull_request_review
Create a review on a pull request
| Parameter | Type | Description |
|---|---|---|
body * | string | The body text of the review |
event * | string | The review action to perform |
owner * | string | Repository owner (username or organization) |
pull_number * | number | Pull request number |
repo * | string | Repository name |
comments | array | Comments to post as part of the review |
commit_id | string | The SHA of the commit that needs a review |
merge_pull_request
Merge a pull request
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
pull_number * | number | Pull request number |
repo * | string | Repository name |
commit_message | string | Extra detail to append to automatic commit message |
commit_title | string | Title for the automatic commit message |
merge_method | string | Merge method to use |
get_pull_request_files
Get the list of files changed in a pull request
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
pull_number * | number | Pull request number |
repo * | string | Repository name |
get_pull_request_status
Get the combined status of all status checks for a pull request
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
pull_number * | number | Pull request number |
repo * | string | Repository name |
update_pull_request_branch
Update a pull request branch with the latest changes from the base branch
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
pull_number * | number | Pull request number |
repo * | string | Repository name |
expected_head_sha | string | The expected SHA of the pull request's HEAD ref |
get_pull_request_comments
Get the review comments on a pull request
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
pull_number * | number | Pull request number |
repo * | string | Repository name |
get_pull_request_reviews
Get the reviews on a pull request
| Parameter | Type | Description |
|---|---|---|
owner * | string | Repository owner (username or organization) |
pull_number * | number | Pull request number |
repo * | string | Repository name |