From c39428e38443b8f4d5381d9c742d1dbd0b1f6772 Mon Sep 17 00:00:00 2001 From: Joe Rzepiejewski Date: Sun, 9 Nov 2025 11:31:10 -0800 Subject: [PATCH] Replace 'rackup' with 'rack' in server file Running this example with Ruby 3.4.5 the following does not work: ```ruby Rackup::Handler.get("puma").run(rack_app, Port: 9393, Host: "0.0.0.0") ``` It returns the following error message: `uninitialized constant Rackup::Handler (NameError)` To resolve this I just required Rack and changed Rackup to Rack. Then things worked fine. --- examples/streamable_http_server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/streamable_http_server.rb b/examples/streamable_http_server.rb index 82566fc..3bd7261 100644 --- a/examples/streamable_http_server.rb +++ b/examples/streamable_http_server.rb @@ -2,7 +2,7 @@ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__)) require "mcp" -require "rackup" +require "rack" require "json" require "logger" @@ -168,4 +168,4 @@ def call(message:, delay: 0) MESSAGE # Start the server -Rackup::Handler.get("puma").run(rack_app, Port: 9393, Host: "localhost") +Rack::Handler.get("puma").run(rack_app, Port: 9393, Host: "localhost")