307 Temporary Redirect
INFO: 127.0.0.1:56991 - "POST /mcp HTTP/1.1" 307 Temporary Redirect INFO: 127.0.0.1:56991 - "POST /mcp/ HTTP/1.1" 200 OK
After using mcp.run(transport="streamable-http") to start the server, why does the client always redirect to '/mcp/' when requesting the server?
same issue.
same
http://localhost/mcp => http://localhost/mcp/
set your streamable_http_path='/mcp/'
#781
It is the issue of fastapi. May close in this project.
Just to share code, the following results in those errors:
streamablehttp_client("http://myserver.com/mcp")
whereas this resolves them:
streamablehttp_client("http://myserver.com/mcp/")
It appears that the streamable_http_client cannot handle the redirect, and when we use Starlette/FastAPI, /mcp gets turned into /mcp/, so we need to give the direct route of /mcp.
Perhaps streamable_http_client could add redirect handling? But not all clients will handle it (see VS Code issue).