iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🔌

Controlling GitHub from Claude Desktop: Setup Guide for github-mcp-server

に公開

Overview

  • GitHub provides a public MCP server (api.githubcopilot.com/mcp), but it cannot be used due to OAuth compatibility issues in Claude Desktop.
  • As an alternative, by setting up github-mcp-server locally, you can reference and operate GitHub repositories from Claude Desktop.
  • This article explains the steps from obtaining the binary and creating a Fine-Grained Token to configuring Claude Desktop.

Prerequisites / Environment

  • OS: Windows (The steps in this article are for Windows. The same procedure can be followed for macOS / Linux.)
  • Claude Desktop must be installed.
  • You must have a GitHub account.

Goal

The goal is to be able to reference and operate GitHub repository information from Claude Desktop. Specifically, github will appear in the MCP server list in Claude Desktop, enabling you to perform actions such as retrieving repository content and managing Issues.

Steps

Step 1: Obtain the MCP server binary

github-mcp-server is an official MCP server implementation provided by GitHub. Download the binary from GitHub Releases and place it on your machine.

  1. Download the latest ZIP file from the following URL:

    https://github.com/github/github-mcp-server/releases/latest/download/github-mcp-server_Windows_x86_64.zip

  2. Extract the ZIP and place github-mcp-server.exe in any location.

The location can be anywhere (e.g., %USERPROFILE%\bin). Since you will need to write the full path in the Claude Desktop configuration file in a later step, place it somewhere easy for you to find.

Step 2: Create a GitHub Fine-Grained Token

A Personal Access Token (PAT) is required for the MCP server to access the GitHub API. Here, we will create a Fine-Grained Token, which allows for more granular permission control.

  1. Log in to GitHub and open Settings from the icon in the upper right.

  2. Click Developer settings at the bottom of the left menu.

  3. Select Personal access tokensFine-grained tokens in the left menu.

  4. Click Generate new token.

  5. Enter the token settings.

    • Token name: Any name (e.g., claude-desktop-mcp)
    • Expiration: Select the expiration period (default is 30 days)
    • Repository access: Select the repositories you want to allow access to
    • Permissions: Set the following
      • Metadata: Read-only (set by default, no change needed)
      • Contents: Read-only (to read repository content) or Read and write (to also create or edit files)
  6. Click Generate token and copy the displayed token.

Unlike Classic Tokens, Fine-Grained Tokens allow you to limit the scope of access by repository and permission. They are recommended from a security perspective because they allow for operation with minimum necessary privileges.

Step 3: Update Claude Desktop settings

Register the MCP server connection information in Claude Desktop.

  1. Open Claude Desktop.
  2. Click Settings -> Developer -> Edit Config.
  3. The claude_desktop_config.json file will open. Add the following entry to mcpServers.
claude_desktop_config.json
{
  "mcpServers": {
    "github": {
      "command": "C:\\Users\\your-username\\bin\\github-mcp-server.exe",
      "args": ["stdio"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_XXXXXX"
      }
    }
  }
}

Here is a description of the configuration items:

Item Value
command The full path to github-mcp-server.exe placed in Step 1
args ["stdio"] (Mode for communicating via standard input/output)
env.GITHUB_PERSONAL_ACCESS_TOKEN The Fine-Grained Token obtained in Step 2
  1. Save the file.

Step 4: Verification

  1. Restart Claude Desktop (changes to the configuration file are applied after a restart).
  2. Check the list of MCP servers from the icon at the bottom right of the Claude Desktop input field.
  3. If github is displayed, the connection is successful.

Once the connection is successful, you can ask Claude Desktop tasks like "Show me the list of Issues for this repository" to retrieve information from GitHub.

Potential Pitfalls

Why the public MCP server is unavailable

GitHub provides a public MCP server at https://api.githubcopilot.com/mcp/. Ideally, simply connecting to this server should enable GitHub integration, but it is currently not usable from Claude Desktop.

The cause lies in issues with the MCP OAuth flow implementation in Claude Desktop. Specifically, the following behaviors have been observed:

  • Ignoring resource_metadata in the WWW-Authenticate header: According to OAuth specifications, a resource server returns information about an external authorization server (resource_metadata) in the WWW-Authenticate header, and the client should refer to it to connect to the authorization server. However, Claude Desktop ignores this information and instead looks for /.well-known/oauth-authorization-server on the MCP server itself.
  • Worsened after the December 18, 2025, Claude Desktop update: While there were reports of being able to connect using certain workarounds previously, reports of total failure have increased since this update.

This is a known issue reported in multiple GitHub Issues:

No clear fix schedule has been announced. The currently recommended official workaround is the "local binary + PAT" configuration explained in this article.

Summary

We have explained the steps to set up github-mcp-server locally to operate GitHub from Claude Desktop.

  • Obtain and place the binary from GitHub Releases.
  • Grant minimum necessary permissions using a Fine-Grained Token.
  • Register the server information in claude_desktop_config.json and restart.

Given the current unavailability of the public MCP server, this configuration is the most straightforward method. If the OAuth issues are fixed, manual token management may become unnecessary in the future.

By expanding permissions, you can enable Claude Desktop to not only read repository content but also perform actions like creating Issues or managing Pull Requests. It is recommended to start with Read-only access and add permissions as needed.

Discussion