Class: Textus::Surfaces::CLI::Verb::MCPServe

Inherits:
Textus::Surfaces::CLI::Verb show all
Defined in:
lib/textus/surfaces/cli/verb/mcp_serve.rb

Overview

Launches the MCP stdio server in the current process. Blocks on stdin; never returns until stdin closes. The connection acts as the ‘agent` role by default (ADR 0040): the agent channel proposes, it does not inherit the human’s authority. Override per connection with –as, or TEXTUS_ROLE / .textus/role (same chain as every other verb).

Instance Attribute Summary

Attributes inherited from Textus::Surfaces::CLI::Verb

#positional, #stdin

Instance Method Summary collapse

Methods inherited from Textus::Surfaces::CLI::Verb

command_name, descendants, #emit, #gate_dispatch, inherited, #initialize, needs_store?, option, options, parent_group, #parse, #resolved_role

Constructor Details

This class inherits a constructor from Textus::Surfaces::CLI::Verb

Instance Method Details

#call(store) ⇒ Object



15
16
17
18
19
# File 'lib/textus/surfaces/cli/verb/mcp_serve.rb', line 15

def call(store)
  role = resolved_role(store, default: Textus::Role::AGENT)
  Textus::Surfaces::MCP::Server.new(store: store, stdin: @stdin, stdout: @stdout, role: role).run
  0
end