Revert mount_path parameter from FastMCP#1881
Merged
Conversation
8d29bae to
41f3219
Compare
The mount_path parameter added in PR #540 was redundant because the SSE transport already handles sub-path mounting via ASGI's standard root_path mechanism. When using Starlette's Mount("/path", app=mcp.sse_app()), Starlette automatically sets root_path in the ASGI scope. The SseServerTransport already uses this to construct the correct message endpoint path (see sse.py lines 148-161). This revert removes: - mount_path setting from Settings class - mount_path parameter from FastMCP.__init__ - mount_path parameter from run() and run_sse_async() - _normalize_path() helper method - mount_path parameter from sse_app() - Related tests and redundant documentation The README documentation is updated to show the correct way to mount multiple MCP servers at different sub-paths, which works out of the box.
41f3219 to
9904d65
Compare
mount_path parameter from FastMCP
felixweinberger
previously approved these changes
Jan 16, 2026
Contributor
felixweinberger
left a comment
There was a problem hiding this comment.
LGTM, but do we need a migration.md line about removing this?
I think it's a breaking change to remove the mount_path argument if someone was using it (even if it was redundant / did nothing).
felixweinberger
approved these changes
Jan 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR reverts the
mount_pathparameter added in #540. The parameter was redundant because the SSE transport already handles sub-path mounting via ASGI's standardroot_pathmechanism.Why this revert?
When using Starlette's
Mount("/path", app=mcp.sse_app()), Starlette automatically setsroot_pathin the ASGI scope. TheSseServerTransportalready uses this to construct the correct message endpoint path (seesse.pylines 148-161):Minimal Reproducible Example
The existing test
test_sse_client_basic_connection_mounted_appintests/shared/test_sse.pyalready demonstrates this works. Here's a simplified version:The client connects to
/github/sseand the server automatically returns/github/messages/as the message endpoint - nomount_pathconfiguration needed.What's removed
mount_pathsetting fromSettingsclassmount_pathparameter fromFastMCP.__init__mount_pathparameter fromrun()andrun_sse_async()_normalize_path()helper methodmount_pathparameter fromsse_app()What's updated
The README documentation now shows the correct way to mount multiple MCP servers, which works out of the box via ASGI's
root_path.