Skip to content

GitHubProvider returns 400 when claude.ai skips Dynamic Client Registration #3949

@saidsef

Description

@saidsef

What happened?

When adding a FastMCP server backed by GitHubProvider to claude.ai as a remote MCP server, the OAuth flow fails with a 400 "Client Not Registered" error. The browser popup shows:

The client ID Ov23lifBJkuc3N90PTD4 was not found in the server's client registry.

Clearing auth tokens and reconnecting does not fix it — the error reappears immediately. The server works fine with MCP Inspector and Claude Desktop.

The cause: claude.ai doesn't call /register before /authorize. It sends the GitHub OAuth App's client_id (the one you configured in GitHubProvider) directly in the authorization request. OAuthProxy.get_client() returns None for any id not previously registered via /register, and the MCP SDK's authorize handler returns 400 before the provider code is reached at all.

Example Code

from fastmcp import FastMCP
from fastmcp.server.auth.providers.github import GitHubProvider

auth = GitHubProvider(
    client_id="Ov23lifBJkuc3N90PTD4",   # GitHub OAuth App client_id
    client_secret="...",
    base_url="https://your-server.example.com",
)
mcp = FastMCP("My Server", auth=auth)

Steps:

  1. Run the server above (publicly accessible over HTTPS)
  2. In claude.ai → Settings → Integrations → Add remote MCP server
  3. Set the server URL; when prompted for OAuth credentials, enter the GitHub OAuth App client_id
  4. Browser popup opens and immediately shows the 400 error page

Expected: GitHub authorization screen (or FastMCP consent screen)
Actual: "Client Not Registered" error — flow never starts

Version Information

fastmcp 3.2.5
mcp 1.6.0
Python 3.14
Client: claude.ai web

Metadata

Metadata

Assignees

No one assigned

    Labels

    authRelated to authentication (Bearer, JWT, OAuth, WorkOS) for client or server.bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.serverRelated to FastMCP server implementation or server-side functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions