mcp-github

v0.0.3
mcp-github Checked 1 day ago Published 1 year ago

Github 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

ParameterTypeDescription
query *string
pageinteger
per_pageinteger

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

ParameterTypeDescription
name *string
auto_initboolean
descriptionstring
privateboolean

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

ParameterTypeDescription
owner *string
path *string
repo *string
branchstring

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

ParameterTypeDescription
branch *string
content *string
message *string
owner *string
path *string
repo *string
shastring

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

ParameterTypeDescription
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

ParameterTypeDescription
owner *string
repo *string
title *string
assigneesarray
bodystring
labelsarray
milestoneinteger

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

ParameterTypeDescription
owner *string
repo *string
directionstring
labelsarray
pageinteger
per_pageinteger
sincestring
sortstring
statestring

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

ParameterTypeDescription
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

ParameterTypeDescription
issue_number *integer
owner *string
repo *string
assigneesarray
bodystring
labelsarray
milestoneinteger
statestring
titlestring

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

ParameterTypeDescription
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

ParameterTypeDescription
base *string
head *string
owner *string
repo *string
title *string
bodystring
draftboolean
maintainer_can_modifyboolean

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:…

ParameterTypeDescription
owner *string
repo *string
basestring
directionstring
headstring
pageinteger
per_pageinteger
sortstring
statestring

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

ParameterTypeDescription
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

ParameterTypeDescription
branch *string
owner *string
repo *string
from_branchstring

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

ParameterTypeDescription
owner *string
repo *string
pageinteger
per_pageinteger
shastring

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

ParameterTypeDescription
q *string
orderstring
pageinteger
per_pageinteger

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

ParameterTypeDescription
q *string
orderstring
pageinteger
per_pageinteger
sortstring

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

ParameterTypeDescription
q *string
orderstring
pageinteger
per_pageinteger
sortstring

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

ParameterTypeDescription
owner *string
repo *string
organizationstring

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

ParameterTypeDescription
body *string
event *string
owner *string
pull_number *integer
repo *string
commentsarray
commit_idstring

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

ParameterTypeDescription
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

ParameterTypeDescription
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

ParameterTypeDescription
owner *string
pull_number *integer
repo *string
commit_messagestring
commit_titlestring
merge_methodstring