Skip to content
Open
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
11 changes: 9 additions & 2 deletions mcp-server-hello-world/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@
load_tools(mcp_server)

# Convert the MCP server to a streamable HTTP application
# This creates a FastAPI app that implements the MCP protocol over HTTP
mcp_app = mcp_server.http_app()
# This creates a FastAPI app that implements the MCP protocol over HTTP.
#
# stateless_http=True makes each request self-contained instead of requiring a
# prior session-initialization handshake. Some MCP clients (e.g. the Databricks
# Assistant) do not send the `mcp-session-id` header, which causes stateful
# servers to reject follow-up requests with HTTP 400. Stateless mode also plays
# nicely with horizontally scaled Databricks Apps where requests may land on
# different replicas.
mcp_app = mcp_server.http_app(stateless_http=True)

# ============================================================================
# FastAPI Application Setup
Expand Down