Liking cljdoc? Tell your friends :D
Clojure only.

vaelii.agents.mcp.transport

MCP JSON-RPC 2.0 transport over stdio.

Reads newline-delimited JSON-RPC messages from stdin, dispatches them through the transport-neutral dispatcher, and writes JSON-RPC responses to stdout. Stderr is reserved for server-side logging.

This transport owns:

  • Reading bytes from stdin, writing bytes to stdout
  • Parsing/serializing JSON
  • Authentication (token extraction from initialize or env var)

This transport does NOT own:

  • MCP method routing (dispatcher's job)
  • Session/verb semantics (dispatcher's job)
  • HTTP concepts (Streamable HTTP adapter is separate)
MCP JSON-RPC 2.0 transport over stdio.

Reads newline-delimited JSON-RPC messages from stdin, dispatches them
through the transport-neutral dispatcher, and writes JSON-RPC responses
to stdout.  Stderr is reserved for server-side logging.

This transport owns:
  - Reading bytes from stdin, writing bytes to stdout
  - Parsing/serializing JSON
  - Authentication (token extraction from initialize or env var)

This transport does NOT own:
  - MCP method routing (dispatcher's job)
  - Session/verb semantics (dispatcher's job)
  - HTTP concepts (Streamable HTTP adapter is separate)
raw docstring

start-stdio!clj

(start-stdio! session-atom _config auth-fn)

Start the stdio MCP transport. Reads JSON-RPC from stdin, dispatches through the transport-neutral dispatcher, writes to stdout. Blocks until stdin closes.

session-atom holds the authenticated session map (set during init or by the caller before starting the loop).

config is the server config map (unused by stdio transport directly, retained for API compatibility).

auth-fn is a function (raw-token → session-map | nil).

Start the stdio MCP transport.  Reads JSON-RPC from stdin, dispatches
through the transport-neutral dispatcher, writes to stdout.  Blocks until
stdin closes.

`session-atom` holds the authenticated session map (set during init or
by the caller before starting the loop).

`config` is the server config map (unused by stdio transport directly,
retained for API compatibility).

`auth-fn` is a function (raw-token → session-map | nil).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close