Skip to content

Conversation

@Gumbees
Copy link

@Gumbees Gumbees commented Dec 28, 2025

BUILD ENVIROMENT
OS: Bazzite AMD Image
Platform: Docker

This fixes the MCP server returning 404 for bank-specific endpoints like /mcp/{bank_id}/sse.

Root cause: The MCPMiddleware was not properly configuring FastMCP's http_app() or handling the path/URL rewriting correctly.

Changes:

  • Use http_app(path=None, transport="sse") to create routes at /sse and /messages without mount prefixes that strip slashes
  • Fix path rewriting: /nate/sse -> /sse, /nate/messages -> /messages
  • Fix SSE endpoint URL rewrite: replace /mcp/messages/ with /mcp/{bank_id}/messages/ so clients POST to the correct path

The MCP server now correctly:

  1. Accepts SSE connections at /mcp/{bank_id}/sse
  2. Returns the correct POST endpoint in SSE response
  3. Accepts message POSTs at /mcp/{bank_id}/messages/

Fixes: #78

🤖 Generated with Claude Code

This fixes the MCP server returning 404 for bank-specific endpoints
like /mcp/{bank_id}/sse.

Root cause: The MCPMiddleware was not properly configuring FastMCP's
http_app() or handling the path/URL rewriting correctly.

Changes:
- Use http_app(path=None, transport="sse") to create routes at /sse
  and /messages without mount prefixes that strip slashes
- Fix path rewriting: /nate/sse -> /sse, /nate/messages -> /messages
- Fix SSE endpoint URL rewrite: replace /mcp/messages/ with
  /mcp/{bank_id}/messages/ so clients POST to the correct path

The MCP server now correctly:
1. Accepts SSE connections at /mcp/{bank_id}/sse
2. Returns the correct POST endpoint in SSE response
3. Accepts message POSTs at /mcp/{bank_id}/messages/

Fixes: vectorize-io#78

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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.

MCP for bank id not found

1 participant