Skip to content

McpToolProviderOptions

Defined in: packages/tools/src/mcp/provider.ts:44

Options for createMcpToolProvider.

Trust boundary: constructing this provider with a transport trusts that MCP server’s tools at the agent’s privilege level. This package does not sandbox remote MCP side effects. effectGate is the only pre-materialize policy hook (allow / deny / rewrite). Suspend is fail-closed unless the host wraps with parkingEffectGate. Requires ExtendedToolProviderContext.recordEffect so intents persist. Do not omit the gate; tests and permissive hosts pass import(“@agent-dev-lab/core”).allowAllGate explicitly.

optional callTimeoutMs?: number

Defined in: packages/tools/src/mcp/provider.ts:66

Bound on each tool call. Defaults to DEFAULT_MCP_CALL_TIMEOUT_MS.


effectGate: EffectGate

Defined in: packages/tools/src/mcp/provider.ts:60

Required. Pre-materialize gate for every MCP tool call. Pass allowAllGate explicitly for tests/CI — never an ambient omit→allow default.


optional initTimeoutMs?: number

Defined in: packages/tools/src/mcp/provider.ts:64

Bound on connecting and initialize. Defaults to DEFAULT_MCP_INIT_TIMEOUT_MS.


optional maxOutputBytes?: number

Defined in: packages/tools/src/mcp/provider.ts:71

Larger results are replaced by an error result the model can see. Defaults to DEFAULT_MCP_MAX_OUTPUT_BYTES.


optional name?: string

Defined in: packages/tools/src/mcp/provider.ts:75

Forwarded to createMCPClient (defaults apply in the AI SDK).


optional onUncaughtError?: (error) => void

Defined in: packages/tools/src/mcp/provider.ts:73

Forwarded to createMCPClient.

unknown

void


optional schemas?: ToolSchemas

Defined in: packages/tools/src/mcp/provider.ts:62

When set, forwarded to client.tools({ schemas }) (typed / filtered tool subset).


serverId: string

Defined in: packages/tools/src/mcp/provider.ts:50

Required. Stable id for this server ([A-Za-z0-9_-]+, e.g. "github"). Every intent carries source: "mcp:<serverId>", so gates and remembered approvals can tell this server’s search from another server’s search.


transport: MCPTransportConfig | MCPTransport

Defined in: packages/tools/src/mcp/provider.ts:55

Required. Connection to the MCP server — HTTP/SSE config object or an MCPTransport (e.g. Experimental_StdioMCPTransport from @ai-sdk/mcp/mcp-stdio). No ambient default.


optional version?: string

Defined in: packages/tools/src/mcp/provider.ts:77

Forwarded to createMCPClient (defaults apply in the AI SDK).