1.7 KiB
| id | title |
|---|---|
| MCPToolSource | MCPToolSource |
Interface: MCPToolSource
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).
Properties
close
close: () => Promise<void>;
Defined in: packages/ai/src/activities/chat/mcp/types.ts:30
Returns
Promise<void>
readResource?
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.
Parameters
uri
string
Returns
Promise<McpResourceReadResult>
tools
tools: (options?) => Promise<AnyServerTool[]>;
Defined in: packages/ai/src/activities/chat/mcp/types.ts:29
Parameters
options?
lazy?
boolean
Returns
Promise<AnyServerTool[]>