Built by Metorial, the integration platform for agentic AI.

Learn More

    Server Summary

    • Manage GitHub repositories

    • Track issues and pull requests

    • Search and navigate code

    • Automate development workflows

GitHub MCP Server

A comprehensive Model Context Protocol (MCP) server that provides seamless integration with GitHub's platform. This server enables AI assistants and applications to interact with GitHub repositories, issues, pull requests, and code through a robust set of tools and resources. Whether you're managing projects, reviewing code, or searching repositories, this server provides the complete GitHub workflow automation you need.

Overview

The GitHub MCP Server bridges the gap between AI assistants and GitHub's extensive platform capabilities. It provides a standardized interface for performing common GitHub operations like repository management, issue tracking, pull request workflows, and code navigation. By exposing GitHub's functionality through the Model Context Protocol, this server enables natural language interactions with your development workflow, making project management and code collaboration more intuitive and efficient.

Features

Repository Management

  • List and search repositories by user, organization, or search criteria
  • Create new repositories with customizable settings
  • Fork existing repositories to your account or organization
  • Access repository metadata and details
  • Browse repository contents and directory structures

Issue Tracking

  • List issues with advanced filtering by state, labels, and sorting options
  • Create new issues with titles, descriptions, labels, and assignees
  • Update existing issues including state changes and metadata modifications
  • Add comments to issues for collaboration and discussion
  • Comprehensive pagination support for large issue lists

Pull Request Workflows

  • List pull requests with flexible filtering and sorting
  • Create new pull requests from branches with support for draft PRs
  • Update pull request metadata and state
  • Create pull request reviews with approval, change requests, or comments
  • Add inline code comments during reviews with precise line-level feedback

Code Navigation

  • Search code across GitHub repositories with powerful query syntax
  • List repository contents and navigate directory structures
  • Access file contents from any branch, tag, or commit
  • View commit history with pagination support
  • List and explore branches in repositories

File Operations

  • Create new files in repositories with commit messages
  • Update existing files with automatic content encoding
  • Support for branch-specific operations
  • Commit management with proper SHA tracking

Tools

list_repositories

List repositories for a specific user or organization, or search repositories across GitHub.

Parameters:

  • username (optional): GitHub username or organization to list repositories for
  • search_query (optional): Search query string to find repositories
  • sort (optional): Sort by created, updated, pushed, full_name, or stars
  • page (optional): Page number for pagination (default: 1, min: 1)
  • per_page (optional): Results per page (default: 30, min: 1, max: 100)

list_issues

Retrieve issues from a repository with comprehensive filtering capabilities.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • state (optional): Filter by open, closed, or all issues (default: open)
  • labels (optional): Comma-separated list of label names
  • sort (optional): Sort by created, updated, or comments
  • page (optional): Page number for pagination (default: 1, min: 1)
  • per_page (optional): Results per page (default: 30, min: 1, max: 100)

list_pull_requests

List pull requests for a repository with filtering options.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • state (optional): Filter by open, closed, or all pull requests (default: open)
  • sort (optional): Sort by created, updated, popularity, or long-running
  • page (optional): Page number for pagination (default: 1, min: 1)
  • per_page (optional): Results per page (default: 30, min: 1, max: 100)

create_issue

Create a new issue in a repository.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • title (required): Issue title
  • body (optional): Issue description or body text
  • labels (optional): Array of label names to apply
  • assignees (optional): Array of usernames to assign to the issue

update_issue

Update an existing issue's properties.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • issue_number (required): Issue number to update
  • title (optional): New issue title
  • body (optional): New issue body text
  • state (optional): New state (open or closed)
  • labels (optional): Array of label names
  • assignees (optional): Array of usernames to assign

create_issue_comment

Add a comment to an existing issue.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • issue_number (required): Issue number to comment on
  • body (required): Comment text

create_pull_request

Create a new pull request between branches.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • title (required): Pull request title
  • head (required): Branch name where your changes are implemented
  • base (required): Branch name you want to merge into
  • body (optional): Pull request description
  • draft (optional): Create as a draft pull request

