Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mcp/server/fastmcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ async def handle_sse(scope: Scope, receive: Receive, send: Send):
)
routes.append(
Mount(
self.settings.message_path,
normalized_message_endpoint,
app=RequireAuthMiddleware(sse.handle_post_message, required_scopes, resource_metadata_url),
)
)
Expand All @@ -803,7 +803,7 @@ async def sse_endpoint(request: Request) -> Response:
)
routes.append(
Mount(
self.settings.message_path,
normalized_message_endpoint,
app=sse.handle_post_message,
)
)
Expand Down
4 changes: 2 additions & 2 deletions tests/server/fastmcp/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def test_starlette_routes_with_mount_path(self):

# Verify path values
assert sse_routes[0].path == "/sse", "SSE route path should be /sse"
assert mount_routes[0].path == "/messages", "Mount route path should be /messages"
assert mount_routes[0].path == "/api/messages", "Mount route path should be /api/messages"

# Test with mount path as parameter
mcp = FastMCP()
Expand All @@ -115,7 +115,7 @@ async def test_starlette_routes_with_mount_path(self):

# Verify path values
assert sse_routes[0].path == "/sse", "SSE route path should be /sse"
assert mount_routes[0].path == "/messages", "Mount route path should be /messages"
assert mount_routes[0].path == "/param/messages", "Mount route path should be /param/messages"

@pytest.mark.anyio
async def test_non_ascii_description(self):
Expand Down
Loading