File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ You can use `StreamableHTTPTransport#handle_request` to handle requests with pro
113113status codes (e.g., 202 Accepted for notifications).
114114
115115``` ruby
116- class McpController < ActionController ::Base
116+ class McpController < ActionController ::API
117117 def create
118118 server = MCP ::Server .new (
119119 name: " my_server" ,
@@ -124,7 +124,8 @@ class McpController < ActionController::Base
124124 prompts: [MyPrompt ],
125125 server_context: { user_id: current_user.id },
126126 )
127- transport = MCP ::Server ::Transports ::StreamableHTTPTransport .new (server)
127+ # Since the `MCP-Session-Id` is not shared across requests, `stateless: true` is set.
128+ transport = MCP ::Server ::Transports ::StreamableHTTPTransport .new (server, stateless: true )
128129 server.transport = transport
129130 status, headers, body = transport.handle_request(request)
130131
You can’t perform that action at this time.
0 commit comments