Client
An MCP client on top of a pluggable transport.
The client automatically performs the initialization handshake with the server when connect is called. After initialization, serverCapabilities and serverVersion provide details about the connected server.
You can extend this class with custom request/notification/result types if needed.
Parameters
Information about the client implementation (name, version).
Configuration options for this client.
Properties
Retrieves the server's reported capabilities after the initialization process completes.
Retrieves the server's reported version information after initialization.
Functions
Calls a tool on the server using a CallToolRequest object.
Calls a tool on the server by name, passing the specified arguments.
Sends a completion request to the server, typically to generate or complete some content.
Retrieves a prompt by name from the server.
Lists all available prompts from the server.
Lists all available resources from the server.
Lists resource templates available on the server.
Lists all available tools on the server.
Sends a ping request to the server to check connectivity.
Reads a resource from the server by its URI.
Removes a single root by URI.
Removes multiple roots at once.
Notifies the server that the list of roots has changed. Typically used if the client is managing some form of hierarchical structure.
Sets the elicitation handler.
Sets the logging level on the server.
Subscribes to resource changes on the server.
Unsubscribes from resource changes on the server.