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, getServerCapabilities and getServerVersion 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
A handler to invoke for any notification types that do not have their own handler installed.
A handler to invoke for any request types that do not have their own handler installed.
Functions
A method to check if a capability is supported by the remote side, for the given method to be called.
A method to check if a request handler is supported by the local side, for the given method to be handled.
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.
Retrieves the server's reported capabilities after the initialization process completes.
Retrieves the server's reported version information after initialization.
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.
Emits a notification, which is a one-way message that does not expect a response.
Sends a ping request to the server to check connectivity.
Reads a resource from the server by its URI.
Removes the notification handler for the given method.
Removes the request handler for the given method.
Sends a request and wait for a response.
Notifies the server that the list of roots has changed. Typically used if the client is managing some form of hierarchical structure.
Sets the logging level on the server.
Registers a handler to invoke when this protocol object receives a notification with the given method.
Registers a handler to invoke when this protocol object receives a request with the given method.
Subscribes to resource changes on the server.
Unsubscribes from resource changes on the server.