Merge pull request #495 from koic/subscriptions_listen

Serve the `subscriptions/listen` notification stream per SEP-2575
This commit is contained in:
Koichi ITO 2026-08-13 23:05:35 +09:00 • committed by GitHub
commit ebed930927
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -667,6 +667,34 @@ module Conformance
end
end
end
class TestTriggerToolChange < MCP::Tool
tool_name "test_trigger_tool_change"
description "A diagnostic tool that broadcasts notifications/tools/list_changed to listen streams (SEP-2575)"
class << self
# The broadcast alone exercises the `subscriptions/listen` delivery, so no actual
# tool-list mutation is needed, matching the suite's TypeScript reference fixture.
def call(server_context:, **_args)
server_context.notify_tools_list_changed
MCP::Tool::Response.new([MCP::Content::Text.new("Mutation triggered").to_h])
end
end
end
class TestTriggerPromptChange < MCP::Tool
tool_name "test_trigger_prompt_change"
description "A diagnostic tool that broadcasts notifications/prompts/list_changed to listen streams (SEP-2575)"
class << self
def call(server_context:, **_args)
server_context.notify_prompts_list_changed
MCP::Tool::Response.new([MCP::Content::Text.new("Mutation triggered").to_h])
end
end
end
end
module Prompts
@ -907,6 +935,8 @@ module Conformance
Tools::TestInputRequiredResultCapabilities,
Tools::TestStreamingElicitation,
Tools::TestLoggingTool,
Tools::TestTriggerToolChange,
Tools::TestTriggerPromptChange,
],
prompts: [
Prompts::TestSimplePrompt,