Back

How to use GitHub MCP remote server with LibreChat

June 9, 2026

This guide shows how to use the official GitHub MCP server in LibreChat.

While MCP configuration in LibreChat is straightforward, LibreChat auto-detects OAuth on that URL and tries dynamic client registration, which GitHub MCP does not support.

The solution is to disable OAuth, and authenticate with a GitHub PAT via Authorization header.

librechat.yaml config

Create a GitHub Personal Access Token (PAT) with the required scopes and edit your librechat.yaml file to configure the MCP server.

mcpServers:
  github:
    # HTTP transport for remote MCP
    type: streamable-http
    # GitHub MCP endpoint
    url: https://api.githubcopilot.com/mcp/
    # IMPORTANT: skip OAuth entirely
    requiresOAuth: false
    headers:
      # PAT from env
      Authorization: "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"

Make sure the GITHUB_PERSONAL_ACCESS_TOKEN environment variable is accessible in your environment. You can still use per-user PAT if that fits your runtime requirements better.

In that case, include

mcpServers:
  github:
    # Include the same config as above
    # This will prompt the user for the PAT when they select the MCP server
    customUserVars:
      GITHUB_PERSONAL_ACCESS_TOKEN:
        title: "GitHub PAT"
        description: "GitHub Personal Access Token for the GitHub MCP server"

Restart LibreChat so it picks up the env var and new MCP server configuration. In the UI, select the github MCP server; it should now connect without any OAuth popup.

This guide was partly generated with the help of an LLM.