Skip to content
Sign in

mcp-client

v0.2.0

MCP client. Connects to Streamable HTTP and stdio MCP servers and registers their tools, resources and prompts as iii functions (mcp::<server>::<tool>). Authenticates with an API key, client credentials or a browser sign-in, reads credentials from the secrets worker, and adds an MCP client page to the console.

license: Apache-2.0integrationlinearmcpoauthtools

Install

bash
iii call compose::add worker=mcp-client@next

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Functions15

mcp-client::config::validate

Function

Check a candidate mcpServers map without changing anything: errors and warnings per server, the fingerprint an approval would cover, and what approving would run or send.

Request
  • mcpServersobjectrequired

    The candidate map, keyed by server name, as the entry would store it.

Response
  • serversobjectrequired

mcp-client::configuration-id

Function

Returns this worker instance's effective configuration entry ID, without its value.

Request
Empty object
Response
  • idstringrequired

mcp-client::login::cancel

Function

Drop the pending sign-in of an MCP server; nothing pending is not an error.

Request
  • serverstringrequired
Response
Empty object

mcp-client::login::complete

Function

Finish a sign-in with the whole address the browser ended on; the server is found from that address, then connected.

Request
  • callback_urlstringrequired

    The whole address the browser ended on after the sign-in.

Response
  • serverstringrequired

    The server the sign-in was started for.

  • statestringrequiredenum disabled, config_error, unapproved, connecting, ready, unavailable, …

mcp-client::login::sign-out

Function

Sign an MCP server out: its session ends and is cleared from the vault; its functions stay registered and answer that a sign-in is required.

Request
  • serverstringrequired
Response
  • statestringrequiredenum disabled, config_error, unapproved, connecting, ready, unavailable, …

mcp-client::login::start

Function

Start the sign-in of an MCP server that asks for one: the authorize URL to open in a browser, the redirect URI and when the sign-in expires. Starting again replaces the pending one.

Request
  • serverstringrequired
Response
  • authorize_urlstringrequired
  • expires_atinteger· uint64requiredmin 0

    Unix milliseconds.

  • redirect_uristringrequired

mcp-client::oauth-callback

Function

Internal: the sign-in callback route on the http worker; finishes the sign-in the address's state started and answers one static page.

Request
  • query_paramsobject
Response
  • bodystringrequired
  • headersobjectrequired
  • status_codeinteger· uint16requiredmin 0

mcp-client::on-config-change

Function

Internal: reload the MCP server list from the configuration entry on change.

Request
  • idstring

    Configuration id that changed.

Response
  • okbooleanrequired

mcp-client::on-secret-change

Function

Internal: reconnect the MCP servers that send a secret:// or env:// value that was set, rotated or deleted.

Request
  • activation_idstringrequired
  • callerany of
    any of (2)
    Variant 1
    • function_idstring

      The handler the call was made from; absent for a top-level call.

    • invocation_idstring
    • parentany of

      The caller of that handler, one level only.

      Show 2 nested
      any of (2)
      Variant 1
      • function_idstring
      • invocation_idstring
      • worker_idstring
      • worker_namestring
      Variant 2
      valuenull
    • worker_idstring
    • worker_namestring
    Variant 2
    valuenull
  • duration_msnumber· doublerequired
  • errorany of
    any of (2)
    Variant 1
    • codestringrequired
    • messagestringrequired
    Variant 2
    valuenull
  • function_idstringrequired
  • inputunknown
  • invocation_idstringrequired
  • metadataunknown
  • namespacestring
  • observer_idstringrequired
  • outputany of
    any of (2)
    Variant 1
    • actionstring
    • namestring
    • refstring
    Variant 2
    valuenull
  • started_at_msinteger· uint64requiredmin 0
  • statusstringrequiredenum success, error
Response
  • okbooleanrequired

mcp-client::on-servers-changed

Function

Private: called by this worker when a server's state, tools, process, sign-in or stderr changes. Observe it to follow the MCP client page.

Request
  • kindstringrequiredenum state, tools, process, login, stderr
  • serverstringrequired
Response
  • kindstringrequiredenum state, tools, process, login, stderr
  • serverstringrequired

mcp-client::process::logs

Function

