McpClient
Namespace: Vercel.AI.Mcp
public static class McpClientLists MCP tools and adapts them to Tool.
Inheritance: object
Methods
Section titled “Methods”ConnectAsync(IMcpTransport, CancellationToken)
Section titled “ConnectAsync(IMcpTransport, CancellationToken)”public static Task<IReadOnlyList<Tool>> ConnectAsync(IMcpTransport transport, CancellationToken cancellationToken = default)Calls initialize, then tools/list.
Parameters
| Name | Type | Description |
|---|---|---|
transport |
IMcpTransport | |
cancellationToken |
CancellationToken |
Returns: Task<IReadOnlyList<Tool>>
ListToolsAsync(IMcpTransport, CancellationToken)
Section titled “ListToolsAsync(IMcpTransport, CancellationToken)”public static Task<IReadOnlyList<Tool>> ListToolsAsync(IMcpTransport transport, CancellationToken cancellationToken = default)Maps tools/list onto SDK tools. Execution calls tools/call.
Parameters
| Name | Type | Description |
|---|---|---|
transport |
IMcpTransport | |
cancellationToken |
CancellationToken |
Returns: Task<IReadOnlyList<Tool>>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product