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.
Properties
Section titled “Properties”callTimeoutMs?
Section titled “callTimeoutMs?”
optionalcallTimeoutMs?:number
Defined in: packages/tools/src/mcp/provider.ts:66
Bound on each tool call. Defaults to DEFAULT_MCP_CALL_TIMEOUT_MS.
effectGate
Section titled “effectGate”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.
initTimeoutMs?
Section titled “initTimeoutMs?”
optionalinitTimeoutMs?:number
Defined in: packages/tools/src/mcp/provider.ts:64
Bound on connecting and initialize. Defaults to DEFAULT_MCP_INIT_TIMEOUT_MS.
maxOutputBytes?
Section titled “maxOutputBytes?”
optionalmaxOutputBytes?: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.
optionalname?:string
Defined in: packages/tools/src/mcp/provider.ts:75
Forwarded to createMCPClient (defaults apply in the AI SDK).
onUncaughtError?
Section titled “onUncaughtError?”
optionalonUncaughtError?: (error) =>void
Defined in: packages/tools/src/mcp/provider.ts:73
Forwarded to createMCPClient.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void
schemas?
Section titled “schemas?”
optionalschemas?:ToolSchemas
Defined in: packages/tools/src/mcp/provider.ts:62
When set, forwarded to client.tools({ schemas }) (typed / filtered tool subset).
serverId
Section titled “serverId”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
Section titled “transport”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.
version?
Section titled “version?”
optionalversion?:string
Defined in: packages/tools/src/mcp/provider.ts:77
Forwarded to createMCPClient (defaults apply in the AI SDK).