Liking cljdoc? Tell your friends :D

com.blockether.vis.ext.foundation-mcp.client

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-toolclose.

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`.
raw docstring

alive?clj

(alive? conn)
source

call-toolclj

(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}`).
sourceraw docstring

closeclj

(close conn)
source

connectclj

(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.
sourceraw docstring

default-timeout-msclj

source

list-toolsclj

(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.
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