mcp-github
v0.0.3Github MCP Server for interacting with Github's API
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
search_repositories
Search for Github repositories. Args: query: Search query (see Github search syntax) page: Page number for pagination (default: 1) per_page: Number of results per page (default: 30, max: 100) Returns: List of repository information
| Parameter | Type | Description |
|---|---|---|
query * | string | |
page | integer | |
per_page | integer |
create_repository
Create a new Github repository in your account. Args: name: Repository name description: Repository description private: Whether the repository should be private auto_init: Initialize with README.md Returns: Repository information
| Parameter | Type | Description |
|---|---|---|
name * | string | |
auto_init | boolean | |
description | string | |
private | boolean |
get_file_contents
Get the contents of a file or directory from a Github repository. Args: owner: Repository owner (username or organization) repo: Repository name path: Path to the file or directory branch: Branch to get contents from Returns: File or directory contents
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
path * | string | |
repo * | string | |
branch | string |
create_or_update_file
Create or update a single file in a Github repository. Args: owner: Repository owner (username or organization) repo: Repository name path: Path where to create/update the file content: Content of the file message: Commit message branch: Branch to create/update the file in sha: SHA of the file being replaced (required when updating existing files) Returns: Commit information
| Parameter | Type | Description |
|---|---|---|
branch * | string | |
content * | string | |
message * | string | |
owner * | string | |
path * | string | |
repo * | string | |
sha | string |
push_files
Push multiple files to a Github repository in a single commit. Args: owner: Repository owner (username or organization) repo: Repository name branch: Branch to push to (e.g., 'main' or 'master') files: Array of files to push (each with 'path' and 'content') message: Commit message Returns: Commit information
| Parameter | Type | Description |
|---|---|---|
branch * | string | |
files * | array | |
message * | string | |
owner * | string | |
repo * | string |
create_issue
Create a new issue in a Github repository. Args: owner: Repository owner (username or organization) repo: Repository name title: Issue title body: Issue description labels: List of labels to apply assignees: List of usernames to assign milestone: Milestone ID Returns: Issue information
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
repo * | string | |
title * | string | |
assignees | array | |
body | string | |
labels | array | |
milestone | integer |
list_issues
List issues in a Github repository with filtering options. Args: owner: Repository owner (username or organization) repo: Repository name state: Issue state ('open', 'closed', 'all') sort: Sorting field ('created', 'updated', 'comments') direction: Sort direction ('asc', 'desc') labels: Filter by labels since: Only issues updated after this ISO 8601 timestamp page: Page number for pagination per_page: Number of issues per page Returns: List of issues
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
repo * | string | |
direction | string | |
labels | array | |
page | integer | |
per_page | integer | |
since | string | |
sort | string | |
state | string |
get_issue
Get details of a specific issue in a Github repository. Args: owner: Repository owner (username or organization) repo: Repository name issue_number: Issue number Returns: Issue details
| Parameter | Type | Description |
|---|---|---|
issue_number * | integer | |
owner * | string | |
repo * | string |
update_issue
Update an existing issue in a Github repository. Args: owner: Repository owner (username or organization) repo: Repository name issue_number: Issue number title: New issue title body: New issue description state: New state ('open' or 'closed') labels: New labels assignees: New assignees milestone: New milestone ID Returns: Updated issue information
| Parameter | Type | Description |
|---|---|---|
issue_number * | integer | |
owner * | string | |
repo * | string | |
assignees | array | |
body | string | |
labels | array | |
milestone | integer | |
state | string | |
title | string |
add_issue_comment
Add a comment to an existing issue. Args: owner: Repository owner (username or organization) repo: Repository name issue_number: Issue number body: Comment text Returns: Comment information
| Parameter | Type | Description |
|---|---|---|
body * | string | |
issue_number * | integer | |
owner * | string | |
repo * | string |
create_pull_request
Create a new pull request in a Github repository. Args: owner: Repository owner (username or organization) repo: Repository name title: Pull request title head: The name of the branch where your changes are implemented base: The name of the branch you want the changes pulled into body: Pull request body/description draft: Whether to create the pull request as a draft maintainer_can_modify: Whether maintainers can modify the pull request Returns: Pull request information
| Parameter | Type | Description |
|---|---|---|
base * | string | |
head * | string | |
owner * | string | |
repo * | string | |
title * | string | |
body | string | |
draft | boolean | |
maintainer_can_modify | boolean |
list_pull_requests
List and filter repository pull requests. Args: owner: Repository owner (username or organization) repo: Repository name state: State of the pull requests to return ('open', 'closed', 'all') head: Filter by head user or head organization and branch name base: Filter by base branch name sort: What to sort results by ('created', 'updated', 'popularity', 'long-running') direction: The direction of the sort ('asc', 'desc') page: Page number of the results per_page: Results per page (max 100) Returns:…
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
repo * | string | |
base | string | |
direction | string | |
head | string | |
page | integer | |
per_page | integer | |
sort | string | |
state | string |
get_pull_request
Get details of a specific pull request. Args: owner: Repository owner (username or organization) repo: Repository name pull_number: Pull request number Returns: Pull request details
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
pull_number * | integer | |
repo * | string |
create_branch
Create a new branch in a Github repository. Args: owner: Repository owner (username or organization) repo: Repository name branch: Name for the new branch from_branch: Optional: source branch to create from (defaults to the repository's default branch) Returns: Branch information
| Parameter | Type | Description |
|---|---|---|
branch * | string | |
owner * | string | |
repo * | string | |
from_branch | string |
list_commits
Get list of commits of a branch in a Github repository. Args: owner: Repository owner (username or organization) repo: Repository name sha: Branch name or commit SHA page: Page number for pagination per_page: Number of commits per page Returns: List of commits
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
repo * | string | |
page | integer | |
per_page | integer | |
sha | string |
search_code
Search for code across Github repositories. Args: q: Search query string page: Page number (minimum: 1) per_page: Results per page (minimum: 1, maximum: 100) order: Sort order ('asc' or 'desc') Returns: List of matching code items
| Parameter | Type | Description |
|---|---|---|
q * | string | |
order | string | |
page | integer | |
per_page | integer |
search_issues
Search for issues and pull requests across Github repositories. Args: q: Search query string sort: Sorting field (comments, reactions, created, updated) order: Sort direction ('asc', 'desc') page: Page number (minimum: 1) per_page: Results per page (minimum: 1, maximum: 100) Returns: List of matching issues
| Parameter | Type | Description |
|---|---|---|
q * | string | |
order | string | |
page | integer | |
per_page | integer | |
sort | string |
search_users
Search for users on Github. Args: q: Search query string sort: Sorting field (followers, repositories, joined) order: Sort direction ('asc', 'desc') page: Page number (minimum: 1) per_page: Results per page (minimum: 1, maximum: 100) Returns: List of matching users
| Parameter | Type | Description |
|---|---|---|
q * | string | |
order | string | |
page | integer | |
per_page | integer | |
sort | string |
fork_repository
Fork a Github repository to your account or specified organization. Args: owner: Repository owner (username or organization) repo: Repository name organization: Optional: organization to fork to (defaults to your personal account) Returns: Fork information
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
repo * | string | |
organization | string |
create_pull_request_review
Create a review on a pull request. Args: owner: Repository owner (username or organization) repo: Repository name pull_number: Pull request number body: The body text of the review event: The review action to perform ('APPROVE', 'REQUEST_CHANGES', 'COMMENT') comments: Comments to post as part of the review (specify either position or line, not both) commit_id: The SHA of the commit that needs a review Returns: Review information
| Parameter | Type | Description |
|---|---|---|
body * | string | |
event * | string | |
owner * | string | |
pull_number * | integer | |
repo * | string | |
comments | array | |
commit_id | string |
get_pull_request_reviews
Get the reviews on a pull request. Args: owner: Repository owner (username or organization) repo: Repository name pull_number: Pull request number Returns: List of reviews
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
pull_number * | integer | |
repo * | string |
get_pull_request_files
Get the list of files changed in a pull request. Args: owner: Repository owner (username or organization) repo: Repository name pull_number: Pull request number Returns: List of changed files
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
pull_number * | integer | |
repo * | string |
merge_pull_request
Merge a pull request. Args: owner: Repository owner (username or organization) repo: Repository name pull_number: Pull request number commit_title: Title for the automatic commit message commit_message: Extra detail to append to automatic commit message merge_method: Merge method to use ('merge', 'squash', 'rebase') Returns: Merge result information
| Parameter | Type | Description |
|---|---|---|
owner * | string | |
pull_number * | integer | |
repo * | string | |
commit_message | string | |
commit_title | string | |
merge_method | string |