Minimal Model Context Protocol (MCP) client. Speaks JSON-RPC 2.0 over two transports:
:stdio — spawn the server process and frame newline-delimited JSON-RPC on
its stdin/stdout (the dominant local-server pattern).
:http — Streamable HTTP: POST each JSON-RPC message to one endpoint; the
reply is either application/json (one response) or
text/event-stream (SSE) — both handled. The Mcp-Session-Id
handed back by initialize rides on every later request.
A conn is a plain map of closures + state; the extension treats it
opaquely. Lifecycle: connect (which performs the initialize handshake) →
list-tools / call-tool → close.
Minimal Model Context Protocol (MCP) client. Speaks JSON-RPC 2.0 over two
transports:
:stdio — spawn the server process and frame newline-delimited JSON-RPC on
its stdin/stdout (the dominant local-server pattern).
:http — Streamable HTTP: POST each JSON-RPC message to one endpoint; the
reply is either `application/json` (one response) or
`text/event-stream` (SSE) — both handled. The `Mcp-Session-Id`
handed back by `initialize` rides on every later request.
A `conn` is a plain map of closures + state; the extension treats it
opaquely. Lifecycle: `connect` (which performs the `initialize` handshake) →
`list-tools` / `call-tool` → `close`.(call-tool conn tool-name arguments)(call-tool conn tool-name arguments timeout-ms)tools/call tool-name with arguments (a map). Returns the result map
({"content" [...] "isError" bool}).
`tools/call` `tool-name` with `arguments` (a map). Returns the result map
(`{"content" [...] "isError" bool}`).(connect name spec)Connect to MCP server name per its spec and run the initialize
handshake. spec is {:transport :stdio|:http ...}:
stdio → {:command "npx" :args [...] :env {...} :cwd "..."}
http → {:url "https://..." :headers {...}}
Returns a conn map (opaque) or throws.
Connect to MCP server `name` per its `spec` and run the `initialize`
handshake. `spec` is `{:transport :stdio|:http ...}`:
stdio → `{:command "npx" :args [...] :env {...} :cwd "..."}`
http → `{:url "https://..." :headers {...}}`
Returns a `conn` map (opaque) or throws.(list-tools conn)tools/list → vector of tool maps {"name" "description" "inputSchema"}.
Cached on the conn after the first call.
`tools/list` → vector of tool maps `{"name" "description" "inputSchema"}`.
Cached on the conn after the first call.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 |