fix: use /mcp base_url for OAuth metadata endpoints#3
Open
TMogdans wants to merge 1 commit intomayflower:mainfrom
Open
fix: use /mcp base_url for OAuth metadata endpoints#3TMogdans wants to merge 1 commit intomayflower:mainfrom
TMogdans wants to merge 1 commit intomayflower:mainfrom
Conversation
The OAuth authorization server metadata was returning endpoint URLs under /api/ (authorize, token, register), but FastMCP serves these endpoints under /mcp/ where the MCP sub-app is mounted. This caused MCP clients (mcp-remote, Claude Code) to fail during OAuth client registration because POST /api/register returned 405 while the actual endpoint is at POST /mcp/register. Fixes mayflower#1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
Note: The Semgrep CI failure is pre-existing on the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
base_urlinContextMineGitHubProviderto use/mcpinstead of/apiProblem
The OAuth authorization server metadata returned endpoint URLs under
/api/...:{ "authorization_endpoint": "http://localhost:8000/api/authorize", "token_endpoint": "http://localhost:8000/api/token", "registration_endpoint": "http://localhost:8000/api/register" }But the actual endpoints served by FastMCP are at
/mcp/...(where the MCP sub-app is mounted). This caused MCP clients to fail during OAuth client registration:Fix
Changed
base_urlfrom{mcp_oauth_base_url}/apito{mcp_oauth_base_url}/mcpinapps/api/app/mcp_auth.py.Test plan
GET /mcp/.well-known/oauth-authorization-serverreturns URLs under/mcp/...POST /mcp/registerworks with the metadata-advertised URLFixes #1
🤖 Generated with Claude Code