Defined in: packages/ai/src/activities/chat/mcp/types.ts:25
Minimal structural shape that chat({ mcp }) needs from an MCP client.
@tanstack/ai-mcp's MCPClient and MCPClients satisfy this interface by shape — the core @tanstack/ai package does NOT import @tanstack/ai-mcp (ai-mcp depends on ai, not the reverse).
close: () => Promise<void>;Defined in: packages/ai/src/activities/chat/mcp/types.ts:30
Promise<void>
optional readResource: (uri) => Promise<McpResourceReadResult>;Defined in: packages/ai/src/activities/chat/mcp/types.ts:38
Reads an MCP resource by URI. Used by the chat manager to eagerly fetch ui:// resource widgets (MCP Apps) after a tool result resolves.
Optional — sources that do not serve ui:// resources need not implement this method. ai-mcp's MCPClient satisfies this structurally.
string
Promise<McpResourceReadResult>
tools: (options?) => Promise<ServerTool<SchemaInput, SchemaInput, string, unknown>[]>;Defined in: packages/ai/src/activities/chat/mcp/types.ts:29
boolean
Promise<ServerTool<SchemaInput, SchemaInput, string, unknown>[]>