You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to deploy multiple MCP servers behind Nginx, with Nginx using URL prefixes to reverse proxy messages to different MCP servers, but I get some errors when accessing:
graph LR
subgraph "Application Host Process"
C1[Client]
end
subgraph "Internet"
N3[Nginx <br> 192.168.1.224:8889]
S3[MCP Server <br> 192.168.1.224:18080]
C1 --> N3
N3 <--> S3
end
RROR:mcp.client.sse:Error in post_writer: Client error '404 Not Found' for url 'http://192.168.1.224:8889/messages/?session_id=bd882da221894cfcb535ef3907926e64'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
Describe the solution you'd like
Perhaps it can be compatible with the MCP service after Nginx reverse proxy by configuring base_url or modifying the code.
You need to establish your own routing strategy. First, the link is established and the subsequent message transmission must be on a server.
You can customize the nginx load balancing strategy in lua and modify the sdk sse.py
There is still a long way to go to use mcp at the production level, and it is not yet mature.
Is your feature request related to a problem? Please describe.
I want to deploy multiple MCP servers behind Nginx, with Nginx using URL prefixes to reverse proxy messages to different MCP servers, but I get some errors when accessing:
nginx.conf:
server.py
uv run server.py
client.py
python3 client.py http://192.168.1.224:8889/abcdef/dddddd/sse
I received the following error:
Describe the solution you'd like
Perhaps it can be compatible with the MCP service after Nginx reverse proxy by configuring base_url or modifying the code.
Describe alternatives you've considered
I modified line 64 of https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/sse.py to the following code, and now it works for me.
Additional context
The text was updated successfully, but these errors were encountered: