Skip to content

Commit 4d79263

Browse files
committed
Addressing feedback
1 parent 2942d45 commit 4d79263

File tree

7 files changed

+1
-47
lines changed

7 files changed

+1
-47
lines changed
File renamed without changes.

examples/sse_test_server.rb renamed to examples/streaming_http_test_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def call(message:, delay: 0)
137137
end
138138

139139
# Print usage instructions
140-
puts "=== MCP SSE Test Server ==="
140+
puts "=== MCP Streaming HTTP Test Server ==="
141141
puts ""
142142
puts "Starting server on http://localhost:9393"
143143
puts ""

lib/mcp/server/transports/stdio_transport.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ class Server
88
module Transports
99
class StdioTransport < Transport
1010
STATUS_INTERRUPTED = Signal.list["INT"] + 128
11-
class << self
12-
def register
13-
super("stdio", self)
14-
end
15-
end
1611

1712
def initialize(server)
1813
@server = server

lib/mcp/server/transports/streamable_http_transport.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ module MCP
88
class Server
99
module Transports
1010
class StreamableHTTPTransport < Transport
11-
class << self
12-
def register
13-
super("http", self)
14-
end
15-
end
16-
1711
def initialize(server)
1812
super
1913
# { session_id => { stream: stream_object }

lib/mcp/transport.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22

33
module MCP
44
class Transport
5-
class << self
6-
def register(name, transport_class)
7-
@transports ||= {}
8-
@transports[name] = transport_class
9-
end
10-
11-
def get(name)
12-
raise "Transport #{name} not found" unless @transports
13-
14-
@transports.fetch(name) { raise "Transport #{name} not found" }
15-
end
16-
end
17-
185
# Initialize the transport with the server instance
196
def initialize(server)
207
@server = server

test/mcp/server_notification_test.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,5 @@ def send_notification(method, params = nil)
126126
assert_equal Methods::NOTIFICATIONS_PROMPTS_LIST_CHANGED, notifications[1][:method]
127127
assert_equal Methods::NOTIFICATIONS_RESOURCES_LIST_CHANGED, notifications[2][:method]
128128
end
129-
130-
test "notification method constants are defined correctly" do
131-
assert_equal "notifications/tools/list_changed", Methods::NOTIFICATIONS_TOOLS_LIST_CHANGED
132-
assert_equal "notifications/prompts/list_changed", Methods::NOTIFICATIONS_PROMPTS_LIST_CHANGED
133-
assert_equal "notifications/resources/list_changed", Methods::NOTIFICATIONS_RESOURCES_LIST_CHANGED
134-
end
135129
end
136130
end

test/mcp/transport_test.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,6 @@ def close
2828
resources: [],
2929
)
3030
@transport = TestTransport.new(@server)
31-
# Clear transports registry before each test
32-
Transport.instance_variable_set(:@transports, nil)
33-
end
34-
35-
teardown do
36-
# Clear transports registry after each test
37-
Transport.instance_variable_set(:@transports, nil)
38-
end
39-
40-
test "registers transport class" do
41-
Transport.register("test", TestTransport)
42-
assert_equal TestTransport, Transport.get("test")
43-
end
44-
45-
test "raises error for unknown transport" do
46-
assert_raises(RuntimeError, "Transport unknown not found") { Transport.get("unknown") }
4731
end
4832

4933
test "initializes with server instance" do

0 commit comments

Comments
 (0)