What happened?
fastmcp list and fastmcp call can choose a transport different from the one explicitly requested:
- With
--transport sse, https://example.test/mcp?token=abc is rewritten to https://example.test/mcp?token=abc/sse. The path stays /mcp, the token is changed to abc/sse, and FastMCP infers HTTP.
- With
--transport http, https://example.test/sse is passed through unchanged, then FastMCP infers SSE from the /sse path.
The CLI documentation says --transport forces http or sse for URL targets. Could the explicit choice be passed through to the selected client transport, with any SSE path adjustment applied only to the parsed URL path and the query preserved?
Example Code
Version Information
- FastMCP main: `5baeacfe20eca735cb949564b4915f93a622b916`
- Python: 3.12.15
- OS: macOS 15.0.1 arm64
What happened?
fastmcp listandfastmcp callcan choose a transport different from the one explicitly requested:--transport sse,https://example.test/mcp?token=abcis rewritten tohttps://example.test/mcp?token=abc/sse. The path stays/mcp, the token is changed toabc/sse, and FastMCP infers HTTP.--transport http,https://example.test/sseis passed through unchanged, then FastMCP infers SSE from the/ssepath.The CLI documentation says
--transportforceshttporssefor URL targets. Could the explicit choice be passed through to the selected client transport, with any SSE path adjustment applied only to the parsed URL path and the query preserved?Example Code
Version Information