Skip to content

Commit 1a638ad

Browse files
authored
Streamable HTTP Trailing Slash Compatibility
1 parent 900c2dd commit 1a638ad

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/mcp/server/fastmcp/server.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,22 @@ async def handle_streamable_http(
838838
_alt_path = _main_path + "/"
839839
if _alt_path != _main_path:
840840
if self._auth_server_provider:
841-
routes.append(Mount(_alt_path, app=RequireAuthMiddleware(handle_streamable_http, required_scopes)))
841+
routes.append(
842+
Mount(
843+
_alt_path,
844+
app=RequireAuthMiddleware(
845+
handle_streamable_http,
846+
required_scopes,
847+
),
848+
)
849+
)
842850
else:
843-
routes.append(Mount(_alt_path, app=handle_streamable_http))
851+
routes.append(
852+
Mount(
853+
_alt_path,
854+
app=handle_streamable_http,
855+
)
856+
)
844857

845858
routes.extend(self._custom_starlette_routes)
846859

0 commit comments

Comments
 (0)