Liking cljdoc? Tell your friends :D

hyperphor.ellum.mcp_client


get-access-tokenclj

(get-access-token auth)

Returns a bearer token for auth (nil -> nil, unauthenticated request). A function auth is called with no args and trusted to return a token string, doing its own caching/refresh. Otherwise dispatches on :type: :bearer returns its static :token verbatim; :client-credentials mints one via the OAuth2 client-credentials grant and caches it (see token-cache), refreshing ~1min before expiry.

Returns a bearer token for `auth` (nil -> nil, unauthenticated request).
A function `auth` is called with no args and trusted to return a token
string, doing its own caching/refresh. Otherwise dispatches on :type:
:bearer returns its static :token verbatim; :client-credentials mints one
via the OAuth2 client-credentials grant and caches it (see token-cache),
refreshing ~1min before expiry.
sourceraw docstring

mcp-callclj

(mcp-call config tool-name)
(mcp-call config tool-name arguments)

Calls MCP tool tool-name with arguments (a map, default {}) via tools/call. Returns the unpacked result value - see unpack-tool-result.

Calls MCP tool `tool-name` with `arguments` (a map, default {}) via
tools/call. Returns the unpacked result value - see unpack-tool-result.
sourceraw docstring

mcp-postclj

(mcp-post config method)
(mcp-post config method params)

Sends a JSON-RPC method call (with optional params, default {}) to an MCP server, after ensuring the initialize handshake has run (see initialize!). config is either a bare URL string, or {:url ... :auth ...} - see get-access-token for :auth shapes. Throws ex-info on a non-2xx HTTP response or a JSON-RPC :error result; otherwise returns {:status :body}, :body the parsed {:jsonrpc :id :result ...} envelope.

Sends a JSON-RPC `method` call (with optional `params`, default {}) to
an MCP server, after ensuring the initialize handshake has run (see
initialize!). `config` is either a bare URL string, or {:url ... :auth
...} - see get-access-token for :auth shapes. Throws ex-info on a
non-2xx HTTP response or a JSON-RPC :error result; otherwise returns
{:status :body}, :body the parsed {:jsonrpc :id :result ...} envelope.
sourceraw docstring

mcp-toolsclj

(mcp-tools config)
source

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