update_pull_request

Update an existing pull request's metadata.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • pull_number (required): Pull request number
  • title (optional): New pull request title
  • body (optional): New pull request body
  • state (optional): New state (open or closed)

create_pull_request_review

Create a review on a pull request with optional line comments.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • pull_number (required): Pull request number
  • event (required): Review action (APPROVE, REQUEST_CHANGES, or COMMENT)
  • body (optional): Overall review comment
  • comments (optional): Array of line-specific comments, each containing:
    • path (required): File path
    • body (required): Comment text
    • line (optional): Line number in the file
    • position (optional): Position in diff
    • side (optional): Side of diff (LEFT or RIGHT)

list_commits

List commits in a repository.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • sha (optional): SHA or branch name to start listing from
  • page (optional): Page number for pagination (default: 1, min: 1)
  • per_page (optional): Results per page (default: 30, min: 1, max: 100)

list_branches

List all branches in a repository.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • page (optional): Page number for pagination (default: 1, min: 1)
  • per_page (optional): Results per page (default: 30, min: 1, max: 100)

create_repository

Create a new repository for the authenticated user.

Parameters:

  • name (required): Repository name
  • description (optional): Repository description
  • private (optional): Make repository private (default: false)
  • auto_init (optional): Initialize with a README file

search_code

Search for code across GitHub repositories.

Parameters:

  • query (required): Search query (e.g., "console.log repo:owner/name")
  • sort (optional): Sort by indexed
  • order (optional): Sort direction (asc or desc)
  • page (optional): Page number for pagination (default: 1, min: 1)
  • per_page (optional): Results per page (default: 30, min: 1, max: 100)

list_repository_contents

List the contents of a directory in a repository.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • path (optional): Directory path (empty string for root directory)
  • ref (optional): Branch, tag, or commit SHA

create_or_update_file

Create a new file or update an existing file in a repository.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • path (required): File path within the repository
  • message (required): Commit message
  • content (required): File content (will be automatically base64 encoded)
  • sha (optional): Blob SHA of the file being replaced (required for updates)
  • branch (optional): Branch to commit to

fork_repository

Fork a repository to your account or an organization.

Parameters:

  • owner (required): Repository owner username
  • repo (required): Repository name
  • organization (optional): Organization name to fork to

Resource Templates

repository

Access comprehensive repository details and metadata.

URI Pattern: github://repository/{owner}/{repo}

Provides information about repository settings, statistics, description, and other metadata.

repository-file

Access the content of files stored in a repository.

URI Pattern: github://repository/{owner}/{repo}/file/{path}

Retrieve file contents from any branch or commit in the repository.

issue

Access detailed information about a specific issue.

URI Pattern: github://issue/{owner}/{repo}/{issue_number}

Retrieve issue details including title, body, labels, assignees, comments, and state.

pull-request

Access detailed information about a specific pull request.

URI Pattern: github://pull/{owner}/{repo}/{pull_number}

Retrieve pull request details including diff information, review status, and metadata.

user

Access user or organization profile information.

URI Pattern: github://user/{username}

Retrieve profile information, statistics, and public data for users and organizations.

branch

Access information about a specific branch in a repository.

URI Pattern: github://repository/{owner}/{repo}/branch/{branch}

Retrieve branch details including commit information and protection status.

Use Cases

This GitHub MCP Server is ideal for:

  • Project Management: Automate issue tracking, label management, and milestone coordination
  • Code Review Workflows: Streamline pull request reviews with automated comments and approvals
  • Repository Discovery: Search and explore repositories across GitHub with natural language queries
  • Documentation Updates: Create and update files directly in repositories with proper commit tracking
  • Team Collaboration: Manage assignments, comments, and issue discussions programmatically
  • CI/CD Integration: Monitor commits, branches, and repository changes for deployment workflows
  • Repository Maintenance: Automate repository creation, forking, and configuration management

The server provides a complete GitHub automation solution that integrates seamlessly with AI assistants, enabling sophisticated workflows through natural language interactions.