Skip to content

rulvar API reference


rulvar API reference / @rulvar/core / mcp

Function: mcp()

ts
function mcp(cfg): ToolSource;

Defined in: packages/core/src/tools/mcp.ts:135

Imports MCP tools as a ToolSource. The client connects lazily on the first tools() call; tools/list is fetched with cursor pagination until exhaustion and cached per session; a listChanged notification invalidates the cache, affecting subsequently spawned agents only (a spawn's toolset snapshot is immutable by construction).

Parameters

ParameterType
cfgMcpConfig

Returns

ToolSource