0
Fork 0
mirror of https://github.com/TanStack/ai.git synced 2026-11-16 19:38:41 +00:00
ai/docs/reference/interfaces/MCPToolSource.md
github-actions[bot] 5701bf5184
docs: regenerate API documentation (#1141)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-18 19:53:35 +02:00

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[]>