Skip to content

Replace 307 redirect with ASGI path rewrite for /mcp → /mcp/#117

Merged
neoneye merged 1 commit intomainfrom
mcp-smithery4
Feb 28, 2026
Merged

Replace 307 redirect with ASGI path rewrite for /mcp → /mcp/#117
neoneye merged 1 commit intomainfrom
mcp-smithery4

Conversation

@neoneye
Copy link
Member

@neoneye neoneye commented Feb 28, 2026

Smithery refuses to follow 307 redirects for POST requests, causing 502 errors during scanning. Replace the redirect route with a raw ASGI middleware (_NormalizeMcpPath) that silently rewrites /mcp to /mcp/ at the scope level before routing, so the mounted FastMCP app receives requests directly.

Smithery refuses to follow 307 redirects for POST requests, causing
502 errors during scanning. Replace the redirect route with a raw ASGI
middleware (_NormalizeMcpPath) that silently rewrites /mcp to /mcp/ at
the scope level before routing, so the mounted FastMCP app receives
requests directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@neoneye neoneye merged commit bec0b25 into main Feb 28, 2026
3 checks passed
@neoneye neoneye deleted the mcp-smithery4 branch February 28, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant