Module: Phlex::Reactive::MCP::Runner

Defined in:
lib/phlex/reactive/mcp/runner.rb

Overview

Drives the read-only MCP server over stdio (issue #168). Invoked by the phlex_reactive:mcp rake task after MCP.load!.

KNOWN CONSTRAINT (same as pgbus): stdio MCP requires a CLEAN stdout — the JSON-RPC frames are the ONLY thing that may be written there. An initializer that puts (or any library that writes to $stdout) breaks the transport. Log to $stderr or Rails.logger, never $stdout.

Class Method Summary collapse

Class Method Details

.runObject



16
17
18
19
20
# File 'lib/phlex/reactive/mcp/runner.rb', line 16

def run
  server = Server.build
  transport = ::MCP::Server::Transports::StdioTransport.new(server)
  transport.open
end