### Install mcpcurl using Go Install Source: https://github.com/github/github-mcp-server/blob/main/cmd/mcpcurl/README.md Install the mcpcurl CLI tool globally using the `go install` command. This is a convenient way to get the latest version. ```bash go install github.com/github/github-mcp-server/cmd/mcpcurl@latest ``` -------------------------------- ### Verify mcpcurl Installation Source: https://github.com/github/github-mcp-server/blob/main/cmd/mcpcurl/README.md Verify that the mcpcurl installation was successful by running the help command. This should display the available options and usage information. ```bash ./mcpcurl --help ``` -------------------------------- ### Example URL Path for Specific Toolset in Read-Only Mode Source: https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md This example demonstrates constructing a URL to access a specific toolset (`issues`) in read-only mode. The URL path parameters allow for fine-grained control over server access. ```json { "type": "http", "url": "https://api.githubcopilot.com/mcp/x/issues/readonly" } ``` -------------------------------- ### Start Basic HTTP Server Source: https://github.com/github/github-mcp-server/blob/main/docs/streamable-http.md Starts the GitHub MCP Server on the default port 8082. Use this for basic HTTP service deployment. ```bash github-mcp-server http ``` -------------------------------- ### Example: Renaming 'get_issue' to 'issue_read' Source: https://github.com/github/github-mcp-server/blob/main/docs/tool-renaming.md Demonstrates how to add a deprecation alias for a specific tool rename. This example shows the alias definition and a sample user configuration that would be compatible. ```go var DeprecatedToolAliases = map[string]string{ "get_issue": "issue_read", } ``` ```json { "--tools": "get_issue,get_file_contents" } ``` -------------------------------- ### E2E Test Output Example Source: https://github.com/github/github-mcp-server/blob/main/e2e/README.md This output shows a failed e2e test case where the expected user login 'foobar' did not match the actual login 'williammartin'. It details the test execution flow, including building the Docker image and starting the MCP client. ```bash ➜ GITHUB_MCP_SERVER_E2E_TOKEN=$(gh auth token) go test -v --tags e2e ./e2e === RUN TestE2E e2e_test.go:92: Building Docker image for e2e tests... e2e_test.go:36: Starting Stdio MCP client... === RUN TestE2E/Initialize === RUN TestE2E/CallTool_get_me e2e_test.go:85: Error Trace: /Users/williammartin/workspace/github-mcp-server/e2e/e2e_test.go:85 Error: Not equal: expected: "foobar" actual : "williammartin" Diff: --- Expected +++ Actual @@ -1 +1 @@ -foobar +williammartin Test: TestE2E/CallTool_get_me Messages: expected login to match --- FAIL: TestE2E (1.05s) --- PASS: TestE2E/Initialize (0.09s) --- FAIL: TestE2E/CallTool_get_me (0.46s) FAIL FAIL github.com/github/github-mcp-server/e2e 1.433s FAIL ``` -------------------------------- ### Add GitHub MCP Server Interactively Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-copilot-cli.md Initiate the interactive setup process for configuring the GitHub MCP server within Copilot CLI. ```bash /mcp add ``` -------------------------------- ### Prompting with GitHub Tool Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-opencode.md This is an example prompt to bias the model towards using the GitHub tool. It demonstrates how to reference the server by name in your prompts. ```text Use the github tool to list my recently merged pull requests. ``` -------------------------------- ### Example Prompt for GitHub Repositories Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-gemini-cli.md Test the GitHub MCP server integration by prompting the Gemini CLI to list your GitHub repositories. This verifies the server's ability to interact with your GitHub account. ```bash List my GitHub repositories ``` -------------------------------- ### Basic mcpcurl Usage Source: https://github.com/github/github-mcp-server/blob/main/cmd/mcpcurl/README.md Execute mcpcurl commands by specifying the command to start the MCP server using the `--stdio-server-cmd` flag, followed by the desired command and any flags. ```console mcpcurl --stdio-server-cmd="" [flags] ``` -------------------------------- ### Build GitHub MCP Server from Source Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/README.md Use this command to build the GitHub MCP Server from its source code. Ensure you have Go 1.24+ installed. ```bash go build -o github-mcp-server cmd/github-mcp-server/main.go ``` -------------------------------- ### Install Gemini Extension for GitHub MCP Server Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-gemini-cli.md Use the Gemini extension to install the GitHub MCP Server. Ensure your GITHUB_MCP_PAT environment variable is set. ```bash gemini extensions install https://github.com/github/github-mcp-server ``` -------------------------------- ### Example Remote Server Configuration Source: https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md This JSON configuration demonstrates how to set optional headers for the remote MCP server, enabling specific toolsets and modes. ```json { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "X-MCP-Toolsets": "repos,issues", "X-MCP-Readonly": "true", "X-MCP-Lockdown": "false" } } ``` -------------------------------- ### Add GitHub Server with Binary Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-claude.md Configure the GitHub MCP server using a downloaded release binary. This method is suitable if you do not have Docker installed. ```bash claude mcp add-json github '{"command": "github-mcp-server", "args": ["stdio"], "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"}}' ``` -------------------------------- ### Check Docker Version Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-gemini-cli.md Verify that Docker is installed and running by checking its version. This is a troubleshooting step for local server issues. ```bash docker --version ``` -------------------------------- ### Example GitHub API Response Header for Scopes Source: https://github.com/github/github-mcp-server/blob/main/docs/scope-filtering.md This is an example of the 'X-OAuth-Scopes' header output from the GitHub API, indicating the scopes granted to a classic Personal Access Token. ```text x-oauth-scopes: delete_repo, gist, read:org, repo ``` -------------------------------- ### Execute a Tool Command with mcpcurl Source: https://github.com/github/github-mcp-server/blob/main/cmd/mcpcurl/README.md Execute a specific tool command, like 'get_issue', by providing the necessary parameters. This example demonstrates fetching issue details for a given repository and issue number. ```console % ./mcpcurl --stdio-server-cmd "docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN mcp/github" tools get_issue --owner golang --repo go --issue_number 1 { "active_lock_reason": null, "assignee": null, "assignees": [], "author_association": "CONTRIBUTOR", "body": "by **rsc@swtch.com**:\n\n\u003cpre\u003eWhat steps will reproduce the problem?\n1. Run build on Ubuntu 9.10, which uses gcc 4.4.1\n\nWhat is the expected output? What do you see instead?\n\nCgo fails with the following error:\n\n{{{ go/misc/cgo/stdio$ make\ncgo file.go\ncould not determine kind of name for C.CString\ncould not determine kind of name for C.puts\ncould not determine kind of name for C.fflushstdout\ncould not determine kind of name for C.free\nthrow: sys·mapaccess1: key not in map\n\npanic PC=0x2b01c2b96a08\nthrow+0x33 /media/scratch/workspace/go/src/pkg/runtime/runtime.c:71\n throw(0x4d2daf, 0x0)\nsys·mapaccess1+0x74 \n/media/scratch/workspace/go/src/pkg/runtime/hashmap.c:769\n sys·mapaccess1(0xc2b51930, 0x2b01)\nmain·*Prog·loadDebugInfo+0xa67 \n/media/scratch/workspace/go/src/cmd/cgo/gcc.go:164\n main·*Prog·loadDebugInfo(0xc2bc0000, 0x2b01)\nmain·main+0x352 \n/media/scratch/workspace/go/src/cmd/cgo/main.go:68\n main·main()\nmainstart+0xf \n/media/scratch/workspace/go/src/pkg/runtime/amd64/asm.s:55\n mainstart()\ngoexit /media/scratch/workspace/go/src/pkg/runtime/proc.c:133\n goexit()\nmake: *** [file.cgo1.go] Error 2\n}}}\n\nPlease use labels and text to provide additional information.\u003c/pre\u003e\n", "closed_at": "2014-12-08T10:02:16Z", "closed_by": null, "comments": 12, "comments_url": "https://api.github.com/repos/golang/go/issues/1/comments", "created_at": "2009-10-22T06:07:26Z", "events_url": "https://api.github.com/repos/golang/go/issues/1/events", [...] } ``` -------------------------------- ### Configure Local GitHub MCP Server in Visual Studio Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-other-copilot-ides.md Configure a local GitHub MCP server using Docker. This requires a GitHub personal access token and Docker to be installed and running. ```json { "inputs": [ { "id": "github_pat", "description": "GitHub personal access token", "type": "promptString", "password": true } ], "servers": { "github": { "type": "stdio", "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_pat}" } } } } ``` -------------------------------- ### Local Server Setup with Docker for Xcode Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-claude.md Configure a local MCP server using Docker. Note that Xcode may require the full path to the 'docker' command. Replace 'YOUR_GITHUB_PAT' with your actual token. ```json { "mcpServers": { "github": { "command": "/usr/local/bin/docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" } } } } ``` -------------------------------- ### Start HTTP Server with OAuth Metadata Discovery Source: https://github.com/github/github-mcp-server/blob/main/docs/streamable-http.md Configures the server for reverse proxy deployments with custom base URLs and enables scope challenge. This exposes OAuth metadata endpoints for client discovery. ```bash github-mcp-server http --scope-challenge --base-url https://myserver.com --base-path /mcp ``` -------------------------------- ### Verify OpenCode Server Installation Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-opencode.md After restarting OpenCode, use this command to list configured MCP servers and check their status. This helps confirm the server is discovered and connected. ```sh opencode mcp list ``` -------------------------------- ### Configure Local GitHub MCP Server Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-opencode.md This JSON configuration sets up the local GitHub MCP server to run via Docker. Ensure Docker Desktop is installed and running. Replace 'YOUR_GITHUB_PAT' with your actual GitHub Personal Access Token. ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "github": { "type": "local", "command": [ "docker", "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "enabled": true, "environment": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" } } } } ``` -------------------------------- ### Start HTTP Server with Scope Challenge Source: https://github.com/github/github-mcp-server/blob/main/docs/streamable-http.md Enables scope validation for enforcing GitHub permission checks. Requests with insufficient scopes will receive a 403 Forbidden response with a WWW-Authenticate header. ```bash github-mcp-server http --scope-challenge ``` -------------------------------- ### Search Tools with GitHub MCP Server CLI Source: https://github.com/github/github-mcp-server/blob/main/README.md Example of using the `tool-search` CLI subcommand to find tools by name or description. Use `--max-results` to control the number of matches. Color output requires a TTY. ```bash docker run -it --rm ghcr.io/github/github-mcp-server tool-search "issue" --max-results 5 ``` ```bash github-mcp-server tool-search "issue" --max-results 5 ``` -------------------------------- ### Start HTTP Server Trusting Proxy Headers Source: https://github.com/github/github-mcp-server/blob/main/docs/streamable-http.md Enables the server to honor X-Forwarded-Host and X-Forwarded-Proto headers for constructing OAuth resource metadata URLs. Only use when the upstream proxy is trusted. ```bash github-mcp-server http --trust-proxy-headers ``` -------------------------------- ### Add Local Docker GitHub MCP Server Configuration Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-antigravity.md Configure Antigravity to use a local Docker instance of the GitHub MCP Server. Ensure Docker is installed and in your system PATH. Replace YOUR_GITHUB_PAT with your actual GitHub Personal Access Token. ```json { "mcpServers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" } } } } ``` -------------------------------- ### Restrict Configuration File Permissions Source: https://github.com/github/github-mcp-server/blob/main/README.md Secure configuration files containing sensitive information like tokens by restricting file permissions. This example sets read/write access only for the owner. ```bash chmod 600 ~/.your-app/config.json ``` -------------------------------- ### Local Server Configuration for MCP Apps Source: https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md This JSON configuration is for a local server setup using stdio. It specifies the command to run, arguments including features, and environment variables like the GitHub personal access token. ```json { "type": "stdio", "command": "go", "args": [ "run", "./cmd/github-mcp-server", "stdio", "--features=remote_mcp_ui_apps" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}" } } ``` -------------------------------- ### Example: GetIssue Function with Error Handling Source: https://github.com/github/github-mcp-server/blob/main/docs/error-handling.md Illustrates how to integrate GitHub API error handling within a tool function. It handles parameter errors, client initialization errors, and specific GitHub API errors using `NewGitHubAPIErrorResponse`. ```go func GetIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) { return mcp.NewTool("get_issue", /* ... */), func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { owner, err := RequiredParam[string](request, "owner") if err != nil { return mcp.NewToolResultError(err.Error()), nil } client, err := getClient(ctx) if err != nil { return nil, fmt.Errorf("failed to get GitHub client: %w", err) } issue, resp, err := client.Issues.Get(ctx, owner, repo, issueNumber) if err != nil { return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to get issue", resp, err, ), nil } return MarshalledTextResult(issue), nil } } ``` -------------------------------- ### Build and Configure Binary GitHub MCP Server Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-copilot-cli.md Build the GitHub MCP server binary from source and configure it to run via the command line with standard input/output. ```bash go build -o github-mcp-server ./cmd/github-mcp-server ``` ```json { "mcpServers": { "github": { "command": "/path/to/binary", "args": ["stdio"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}" } } } } ``` -------------------------------- ### OAuth Metadata Example Source: https://github.com/github/github-mcp-server/blob/main/docs/streamable-http.md An example of the OAuth protected resource metadata. The 'resource' attribute shows the full URL to the server's protected resource endpoint, useful for client configuration behind proxies. ```json { "resource_name": "GitHub MCP Server", "resource": "https://myserver.com/mcp", "authorization_servers": [ "https://github.com/login/oauth" ], "scopes_supported": [ "repo", ... ], ... } ``` -------------------------------- ### Get Commit Source: https://github.com/github/github-mcp-server/blob/main/README.md Retrieves details for a specific commit. Requires 'repo' OAuth scope. ```APIDOC ## get_commit ### Description Get commit details. ### Parameters #### Path Parameters - **owner** (string) - Required - Repository owner. - **repo** (string) - Required - Repository name. - **sha** (string) - Required - Commit SHA, branch name, or tag name. #### Query Parameters - **detail** (string) - Optional - Level of detail to include for changed files. "none" omits stats and files entirely. "stats" (default) includes per-file metadata: filename, status, and lines-of-code counts (additions, deletions, changes), with no patch content. "full_patch" additionally includes the unified diff content for each file and can be very large. - **page** (number) - Optional - Page number for pagination (min 1). - **perPage** (number) - Optional - Results per page for pagination (min 1, max 100). ### Required OAuth Scopes `repo` ``` -------------------------------- ### issue_read Source: https://github.com/github/github-mcp-server/blob/main/README.md Performs read operations on a single issue, such as getting details, comments, or labels. ```APIDOC ## GET /repos/{owner}/{repo}/issues/{issue_number} ### Description Get issue details. This endpoint supports various read operations on a single issue. ### Method GET ### Endpoint /repos/{owner}/{repo}/issues/{issue_number} ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the repository - **repo** (string) - Required - The name of the repository - **issue_number** (number) - Required - The number of the issue #### Query Parameters - **method** (string) - Required - The read operation to perform on a single issue. Options: 'get', 'get_comments', 'get_sub_issues', 'get_parent', 'get_labels'. - **page** (number) - Optional - Page number for pagination (min 1) - **perPage** (number) - Optional - Results per page for pagination (min 1, max 100) ### Required OAuth Scopes - repo ``` -------------------------------- ### get_code_quality_finding Source: https://github.com/github/github-mcp-server/blob/main/README.md Get a specific code quality finding. Requires 'repo' OAuth scope. ```APIDOC ## get_code_quality_finding ### Description Get code quality finding. ### Method Not specified (assumed to be a tool invocation) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **findingNumber** (number, required) - The number of the finding. - **owner** (string, required) - The owner of the repository. - **repo** (string, required) - The name of the repository. ### Request Example ```json { "findingNumber": 1, "owner": "my-org", "repo": "my-repo" } ``` ### Response #### Success Response (200) Details of the code quality finding. #### Response Example ```json { "example": "response body" } ``` ### Required OAuth Scopes `repo` ``` -------------------------------- ### projects_get Source: https://github.com/github/github-mcp-server/blob/main/README.md Get details of GitHub Projects resources. Requires `read:project` OAuth scope. ```APIDOC ## projects_get ### Description Get details of GitHub Projects resources. ### Parameters #### Query Parameters - **field_id** (number, optional) - The field's ID. Required for 'get_project_field' method. - **fields** (string[], optional) - Specific list of field IDs to include in the response when getting a project item (e.g. ["102589", "985201", "169875"]). If not provided, only the title field is included. Only used for 'get_project_item' method. - **item_id** (number, optional) - The item's ID. Required for 'get_project_item' method. - **method** (string, required) - The method to execute. - **owner** (string, optional) - The owner (user or organization login). The name is not case sensitive. - **owner_type** (string, optional) - Owner type (user or org). If not provided, will be automatically detected. - **project_number** (number, optional) - The project's number. - **status_update_id** (string, optional) - The node ID of the project status update. Required for 'get_project_status_update' method. ### Required OAuth Scopes `read:project` ### Accepted OAuth Scopes `project`, `read:project` ``` -------------------------------- ### Add GitHub Server with Docker Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-claude.md Set up the GitHub MCP server locally using Docker. This command runs the MCP server image and passes your PAT as an environment variable. ```bash claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server ``` ```bash claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=$(grep GITHUB_PAT .env | cut -d '=' -f2) -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server ``` -------------------------------- ### get_job_logs Source: https://github.com/github/github-mcp-server/blob/main/README.md Get GitHub Actions workflow job logs. Requires 'repo' OAuth scope. ```APIDOC ## get_job_logs ### Description Get GitHub Actions workflow job logs. ### Method Not specified (assumed to be a tool invocation) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **owner** (string, required) - Repository owner. - **repo** (string, required) - Repository name. - **failed_only** (boolean, optional) - When true, gets logs for all failed jobs in the workflow run specified by run_id. Requires run_id to be provided. - **job_id** (number, optional) - The unique identifier of the workflow job. Required when getting logs for a single job. - **return_content** (boolean, optional) - Returns actual log content instead of URLs. - **run_id** (number, optional) - The unique identifier of the workflow run. Required when failed_only is true to get logs for all failed jobs in the run. - **tail_lines** (number, optional) - Number of lines to return from the end of the log. ### Request Example ```json { "owner": "my-org", "repo": "my-repo", "run_id": 12345, "job_id": 67890 } ``` ### Response #### Success Response (200) Logs for the specified GitHub Actions job. #### Response Example ```json { "example": "response body" } ``` ### Required OAuth Scopes `repo` ``` -------------------------------- ### Build mcpcurl from Source Source: https://github.com/github/github-mcp-server/blob/main/cmd/mcpcurl/README.md Build the mcpcurl CLI tool from its source code. Ensure you are in the correct directory before running the command. ```bash cd cmd/mcpcurl go build -o mcpcurl ``` -------------------------------- ### Get Global Security Advisory Source: https://github.com/github/github-mcp-server/blob/main/README.md Retrieves a specific global security advisory. Requires 'security_events' OAuth scope. ```APIDOC ## get_global_security_advisory ### Description Get a global security advisory. ### Method GET ### Endpoint /advisories/{ghsaId} ### Parameters #### Path Parameters - **ghsaId** (string, required) - GitHub Security Advisory ID (format: GHSA-xxxx-xxxx-xxxx). ### Response #### Success Response (200) - **advisory** (object) - Details of the global security advisory. ``` -------------------------------- ### Enable Specific Tools (Local Server) Source: https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md Use the --tools flag for the local server to specify individual tools. This is best for users who know exactly what they need and want to optimize context usage. ```json { "type": "stdio", "command": "go", "args": [ "run", "./cmd/github-mcp-server", "stdio", "--tools=get_file_contents,get_me,pull_request_read" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}" } } ``` -------------------------------- ### Default Toolset Source: https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md The default toolset provides general access to GitHub MCP functionalities. It can be installed directly or in a read-only mode. ```APIDOC ## Default Toolset ### Description Provides general access to GitHub MCP functionalities. ### API URL `https://api.githubcopilot.com/mcp/` ### Read-only API URL `https://api.githubcopilot.com/mcp/readonly` ``` -------------------------------- ### Update Toolset Metadata with Icon Source: https://github.com/github/github-mcp-server/blob/main/docs/toolsets-and-icons.md Example of adding or updating the 'Icon' field within the toolset metadata definition in `pkg/github/tools.go`. ```go // In pkg/github/tools.go ToolsetMetadataRepos = inventory.ToolsetMetadata{ ID: "repos", Description: "GitHub Repository related tools", Default: true, Icon: "repo", // Add this line } ``` -------------------------------- ### Get Secret Scanning Alert Source: https://github.com/github/github-mcp-server/blob/main/README.md Retrieves a specific secret scanning alert for a repository. Requires 'security_events' OAuth scope. ```APIDOC ## get_secret_scanning_alert ### Description Get a specific secret scanning alert. ### Method GET ### Endpoint /repos/{owner}/{repo}/secret-scanning/alerts/{alertNumber} ### Parameters #### Path Parameters - **alertNumber** (number, required) - The number of the alert. - **owner** (string, required) - The owner of the repository. - **repo** (string, required) - The name of the repository. ### Response #### Success Response (200) - **alert** (object) - Details of the secret scanning alert. ``` -------------------------------- ### actions_get Source: https://github.com/github/github-mcp-server/blob/main/README.md Get details of GitHub Actions resources (workflows, workflow runs, jobs, and artifacts). Requires 'repo' OAuth scope. ```APIDOC ## actions_get ### Description Get details of GitHub Actions resources (workflows, workflow runs, jobs, and artifacts). ### Method Not specified (assumed to be a tool invocation) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **method** (string, required) - The method to execute. - **owner** (string, required) - Repository owner. - **repo** (string, required) - Repository name. - **resource_id** (string, required) - The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID: - Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'get_workflow' method. - Provide a workflow run ID for 'get_workflow_run', 'get_workflow_run_usage', and 'get_workflow_run_logs_url' methods. - Provide an artifact ID for 'download_workflow_run_artifact' method. - Provide a job ID for 'get_workflow_job' method. ### Request Example ```json { "method": "get_workflow", "owner": "my-org", "repo": "my-repo", "resource_id": "12345" } ``` ### Response #### Success Response (200) Details of the requested GitHub Actions resource. #### Response Example ```json { "example": "response body" } ``` ### Required OAuth Scopes `repo` ``` -------------------------------- ### Enable Toolsets and Specific Tools (Local Server) Source: https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md Combine --toolsets and --tools flags for the local server to enable broad functionality from some areas and specific tools from others. ```json { "type": "stdio", "command": "go", "args": [ "run", "./cmd/github-mcp-server", "stdio", "--toolsets=repos,issues", "--tools=get_gist,pull_request_read" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}" } } ``` -------------------------------- ### Get File Blame Source: https://github.com/github/github-mcp-server/blob/main/docs/feature-flags.md Retrieves blame information for a file, including commit details for each line. Supports pagination and line range filtering. ```APIDOC ## get_file_blame ### Description Get file blame information. ### Method GET ### Endpoint /repos/{owner}/{repo}/blame ### Parameters #### Query Parameters - **owner** (string) - Required - Repository owner (username or organization) - **repo** (string) - Required - Repository name - **path** (string) - Required - Path to the file in the repository, relative to the repository root - **ref** (string) - Optional - Git reference (branch, tag, or commit SHA). Defaults to the repository's default branch (HEAD). - **start_line** (number) - Optional - Optional 1-based starting line of the window of interest. Only ranges overlapping [start_line, end_line] are returned, clamped to the window. - **end_line** (number) - Optional - Optional 1-based ending line of the window of interest. Must be >= start_line when both are provided. - **perPage** (number) - Optional - Results per page for pagination (min 1, max 100) - **after** (string) - Optional - Cursor for pagination. Use the cursor from the previous response. ### Request Example ```json { "owner": "octocat", "repo": "Spoon-Knife", "path": "README.md", "ref": "main", "start_line": 10, "end_line": 20, "perPage": 50 } ``` ### Response #### Success Response (200) - **lines** (array) - Array of blame line objects. - **line** (number) - The line number. - **commit** (object) - The commit object. - **sha** (string) - The commit SHA. - **author** (object) - The author of the commit. - **name** (string) - The author's name. - **email** (string) - The author's email. - **date** (string) - The author's date. - **committer** (object) - The committer of the commit. - **name** (string) - The committer's name. - **email** (string) - The committer's email. - **date** (string) - The committer's date. - **message** (string) - The commit message. - **tree** (object) - The tree object. - **sha** (string) - The tree SHA. - **url** (string) - The URL of the commit. - **content** (string) - The content of the line. - **next_cursor** (string) - Cursor for the next page of results. #### Response Example ```json { "lines": [ { "line": 1, "commit": { "sha": "abcdef1234567890", "author": { "name": "Octocat", "email": "octocat@example.com", "date": "2023-01-01T12:00:00Z" }, "committer": { "name": "Octocat", "email": "octocat@example.com", "date": "2023-01-01T12:00:00Z" }, "message": "Initial commit", "tree": { "sha": "fedcba0987654321" }, "url": "https://api.github.com/repos/octocat/Spoon-Knife/commits/abcdef1234567890" }, "content": "# Spoon-Knife" } ], "next_cursor": "gH2V4w7x8y9z0a1b2c3d4e5f6g7h8i9j" } ``` ``` -------------------------------- ### Configure GitHub MCP Server in Claude Desktop Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-claude.md Add this JSON configuration to your `claude_desktop_config.json` file to set up the GitHub MCP server via Docker. Replace `YOUR_GITHUB_PAT` with your actual GitHub Personal Access Token. ```json { "mcpServers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" } } } } ``` -------------------------------- ### Combine Toolsets and Tools via Command Line Source: https://github.com/github/github-mcp-server/blob/main/README.md Register tools from specified toolsets and add individual tools using both --toolsets and --tools flags. This configuration is additive. ```bash github-mcp-server --toolsets repos,issues --tools get_gist ``` -------------------------------- ### Fetch Icons Script Source: https://github.com/github/github-mcp-server/blob/main/docs/toolsets-and-icons.md Scripts to fetch and convert Octicon SVG files into PNG formats for both light and dark themes. Ensure rsvg-convert is installed. ```bash # Fetch a specific icon script/fetch-icons your-new-icon # Or fetch all required icons script/fetch-icons ``` -------------------------------- ### Enable All Toolsets via Command Line Source: https://github.com/github/github-mcp-server/blob/main/README.md Use the --toolsets all argument to enable all available toolsets, overriding any other toolset configuration. ```bash ./github-mcp-server --toolsets all ``` -------------------------------- ### Configure Local GitHub MCP Server in JetBrains IDEs Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-other-copilot-ides.md Set up a local GitHub MCP server in JetBrains IDEs using Docker. This configuration requires a GitHub Personal Access Token. ```json { "servers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" } } } } ``` -------------------------------- ### Local GitHub MCP Server Configuration (Docker) Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-cline.md Set up a local GitHub MCP server using Docker. Add this JSON to your Cline settings, replacing YOUR_GITHUB_PAT with your GitHub Personal Access Token. This configuration uses Docker to run the MCP server image. ```json { "mcpServers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" } } } } ``` -------------------------------- ### Configure Tools with Docker (Tools Only) Source: https://github.com/github/github-mcp-server/blob/main/README.md Specify individual tools using the GITHUB_TOOLS environment variable when running the server in Docker. Ensure GITHUB_PERSONAL_ACCESS_TOKEN is set. ```bash # Tools only docker run -i --rm \ -e GITHUB_PERSONAL_ACCESS_TOKEN= \ -e GITHUB_TOOLS="get_file_contents,issue_read,create_pull_request" \ ghcr.io/github/github-mcp-server ``` -------------------------------- ### Run E2E Tests with GitHub Token Source: https://github.com/github/github-mcp-server/blob/main/e2e/README.md Execute the e2e tests using the `go test` command. Ensure the `e2e` build flag is set and provide a GitHub Personal Access Token via the `GITHUB_MCP_SERVER_E2E_TOKEN` environment variable. ```bash GITHUB_MCP_SERVER_E2E_TOKEN= go test -v --tags e2e ./e2e ``` -------------------------------- ### Remote Server Configuration for MCP Apps Source: https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md Use this JSON configuration for a remote server setup to enable MCP Apps. It specifies the HTTP type, API endpoint, and a feature header. ```json { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "X-MCP-Features": "remote_mcp_ui_apps" } } ``` -------------------------------- ### Configure Gemini CLI for Local GitHub MCP Server with Binary Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-gemini-cli.md Configure your Gemini CLI settings to use a locally built or downloaded binary of the GitHub MCP server. Ensure the command path is correct. ```json // ~/.gemini/settings.json { "mcpServers": { "github": { "command": "/path/to/binary", "args": ["stdio"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_MCP_PAT" } } } } ``` -------------------------------- ### Configure Tools and Toolsets with Docker Source: https://github.com/github/github-mcp-server/blob/main/README.md Combine toolsets and individual tools using GITHUB_TOOLSETS and GITHUB_TOOLS environment variables in Docker. This configuration is additive. ```bash # Tools combined with toolsets (additive) docker run -i --rm \ -e GITHUB_PERSONAL_ACCESS_TOKEN= \ -e GITHUB_TOOLSETS="repos,issues" \ -e GITHUB_TOOLS="get_gist" \ ghcr.io/github/github-mcp-server ``` -------------------------------- ### Configure GitHub MCP Server in config.toml Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-codex.md Add this configuration to your `~/.codex/config.toml` file to connect to the remote GitHub MCP server. Ensure you replace the placeholder with your actual GitHub Personal Access Token (PAT) stored in an environment variable. ```toml [mcp_servers.github] url = "https://api.githubcopilot.com/mcp/" # Replace with your real PAT (least-privilege scopes). Do NOT commit this. bearer_token_env_var = "GITHUB_PAT_TOKEN" ``` -------------------------------- ### List Available Tools with mcpcurl Source: https://github.com/github/github-mcp-server/blob/main/cmd/mcpcurl/README.md Use this command to list all dynamically generated tool commands available through the MCP server. It requires specifying the MCP server command, such as a Docker run command. ```console % ./mcpcurl --stdio-server-cmd "docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN mcp/github" tools --help Contains all dynamically generated tool commands from the schema Usage: mcpcurl tools [command] Available Commands: add_issue_comment Add a comment to an existing issue create_branch Create a new branch in a GitHub repository create_issue Create a new issue in a GitHub repository create_or_update_file Create or update a single file in a GitHub repository create_pull_request Create a new pull request in a GitHub repository create_repository Create a new GitHub repository in your account fork_repository Fork a GitHub repository to your account or specified organization get_file_contents Get the contents of a file or directory from a GitHub repository get_issue Get details of a specific issue in a GitHub repository get_issue_comments Get comments for a GitHub issue list_commits Get list of commits of a branch in a GitHub repository list_issues List issues in a GitHub repository with filtering options push_files Push multiple files to a GitHub repository in a single commit search_code Search for code across GitHub repositories search_issues Search for issues and pull requests across GitHub repositories search_repositories Search for GitHub repositories search_users Search for users on GitHub update_issue Update an existing issue in a GitHub repository Flags: -h, --help help for tools Global Flags: --pretty Pretty print MCP response (only for JSON responses) (default true) --stdio-server-cmd string Shell command to invoke MCP server via stdio (required) Use "mcpcurl tools [command] --help" for more information about a command. ``` -------------------------------- ### Get Help for a Specific Tool Source: https://github.com/github/github-mcp-server/blob/main/cmd/mcpcurl/README.md Retrieve detailed help information for a specific tool, such as 'get_issue'. This command requires specifying the MCP server command and the tool name along with the '--help' flag. ```console % ./mcpcurl --stdio-server-cmd "docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN mcp/github" tools get_issue --help Get details of a specific issue in a GitHub repository Usage: mcpcurl tools get_issue [flags] Flags: -h, --help help for get_issue --issue_number float --owner string --repo string Global Flags: --pretty Pretty print MCP response (only for JSON responses) (default true) --stdio-server-cmd string Shell command to invoke MCP server via stdio (required) ``` -------------------------------- ### List Configured MCP Servers Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-gemini-cli.md Verify the GitHub MCP server configuration by listing all configured MCP servers within the Gemini CLI. This command shows the status and available tools for each server. ```bash /mcp list ``` -------------------------------- ### Configure Gemini CLI for Local GitHub MCP Server with Docker Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-gemini-cli.md Configure your Gemini CLI settings to use the GitHub MCP server running in a local Docker container. This requires Docker to be installed and running. ```json // ~/.gemini/settings.json { "mcpServers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_MCP_PAT" } } } } ``` -------------------------------- ### Enable All Toolsets in Copilot CLI Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-copilot-cli.md Activate all available toolsets for the GitHub MCP server within a Copilot CLI session. ```bash copilot --enable-all-github-mcp-tools ``` -------------------------------- ### Configure Remote GitHub MCP Server in JetBrains IDEs Source: https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-other-copilot-ides.md Connect to the remote GitHub MCP server in JetBrains IDEs using a Personal Access Token (PAT). Ensure the GitHub Copilot plugin is installed and updated. ```json { "servers": { "github": { "url": "https://api.githubcopilot.com/mcp/", "requestInit": { "headers": { "Authorization": "Bearer YOUR_GITHUB_PAT" } } } } } ``` -------------------------------- ### Enable Specific Toolsets (Local Server) Source: https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md Use the --toolsets flag for the local server to enable specific toolsets. This is best for users who want to enable multiple related toolsets. ```json { "type": "stdio", "command": "go", "args": [ "run", "./cmd/github-mcp-server", "stdio", "--toolsets=issues,pull_requests" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}" } } ``` -------------------------------- ### Specify Individual Tools via Command Line Source: https://github.com/github/github-mcp-server/blob/main/README.md Use the --tools flag to configure specific tools. Tools can be used independently or combined with toolsets. ```bash github-mcp-server --tools get_file_contents,issue_read,create_pull_request ```