GitHub MCP Server

Comprehensive GitHub integration enabling repository management, issue tracking, pull request workflows, and collaborative development through the GitHub API. Perfect for automating development workflows.

Repository Management GitCI/CDCollaboration

Configuration

MCP Settings Configuration

{
  "github": {
    "stdio": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ]
    },
    "env": {
      "GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_token_here"
    }
  }
}

Available Tools & Methods

create_repository(name, description, private, auto_init)
Create a new repository
Parameters: name (string), description (string, optional), private (boolean, optional), auto_init (boolean, optional)
get_repository(owner, repo)
Get repository information
Parameters: owner (string), repo (string)
list_repositories(owner, type, sort, direction)
List repositories
Parameters: owner (string), type (string, optional), sort (string, optional), direction (string, optional)
fork_repository(owner, repo, organization)
Fork a repository
Parameters: owner (string), repo (string), organization (string, optional)
get_repository_languages(owner, repo)
Get repository languages
Parameters: owner (string), repo (string)
get_file_contents(owner, repo, path, ref)
Get file contents
Parameters: owner (string), repo (string), path (string), ref (string, optional)
create_or_update_file(owner, repo, path, message, content, sha, branch)
Create or update a file
Parameters: owner (string), repo (string), path (string), message (string), content (string), sha (string, optional), branch (string, optional)
delete_file(owner, repo, path, message, sha, branch)
Delete a file
Parameters: owner (string), repo (string), path (string), message (string), sha (string), branch (string, optional)
push_files(owner, repo, branch, files, message)
Push multiple files in a single commit
Parameters: owner (string), repo (string), branch (string), files (array), message (string)
create_issue(owner, repo, title, body, assignees, milestone, labels)
Create an issue
Parameters: owner (string), repo (string), title (string), body (string, optional), assignees (array, optional), milestone (number, optional), labels (array, optional)
get_issue(owner, repo, issue_number)
Get an issue
Parameters: owner (string), repo (string), issue_number (number)
list_issues(owner, repo, milestone, state, assignee, creator, mentioned, labels, sort, direction)
List issues
Parameters: owner (string), repo (string), milestone (string, optional), state (string, optional), assignee (string, optional), creator (string, optional), mentioned (string, optional), labels (string, optional), sort (string, optional), direction (string, optional)
update_issue(owner, repo, issue_number, title, body, assignees, milestone, labels, state)
Update an issue
Parameters: owner (string), repo (string), issue_number (number), title (string, optional), body (string, optional), assignees (array, optional), milestone (number, optional), labels (array, optional), state (string, optional)
add_issue_comment(owner, repo, issue_number, body)
Add comment to an issue
Parameters: owner (string), repo (string), issue_number (number), body (string)
create_pull_request(owner, repo, title, head, base, body, draft, maintainer_can_modify)
Create a pull request
Parameters: owner (string), repo (string), title (string), head (string), base (string), body (string, optional), draft (boolean, optional), maintainer_can_modify (boolean, optional)
get_pull_request(owner, repo, pull_number)
Get a pull request
Parameters: owner (string), repo (string), pull_number (number)
list_pull_requests(owner, repo, state, head, base, sort, direction)
List pull requests
Parameters: owner (string), repo (string), state (string, optional), head (string, optional), base (string, optional), sort (string, optional), direction (string, optional)
get_pull_request_files(owner, repo, pull_number)
Get files changed in a pull request
Parameters: owner (string), repo (string), pull_number (number)
create_pull_request_review(owner, repo, pull_number, body, event, comments)
Create a pull request review
Parameters: owner (string), repo (string), pull_number (number), body (string), event (string), comments (array, optional)
merge_pull_request(owner, repo, pull_number, commit_title, commit_message, merge_method)
Merge a pull request
Parameters: owner (string), repo (string), pull_number (number), commit_title (string, optional), commit_message (string, optional), merge_method (string, optional)
create_branch(owner, repo, branch, from_branch)
Create a branch
Parameters: owner (string), repo (string), branch (string), from_branch (string, optional)
list_branches(owner, repo, protected)
List branches
Parameters: owner (string), repo (string), protected (boolean, optional)
list_commits(owner, repo, sha, author, page, perPage)
List commits
Parameters: owner (string), repo (string), sha (string, optional), author (string, optional), page (number, optional), perPage (number, optional)
list_workflow_runs(owner, repo, workflow_id, actor, branch, event, status)
List workflow runs
Parameters: owner (string), repo (string), workflow_id (string, optional), actor (string, optional), branch (string, optional), event (string, optional), status (string, optional)
get_workflow_run(owner, repo, run_id)
Get a workflow run
Parameters: owner (string), repo (string), run_id (number)
list_workflow_jobs(owner, repo, run_id, filter)
List jobs for a workflow run
Parameters: owner (string), repo (string), run_id (number), filter (string, optional)
cancel_workflow_run(owner, repo, run_id)
Cancel a workflow run
Parameters: owner (string), repo (string), run_id (number)
search_repositories(query, sort, order, page, perPage)
Search repositories
Parameters: query (string), sort (string, optional), order (string, optional), page (number, optional), perPage (number, optional)
search_code(query, sort, order, page, perPage)
Search code
Parameters: query (string), sort (string, optional), order (string, optional), page (number, optional), perPage (number, optional)
search_issues(query, sort, order, page, perPage)
Search issues and pull requests
Parameters: query (string), sort (string, optional), order (string, optional), page (number, optional), perPage (number, optional)
search_users(query, sort, order, page, perPage)
Search users
Parameters: query (string), sort (string, optional), order (string, optional), page (number, optional), perPage (number, optional)
list_code_scanning_alerts(owner, repo, ref, severity, state, tool_name)
List code scanning alerts
Parameters: owner (string), repo (string), ref (string, optional), severity (string, optional), state (string, optional), tool_name (string, optional)
get_code_scanning_alert(owner, repo, alertNumber)
Get a code scanning alert
Parameters: owner (string), repo (string), alertNumber (number)
list_dependabot_alerts(owner, repo, severity, state)
List Dependabot alerts
Parameters: owner (string), repo (string), severity (string, optional), state (string, optional)
get_dependabot_alert(owner, repo, alertNumber)
Get a Dependabot alert
Parameters: owner (string), repo (string), alertNumber (number)
list_secret_scanning_alerts(owner, repo, state, secret_type, resolution)
List secret scanning alerts
Parameters: owner (string), repo (string), state (string, optional), secret_type (string, optional), resolution (string, optional)
get_secret_scanning_alert(owner, repo, alertNumber)
Get a secret scanning alert
Parameters: owner (string), repo (string), alertNumber (number)
list_global_security_advisories(affects, cveId, cwes, ecosystem, ghsaId, isWithdrawn, modified, published, severity, type, updated)
List global security advisories
Parameters: affects (string, optional), cveId (string, optional), cwes (array, optional), ecosystem (string, optional), ghsaId (string, optional), isWithdrawn (boolean, optional), modified (string, optional), published (string, optional), severity (string, optional), type (string, optional), updated (string, optional)
list_org_repository_security_advisories(org, direction, sort, state)
List org repository security advisories
Parameters: org (string), direction (string, optional), sort (string, optional), state (string, optional)
list_repository_security_advisories(owner, repo, direction, sort, state)
List repository security advisories
Parameters: owner (string), repo (string), direction (string, optional), sort (string, optional), state (string, optional)
create_pull_request_with_copilot(owner, repo, problem_statement, title, base_ref)
Perform task with GitHub Copilot coding agent
Parameters: owner (string), repo (string), problem_statement (string), title (string), base_ref (string, optional)

Installation Guide

# Installation ## Option 1: Using Docker (Recommended) ```bash docker run -i --rm \ -e GITHUB_PERSONAL_ACCESS_TOKEN= \ ghcr.io/github/github-mcp-server ``` ## Option 2: Download Binary 1. Download the latest release from [GitHub Releases](https://github.com/github/github-mcp-server/releases) 2. Extract and run: ```bash ./github-mcp-server ``` ## Authentication Setup 1. Create a GitHub Personal Access Token: - Go to GitHub Settings > Developer settings > Personal access tokens - Generate a new token with appropriate scopes 2. Set the environment variable: ```bash export GITHUB_PERSONAL_ACCESS_TOKEN="your_token_here" ``` ## Configuration Options ### Toolsets Specify which toolsets to enable: ```bash # Enable specific toolsets GITHUB_TOOLSETS="repos,issues,pull_requests,actions" ./github-mcp-server # Enable all toolsets GITHUB_TOOLSETS="all" ./github-mcp-server ``` ### Read-Only Mode For read-only access: ```bash ./github-mcp-server --read-only ``` ### Dynamic Tool Discovery Enable dynamic toolset discovery: ```bash ./github-mcp-server --dynamic-toolsets ```