[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.
This commit is contained in:
parent
400a56e83d
commit
b8719ce04f
1 changed files with 9 additions and 4 deletions
13
README.md
13
README.md
|
|
@ -126,7 +126,6 @@ Notifications follow the JSON-RPC 2.0 specification and use these method names:
|
|||
|
||||
- **stdio**: Notifications are sent as JSON-RPC 2.0 messages to stdout
|
||||
- **Streamable HTTP**: Notifications are sent as JSON-RPC 2.0 messages over HTTP with streaming (chunked transfer or SSE)
|
||||
- **Stateless Streamable HTTP**: Notifications are not supported and all calls are request/response interactions; allows for easy multi-node deployment.
|
||||
|
||||
#### Usage Example
|
||||
|
||||
|
|
@ -136,9 +135,6 @@ server = MCP::Server.new(name: "my_server")
|
|||
# Default Streamable HTTP - session oriented
|
||||
transport = MCP::Server::Transports::StreamableHTTPTransport.new(server)
|
||||
|
||||
# OR Stateless Streamable HTTP - session-less
|
||||
transport = MCP::Server::Transports::StreamableHTTPTransport.new(server, stateless: true)
|
||||
|
||||
server.transport = transport
|
||||
|
||||
# When tools change, notify clients
|
||||
|
|
@ -146,6 +142,15 @@ server.define_tool(name: "new_tool") { |**args| { result: "ok" } }
|
|||
server.notify_tools_list_changed
|
||||
```
|
||||
|
||||
You can use Stateless Streamable HTTP, where notifications are not supported and all calls are request/response interactions.
|
||||
This mode allows for easy multi-node deployment.
|
||||
Set `stateless: true` in `MCP::Server::Transports::StreamableHTTPTransport.new` (`stateless` defaults to `false`):
|
||||
|
||||
```ruby
|
||||
# Stateless Streamable HTTP - session-less
|
||||
transport = MCP::Server::Transports::StreamableHTTPTransport.new(server, stateless: true)
|
||||
```
|
||||
|
||||
### Unsupported Features ( to be implemented in future versions )
|
||||
|
||||
- Log Level
|
||||
|
|
|
|||
Loading…
Reference in a new issue