-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Describe the bug
This line is the problem:
python-sdk/src/mcp/client/sse.py
Line 64 in babb477
| endpoint_url = urljoin(url, sse.data) |
urljoin discards the whole path, meaning that if url is http://localhost:8000/mcp/sse and sse.data is /messages/?session_id=123 we get endpoint_url == "http://localhost:8000/messages/?session_id=123" instead of http://localhost:8000/mcp/messages/?session_id=123
To Reproduce
- Launch an MCP server with SSE on a path different from the root of the application.
app = FastAPI()
mcp = FastMCP("my-mcp-server")
app.mount("/mcp", mcp.sse_app())- Try to connect to it using
sse_clientas per the tutorial
Expected behavior
endpoint_url should contain the suffix of url with /sse stripped instead of the whole path being stripped.
epigos and Galaco
Metadata
Metadata
Assignees
Labels
No labels