Pure JSON-RPC 2.0 + MCP message construction. No I/O — the shell codec (boundary.mcp.shell.codec) owns JSON serialization.
Maps here use the exact JSON-RPC / MCP wire keys, including camelCase where the spec dictates (e.g. :protocolVersion, :serverInfo). This namespace IS the protocol boundary, so the wire schema is the representation; the usual kebab-case-internal rule does not apply to these protocol field names.
Pure JSON-RPC 2.0 + MCP message construction. No I/O — the shell codec (boundary.mcp.shell.codec) owns JSON serialization. Maps here use the exact JSON-RPC / MCP wire keys, including camelCase where the spec dictates (e.g. :protocolVersion, :serverInfo). This namespace IS the protocol boundary, so the wire schema is the representation; the usual kebab-case-internal rule does not apply to these protocol field names.
(error id code-key message)(error id code-key message data)Build a JSON-RPC error response. code-key is a key in error-codes (or a
raw integer code). data is optional extra context.
Build a JSON-RPC error response. `code-key` is a key in `error-codes` (or a raw integer code). `data` is optional extra context.
(negotiate-version requested)Resolve the protocol version for the handshake: echo the client's
requested version when supported, otherwise propose the server's
preferred. (An MCP client that cannot speak the proposed version disconnects
after initialize.)
Resolve the protocol version for the handshake: echo the client's `requested` version when supported, otherwise propose the server's preferred. (An MCP client that cannot speak the proposed version disconnects after `initialize`.)
(request? msg)A JSON-RPC request expects a response (carries an :id); a notification does not.
A JSON-RPC request expects a response (carries an :id); a notification does not.
(success id result)Build a JSON-RPC success response for request id with result payload.
Build a JSON-RPC success response for request `id` with `result` payload.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |