Expand description
The MCP engine client (spec/sync/README.md §6; the reference’s
McpEngineClient in @omgbase/sync): reaches “the omgbase side” over
the Model Context Protocol, so the Coordinator
runs unchanged against a remote engine, and the CLI’s --server mode
calls any catalog tool (spec/surface §4) and renders the result it
would have computed locally.
Two transports, one JSON-RPC 2.0 client on top:
- stdio — spawn a command (
omg mcp -C /vault,omgbase mcp …) and speak newline-delimited JSON-RPC over its stdin/stdout (the framing ofomgbase mcpand of the SDK’sStdioServerTransport); stderr is inherited. - Streamable HTTP (feature
http) —POSTeach message to the URL withAccept: application/json, text/event-stream, read the reply from a JSON body or an SSE stream, round-tripMcp-Session-Id, and sendMCP-Protocol-Versiononce negotiated; extra headers ride on every request (auth beyond a secret path);DELETEends the session.
The one rule for a --server value lives in parse_engine_spec: an
http(s):// value is an HTTP endpoint (used verbatim, base path and
all), anything else is whitespace-split and spawned — a URL is never
spawned. Synchronous like the rest of the crate: one request in flight,
a bounded wait per reply.
Structs§
- McpEngine
Client - A connected MCP client:
initializedone, ready fortools/call. - Tool
Result - One
tools/calloutcome: the JSON the tool’s text content held, and whether the server flagged it (isError; the body is then the error envelope ofspec/surface§4 —{ error, message, data?, retriable }).
Enums§
- Engine
Spec - Where a
--servervalue points.
Constants§
- CLIENT_
NAME clientInfo.name(the reference’s).- DEFAULT_
TIMEOUT - How long one request may wait for its reply (the SDK’s default request timeout).
- PROTOCOL_
VERSION - The MCP protocol revision this client proposes in
initialize(the server may answer with the one it speaks; the reply is what is sent asMCP-Protocol-Versionafterwards).
Functions§
- is_
http_ url - Whether
sstarts withhttp://orhttps://(case-insensitive). - parse_
engine_ spec - Classify a raw
--servervalue (the reference’sparseEngineSpec): anhttp(s)://value is an HTTP endpoint (verbatim;headersride along); anything else is split on whitespace and spawned. Errors: an empty value, or headers for a command (they have nowhere to go).