class
CrystalMcp::Server
- CrystalMcp::Server
- Reference
- Object
Overview
The main server class that handles JSON-RPC requests over standard I/O.
Defined in:
server.crConstant Summary
-
Log =
::Log.for("server")
Class Method Summary
-
.dispatch_request(request)
Dispatches the parsed JSON-RPC request to the appropriate handler.
-
.output : IO
The IO to write responses to.
-
.output=(output : IO)
The IO to write responses to.
-
.process_request(line : String)
Processes a single request line.
-
.run(config : Config = Config.new)
Starts the server and begins processing requests from standard input.
Class Method Detail
def self.dispatch_request(request)
#
Dispatches the parsed JSON-RPC request to the appropriate handler.
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.