Skip to content

Commit b8719ce

Browse files
committed
[Doc] Tweak the README for stateless
`stateless` was supported in #101. However, as shown in the official specification below, the supported transports are stdout and Streamable HTTP, and whether it is stateless is a detail specific to Streamable HTTP: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports This PR updates the documentation to describe `stateless` as part of the Streamable HTTP section.
1 parent 400a56e commit b8719ce

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ Notifications follow the JSON-RPC 2.0 specification and use these method names:
126126

127127
- **stdio**: Notifications are sent as JSON-RPC 2.0 messages to stdout
128128
- **Streamable HTTP**: Notifications are sent as JSON-RPC 2.0 messages over HTTP with streaming (chunked transfer or SSE)
129-
- **Stateless Streamable HTTP**: Notifications are not supported and all calls are request/response interactions; allows for easy multi-node deployment.
130129

131130
#### Usage Example
132131

@@ -136,16 +135,22 @@ server = MCP::Server.new(name: "my_server")
136135
# Default Streamable HTTP - session oriented
137136
transport = MCP::Server::Transports::StreamableHTTPTransport.new(server)
138137

139-
# OR Stateless Streamable HTTP - session-less
140-
transport = MCP::Server::Transports::StreamableHTTPTransport.new(server, stateless: true)
141-
142138
server.transport = transport
143139

144140
# When tools change, notify clients
145141
server.define_tool(name: "new_tool") { |**args| { result: "ok" } }
146142
server.notify_tools_list_changed
147143
```
148144

145+
You can use Stateless Streamable HTTP, where notifications are not supported and all calls are request/response interactions.
146+
This mode allows for easy multi-node deployment.
147+
Set `stateless: true` in `MCP::Server::Transports::StreamableHTTPTransport.new` (`stateless` defaults to `false`):
148+
149+
```ruby
150+
# Stateless Streamable HTTP - session-less
151+
transport = MCP::Server::Transports::StreamableHTTPTransport.new(server, stateless: true)
152+
```
153+
149154
### Unsupported Features ( to be implemented in future versions )
150155

151156
- Log Level

0 commit comments

Comments
 (0)