Introduce stateless mode to allow for HA
- Create failing tests for `stateless` mode - Implement `stateless` mode by turning of SSE in Streamable HTTP, making the interaction a standard HTTP Req/Resp
This commit is contained in:
parent
55dfbdc3b6
commit
08a84c7320
1 changed files with 179 additions and 14 deletions
|
|
@ -126,12 +126,19 @@ 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
|
||||
|
||||
```ruby
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue