Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseClient ¶
type BaseClient struct {
// contains filtered or unexported fields
}
BaseClient provides common functionality for MCP clients
func (*BaseClient) ListToolsWithTransport ¶
func (c *BaseClient) ListToolsWithTransport(ctx context.Context, transport interface { SendRequest(ctx context.Context, method string, params interface{}) (*types.Response, error) }) ([]types.Tool, error)
ListToolsWithTransport implements the common logic for listing tools across different transports
type Client ¶
type Client interface { // Initialize sends the initialization request to the server Initialize(ctx context.Context) error // ListTools returns a list of available tools ListTools(ctx context.Context) ([]types.Tool, error) // ExecuteTool executes a tool with the given parameters ExecuteTool(ctx context.Context, call types.ToolCall) (*types.ToolResult, error) // ListResources returns a list of available resources ListResources(ctx context.Context) ([]types.Resource, error) // GetResourceTemplates returns a list of available resource templates GetResourceTemplates(ctx context.Context) ([]types.Resource, error) // ApplyResourceTemplate applies a resource template with the given parameters ApplyResourceTemplate(ctx context.Context, template types.ResourceTemplate) (*types.ResourceTemplateResult, error) // Close shuts down the client and cleans up resources Close() error }
Client represents an MCP client
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents an MCP session
func NewSession ¶
NewSession creates a new session with the given reader, writer, and client
func (*Session) ExecuteTool ¶
ExecuteTool executes a tool with the given parameters
Click to show internal directories.
Click to hide internal directories.