The last 500 stderr lines of a stdio MCP server, with its secrets redacted, and how many older lines were dropped. An http server has none.

Request
  • serverstringrequired
Response
  • droppedinteger· uint64requiredmin 0

    Lines pushed out of the ring.

  • linesobject[]required
    • textstringrequired
    • tsinteger· uint64requiredmin 0

mcp-client::servers::approve

Function

Approve an MCP server entry: the given fingerprint (from mcp-client::config::validate), else the entry as loaded. Only an approved entry runs.

Request
  • fingerprintstring

    The fingerprint `config::validate` gave for the entry; without it, the entry as loaded.

  • serverstringrequired
Response
  • approvedbooleanrequired

mcp-client::servers::list

Function

Every configured MCP server: its state, the step it is at or stopped at, its error and the functions it registered. Never returns a token.

Request
Empty object
Response
  • callback_urlstringrequired
  • serversobject[]required
    • approvedbooleanrequired
    • authstringrequired
    • capabilitiesobjectrequired
      • promptsbooleanrequired
      • resourcesbooleanrequired
    • errorany of
      any of (2)
      Variant 1
      • codestringrequiredenum invalid_config, stdio_disabled, unapproved, secret_missing, secret_not_shared, spawn_failed, …
      • messagestringrequired
      Variant 2
      valuenull
    • fingerprintstringrequired
    • has_instructionsbooleanrequired
    • list_errorsobjectrequired
      • promptsstring
      • templatesstring
    • loginany of
      any of (2)
      Variant 1
      • expires_atinteger· uint64requiredmin 0
      • pendingbooleanrequired
      Variant 2
      valuenull
    • namestringrequired
    • processany of
      any of (2)
      Variant 1
      • last_exitany of
        Show 2 nested
        any of (2)
        Variant 1
        • codeinteger· int32
        • signalinteger· int32
        Variant 2
        valuenull
      • next_restart_atinteger· uint64min 0
      • pidinteger· uint32min 0
      • restart_budgetinteger· uint32requiredmin 0
      • restartsinteger· uint32requiredmin 0
      • started_atinteger· uint64min 0
      Variant 2
      valuenull
    • promptsobject[]required
      • argumentsinteger· uint32requiredmin 0
      • function_idstringrequired
      • namestringrequired
      • registeredbooleanrequired
      • requiredinteger· uint32requiredmin 0
      • titlestring
    • protocol_versionstring
    • resource_functionsobject[]required
      • function_idstringrequired
      • namestringrequired

        `list`, `read` or `templates`.

      • registeredbooleanrequired
    • server_infoany of
      any of (2)
      Variant 1
      • namestringrequired
      • titlestring
      • versionstringrequired
      Variant 2
      valuenull
    • sinceinteger· uint64requiredmin 0

      Unix milliseconds of the last state change.

    • skippedobject[]required
      • kindstringrequiredenum tool, prompt
      • namestringrequired
      • reasonstringrequired
    • stageany of
      any of (2)
      Variant 1
      valuestringenum config, approval, secret, connect, authorize, tools
      Variant 2
      valuenull
    • statestringrequiredenum disabled, config_error, unapproved, connecting, ready, unavailable, …
    • targetstringrequired
    • toolsobject[]required
      • annotationsunknown
      • function_idstringrequired
      • namestringrequired
      • registeredbooleanrequired
    • tools_listedbooleanrequired
    • transportstringrequired

      `http` or `stdio`.

  • stdio_enabledbooleanrequired

mcp-client::servers::reconnect

Function

Connect an MCP server again now, with a fresh backoff. A disabled, unapproved or invalid entry is returned as it is.

Request
  • serverstringrequired
Response
  • statestringrequiredenum disabled, config_error, unapproved, connecting, ready, unavailable, …

mcp-client::ui-content

Function

Serve the mcp-client worker's injected console UI assets (the target of its ade::ui::asset observers; the console calls it through each asset's observer with {path}).

Request
  • pathstringrequired

    The asset path from the observer's args (e.g. `state/page.js`).

Response
  • contentstringrequired

    The asset source, verbatim.

  • content_typestringrequired

    MIME type the console should serve the asset with.

Search the registry

Find workers, kits and executables, or jump to a page.