Skip to content

Commit 8cf6ea9

Browse files
committed
Address feedback: remove stateless_http from examples, keep json_response
Remove stateless_http=True from examples to avoid going "all-in" on stateless before it's properly documented in the MCP spec. Keep json_response=True for client compatibility. Changes: - Remove stateless_http from quickstart and other examples - Keep json_response=True as recommended option - Preserve original streamable_config.py ordering and note
1 parent 859f633 commit 8cf6ea9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ Note that `uv run mcp run` or `uv run mcp dev` only supports server using FastMC
11171117

11181118
### Streamable HTTP Transport
11191119

1120-
> **Note**: Streamable HTTP transport is the recommended transport for production deployments. Consider using `json_response=True` for compatibility with clients that prefer JSON over SSE.
1120+
> **Note**: Streamable HTTP transport is the recommended transport for production deployments. Use `stateless_http=True` and `json_response=True` for optimal scalability.
11211121
11221122
<!-- snippet-source examples/snippets/servers/streamable_config.py -->
11231123
```python
@@ -1128,11 +1128,11 @@ Run from the repository root:
11281128

11291129
from mcp.server.fastmcp import FastMCP
11301130

1131-
# With JSON responses instead of SSE (recommended for compatibility)
1132-
mcp = FastMCP("Server", json_response=True)
1131+
# Stateless server with JSON responses (recommended)
1132+
mcp = FastMCP("StatelessServer", stateless_http=True, json_response=True)
11331133

11341134
# Other configuration options:
1135-
# Stateless server (no session persistence)
1135+
# Stateless server with SSE streaming responses
11361136
# mcp = FastMCP("StatelessServer", stateless_http=True)
11371137

11381138
# Stateful server with session persistence

examples/snippets/servers/streamable_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
from mcp.server.fastmcp import FastMCP
77

8-
# With JSON responses instead of SSE (recommended for compatibility)
9-
mcp = FastMCP("Server", json_response=True)
8+
# Stateless server with JSON responses (recommended)
9+
mcp = FastMCP("StatelessServer", stateless_http=True, json_response=True)
1010

1111
# Other configuration options:
12-
# Stateless server (no session persistence)
12+
# Stateless server with SSE streaming responses
1313
# mcp = FastMCP("StatelessServer", stateless_http=True)
1414

1515
# Stateful server with session persistence

0 commit comments

Comments
 (0)