Module: Textus::Surfaces::MCP::Routing

Included in:
Server
Defined in:
lib/textus/surfaces/mcp/routing.rb

Overview

Protocol routing for the MCP JSON-RPC server. Mixed into Server so all handle_* and emit_* methods are in scope without exposing them publicly.

Constant Summary collapse

TOOL_METHODS =
%w[initialize tools/list tools/call].freeze
RESOURCE_METHODS =
%w[resources/list resources/read].freeze

Instance Method Summary collapse

Instance Method Details

#dispatch(msg) ⇒ Object



10
11
12
13
14
# File 'lib/textus/surfaces/mcp/routing.rb', line 10

def dispatch(msg)
  rid    = msg["id"]
  params = msg["params"] || {}
  route(msg["method"], rid, params)
end