Class: ActionMCP::Server::TransportHandler
- Inherits:
-
Object
- Object
- ActionMCP::Server::TransportHandler
- Includes:
- Capabilities, Elicitation, MessagingService, Prompts, Resources, ResponseCollector, Roots, Sampling, Tasks, Tools
- Defined in:
- lib/action_mcp/server/transport_handler.rb
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Attributes included from ResponseCollector
Attributes included from MessagingService
Instance Method Summary collapse
-
#initialize(session, messaging_mode: :write) ⇒ TransportHandler
constructor
A new instance of TransportHandler.
- #send_pong(request_id) ⇒ Object
Methods included from ResponseCollector
#clear_collected_responses, #get_collected_responses, #get_last_response, #initialize_response_collector, #write_message
Methods included from Tasks
#send_task_status_notification, #send_tasks_cancel, #send_tasks_get, #send_tasks_list, #send_tasks_result, #send_tasks_resume
Methods included from Elicitation
Methods included from Roots
Methods included from Sampling
Methods included from Resources
#send_resource_read, #send_resource_templates_list, #send_resources_list
Methods included from Prompts
#send_prompts_get, #send_prompts_list
Methods included from Tools
#send_tools_call, #send_tools_list
Methods included from Capabilities
Methods included from MessagingService
#send_jsonrpc_error, #send_jsonrpc_notification, #send_jsonrpc_request, #send_jsonrpc_response, #send_logging_message_notification, #send_progress_notification, #send_prompts_list_changed_notification, #send_resource_updated_notification, #send_resources_list_changed_notification, #send_tools_list_changed_notification
Constructor Details
#initialize(session, messaging_mode: :write) ⇒ TransportHandler
Returns a new instance of TransportHandler.
27 28 29 30 31 |
# File 'lib/action_mcp/server/transport_handler.rb', line 27 def initialize(session, messaging_mode: :write) @session = session @messaging_mode = messaging_mode initialize_response_collector if messaging_mode == :return end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
9 10 11 |
# File 'lib/action_mcp/server/transport_handler.rb', line 9 def session @session end |
Instance Method Details
#send_pong(request_id) ⇒ Object
33 34 35 |
# File 'lib/action_mcp/server/transport_handler.rb', line 33 def send_pong(request_id) send_jsonrpc_response(request_id, result: {}) end |