ojob.io/httpServers/MCPRestd

Usage

ojob ojob.io/httpServers/MCPRestd mcps="[(name: math, cmd: 'ojob ai/mcps/mcp-math.yaml'), (name: time, type: remote, url: 'http://127.0.0.1:17879/mcp')]" port=8888 host= uri= token= keystore= pass= debug= 

Description

Starts a REST wrapper, with a generated OpenAPI 3.1 document, over one or more MCP servers given as $mcp() connection descriptors. Connections are opened lazily on first use, kept alive, and reconnected once on a transport failure. When 'token' is set every route on this port, including /healthz and /metrics, requires a "Bearer <token>" Authorization header.

Expects

Name Description
mcps JSSLON/JSON array (or single map) of $mcp() connection descriptors. Each descriptor may include an extra 'name' key used to namespace its routes (defaults to mcp0, mcp1, …). All $mcp() options are supported (type, url, cmd, pwd, envs, envsOnly, id, timeout, sse, strict, debug, shared, clientInfo, blacklist, options, auth, protocolVersion, capabilities).
port The port where the server should be made available (default is 8888)
host Optionally the interface where the server should be listening (default is all)
uri The base URI where the MCP REST API will be available (default is /mcp)
token If defined, requires a "Bearer <token>" Authorization header on every route on this port, including /healthz and /metrics (default is no authentication)
keystore Optionally to create a HTTPS server provide a keystore file
pass The password for the keystore of a HTTPS server
debug Default $mcp() debug flag applied to descriptors that don't set their own (default false)