Class: Rigor::CLI::McpCommand
- Defined in:
- lib/rigor/cli/mcp_command.rb
Overview
Executes the ‘rigor mcp` command.
Starts a long-running MCP (Model Context Protocol) server over stdio. The server exposes Rigor’s analysis tools as MCP tool calls over a newline-delimited JSON-RPC 2.0 stream. See ADR-33.
Slice 1 ships the stdio transport with seven read-only tools: rigor_check, rigor_type_of, rigor_triage, rigor_annotate, rigor_sig_gen, rigor_explain, rigor_coverage.
Constant Summary collapse
- USAGE =
"Usage: rigor mcp [options]"
Instance Method Summary collapse
-
#run ⇒ Integer
CLI exit status.
Methods inherited from Command
Constructor Details
This class inherits a constructor from Rigor::CLI::Command
Instance Method Details
#run ⇒ Integer
Returns CLI exit status.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rigor/cli/mcp_command.rb', line 22 def run = return CLI::EXIT_USAGE if == :usage_error transport = .fetch(:transport) unless transport == "stdio" @err.puts("rigor mcp: unsupported transport: #{transport.inspect} (only `stdio` is supported in v1)") return CLI::EXIT_USAGE end require_relative "../mcp" require_relative "../version" server = MCP::Server.new(config_path: .fetch(:config), err: $stderr) loop_runner = MCP::Loop.new(input: $stdin, output: $stdout, server: server) loop_runner.run 0 end |