Rulvar API reference / @rulvar/core / McpConfig
Interface: McpConfig
Defined in: packages/core/src/tools/mcp.ts:23
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
allow? | string[] | Tool-name filter on ORIGINAL names; omitted = all. | packages/core/src/tools/mcp.ts:33 |
approval? | boolean | Record<string, boolean> | true = every imported tool needsApproval; record form is per name. | packages/core/src/tools/mcp.ts:39 |
args? | string[] | - | packages/core/src/tools/mcp.ts:27 |
command? | string | stdio: child process to spawn. | packages/core/src/tools/mcp.ts:26 |
deny? | string[] | Deny wins over allow (pre-prefix names). | packages/core/src/tools/mcp.ts:35 |
drift? | "rekey" | "refuse" | What a listChanged notification means for THIS source (RV1516). 'rekey' is the documented default: the session cache invalidates and subsequently spawned agents import the changed list under a new toolsetHash. 'refuse' fails closed instead: the notification poisons the source, every later tools() call refuses typed, and only close() (a deliberate host reset) clears it. In-flight spawn snapshots are untouched either way. Composes with the toolset attestation: refuse at the source vs refuse at the spawn. | packages/core/src/tools/mcp.ts:118 |
http? | { headers?: | Record<string, string> | (() => | Record<string, string> | Promise<Record<string, string>>); } | streamable-http only (RV1516): headers injected into EVERY wire request through a wrapped fetch. The hook form is awaited before each send, so it IS the refresh point: rotate a token in the hook and the next request carries it, with no reconnect and no library-invented 401 retry (transport failures surface exactly as before; the engine's RetryPolicy owns retries). | packages/core/src/tools/mcp.ts:104 |
http.headers? | | Record<string, string> | (() => | Record<string, string> | Promise<Record<string, string>>) | - | packages/core/src/tools/mcp.ts:105 |
maxPages? | number | Cap on tools/list PAGES fetched in one sweep (RV1602): a server paginating past it refuses typed, fail closed like maxTools (a truncated import would silently admit a subset of the declared surface). Bounds the sweep's WIRE CALL count where maxTools bounds its volume: unique cursors over empty pages grow neither the tool count nor any timeout (each page answers inside listMs), so only a page bound stops them. Positive integer; absent = unbounded. Independent of the unconditional cursor-echo cycle guard, which needs no configuration. | packages/core/src/tools/mcp.ts:61 |
maxSchemaBytes? | number | Per ADMITTED tool (allow/deny filter first): the UTF-8 byte length of the serialized inputSchema plus outputSchema when present (RV1515). An oversized tool refuses the resolution typed, naming the tool and its measured bytes; deny the tool or raise the cap. Positive integer; absent = unbounded. | packages/core/src/tools/mcp.ts:69 |
maxTools? | number | Cap on WIRE tools accepted from the tools/list sweep (RV1515), checked after each page, PRE-filter: the sweep itself is the resource being bounded, so allow/deny cannot admit past it. A server that streams more refuses typed. Positive integer; absent = unbounded (today's behavior). | packages/core/src/tools/mcp.ts:49 |
prefix? | string | Namespaces imported names as ${prefix}_${name}. | packages/core/src/tools/mcp.ts:37 |
requireBounds? | boolean | Demand the discovery bounds (RV1808): with requireBounds: true the source refuses at construction unless maxTools, maxPages, maxSchemaBytes, and timeouts.discoveryMs are ALL declared. The production posture: an unbounded discovery sweep against a remote registry is an availability decision someone should have made on purpose, so the flag turns the four absences into one typed error naming what is missing instead of four silent unboundeds. | packages/core/src/tools/mcp.ts:95 |
risk? | Record<string, ToolRisk> | Host-supplied risk labels for imported tools. | packages/core/src/tools/mcp.ts:41 |
server? | unknown | inprocess: in-memory server instance (anything with connect()). | packages/core/src/tools/mcp.ts:31 |
timeouts? | { callMs?: number; connectMs?: number; discoveryMs?: number; listMs?: number; } | Per-source latency bounds (RV1515). connectMs races the transport handshake (on expiry the client, and for stdio its child, is released and the refusal is typed). listMs and callMs ride the SDK request timeout per tools/list page and per tools/call; without them the SDK's own 60s default request timeout applies. A call timeout surfaces as the tool's error result, never past policy. discoveryMs (RV1808) is the WALL-CLOCK cap over one whole tools/list sweep, all pages included: per-page listMs cannot bound a server that answers every page promptly and paginates forever with unique cursors under maxPages' radar only when maxPages is set, and cannot bound a slow-but-under-listMs page crawl at all. On expiry the sweep refuses typed. Each a positive finite number of milliseconds. | packages/core/src/tools/mcp.ts:85 |
timeouts.callMs? | number | - | packages/core/src/tools/mcp.ts:85 |
timeouts.connectMs? | number | - | packages/core/src/tools/mcp.ts:85 |
timeouts.discoveryMs? | number | - | packages/core/src/tools/mcp.ts:85 |
timeouts.listMs? | number | - | packages/core/src/tools/mcp.ts:85 |
transport | "inprocess" | "stdio" | "streamable-http" | - | packages/core/src/tools/mcp.ts:24 |
url? | string | streamable-http: server endpoint. | packages/core/src/tools/mcp.ts:29 |