class

CrystalMcp::Server

Inherits Reference < Object

The main server class that handles JSON-RPC requests over standard I/O.

Constants

Log = ::Log.for("server")

Class methods

dispatch_request(request : JSON::Any) : Nil

Dispatches the parsed JSON-RPC request to the appropriate handler.

Source
output

The IO to write responses to.

Source
output=(output : IO)

The IO to write responses to.

Source
process_request(line : String) : Nil

Processes a single request line.

Source
run(config : Config = Config.new) : Nil

Starts the server and begins processing requests from standard input.

Spawns a fiber for each incoming request line and waits for all in-flight fibers to complete before returning, ensuring no responses are lost when stdin reaches EOF.

Parameters:

  • config: The server configuration.
Source