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
Problem
OAuthProxy.__init__accepts anenable_cimd: bool = Trueparameter to control CIMD (Client ID Metadata Document) support, butGoogleProviderdoes not forward this parameter. There's no way to disable CIMD through the public API when usingGoogleProvider.Use Case
Claude Code's CIMD document (
https://claude.ai/oauth/claude-code-client-metadata) lists redirect URIs without wildcard ports:But Claude Code uses dynamic ports for its OAuth callback (e.g.,
http://localhost:8080/callback). FastMCP's_match_portinredirect_validation.pytreats no-port as port 80 exactly, so the redirect URI validation always fails for CIMD clients.The workaround is to subclass
GoogleProviderand null out_cimd_manageraftersuper().__init__(), but this relies on a private attribute.Suggested Fix
Forward
enable_cimdthroughGoogleProvider.__init__to the parentOAuthProxy:Environment