Skip to content

GoogleProvider should expose enable_cimd parameter #3709

@henrysouchien

Description

@henrysouchien

Problem

OAuthProxy.__init__ accepts an enable_cimd: bool = True parameter to control CIMD (Client ID Metadata Document) support, but GoogleProvider does not forward this parameter. There's no way to disable CIMD through the public API when using GoogleProvider.

Use Case

Claude Code's CIMD document (https://claude.ai/oauth/claude-code-client-metadata) lists redirect URIs without wildcard ports:

"redirect_uris": ["http://localhost/callback", "http://127.0.0.1/callback"]

But Claude Code uses dynamic ports for its OAuth callback (e.g., http://localhost:8080/callback). FastMCP's _match_port in redirect_validation.py treats no-port as port 80 exactly, so the redirect URI validation always fails for CIMD clients.

The workaround is to subclass GoogleProvider and null out _cimd_manager after super().__init__(), but this relies on a private attribute.

Suggested Fix

Forward enable_cimd through GoogleProvider.__init__ to the parent OAuthProxy:

class GoogleProvider(OAuthProxy):
    def __init__(
        self,
        *,
        # ... existing params ...
        enable_cimd: bool = True,  # <-- add this
    ):
        super().__init__(
            # ... existing args ...
            enable_cimd=enable_cimd,  # <-- forward it
        )

Environment

  • fastmcp 3.1.0
  • Python 3.13
  • macOS / Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    authRelated to authentication (Bearer, JWT, OAuth, WorkOS) for client or server.enhancementImprovement to existing functionality. For issues and smaller PR improvements.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions