Client
Note that the MCP.Client using the [Model Context Protocol Go SDK v1.5.0](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk@v1.5.0).
Methods
addEventListener
Adds a handler for the specified MCP.ServerEvents or MCP.Events event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.
Parameters
event
callback
callTool
Call a tool from the MCP server. https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk@v1.5.0/mcp#CallToolParams
Parameters
parameters
close
Closes the connection (over WebSocket) or connection attempt.
id
Returns the Client id.
listTools
List the tools available from the MCP server. https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk@v1.5.0/mcp#ListToolsParams
Parameters
parameters
removeEventListener
Removes a handler for the specified MCP.ServerEvents or MCP.Events event.
Parameters
event
callback
webSocketId
Returns the WebSocket id.