Documentation
¶
Index ¶
- type MCPClient
- type StdioMCPClient
- func (c *StdioMCPClient) CallTool(ctx context.Context, name string, arguments map[string]interface{}) (*mcp.CallToolResult, error)
- func (c *StdioMCPClient) Close() error
- func (c *StdioMCPClient) Complete(ctx context.Context, ref interface{}, argument mcp.CompleteArgument) (*mcp.CompleteResult, error)
- func (c *StdioMCPClient) GetPrompt(ctx context.Context, name string, arguments map[string]string) (*mcp.GetPromptResult, error)
- func (c *StdioMCPClient) Initialize(ctx context.Context, capabilities mcp.ClientCapabilities, ...) (*mcp.InitializeResult, error)
- func (c *StdioMCPClient) ListPrompts(ctx context.Context, cursor *string) (*mcp.ListPromptsResult, error)
- func (c *StdioMCPClient) ListResources(ctx context.Context, cursor *string) (*mcp.ListResourcesResult, error)
- func (c *StdioMCPClient) ListTools(ctx context.Context, cursor *string) (*mcp.ListToolsResult, error)
- func (c *StdioMCPClient) Ping(ctx context.Context) error
- func (c *StdioMCPClient) ReadResource(ctx context.Context, uri string) (*mcp.ReadResourceResult, error)
- func (c *StdioMCPClient) SetLevel(ctx context.Context, level mcp.LoggingLevel) error
- func (c *StdioMCPClient) Subscribe(ctx context.Context, uri string) error
- func (c *StdioMCPClient) Unsubscribe(ctx context.Context, uri string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MCPClient ¶
type MCPClient interface { // Initialize sends the initial connection request to the server Initialize( ctx context.Context, capabilities mcp.ClientCapabilities, clientInfo mcp.Implementation, protocolVersion string, ) (*mcp.InitializeResult, error) // Ping checks if the server is alive Ping(ctx context.Context) error // ListResources requests a list of available resources from the server ListResources( ctx context.Context, cursor *string, ) (*mcp.ListResourcesResult, error) // ReadResource reads a specific resource from the server ReadResource( ctx context.Context, uri string, ) (*mcp.ReadResourceResult, error) // Subscribe requests notifications for changes to a specific resource Subscribe(ctx context.Context, uri string) error // Unsubscribe cancels notifications for a specific resource Unsubscribe(ctx context.Context, uri string) error // ListPrompts requests a list of available prompts from the server ListPrompts( ctx context.Context, cursor *string, ) (*mcp.ListPromptsResult, error) // GetPrompt retrieves a specific prompt from the server GetPrompt( ctx context.Context, name string, arguments map[string]string, ) (*mcp.GetPromptResult, error) // ListTools requests a list of available tools from the server ListTools(ctx context.Context, cursor *string) (*mcp.ListToolsResult, error) // CallTool invokes a specific tool on the server CallTool( ctx context.Context, name string, arguments map[string]interface{}, ) (*mcp.CallToolResult, error) // SetLevel sets the logging level for the server SetLevel(ctx context.Context, level mcp.LoggingLevel) error // Complete requests completion options for a given argument Complete( ctx context.Context, ref interface{}, argument mcp.CompleteArgument, ) (*mcp.CompleteResult, error) }
Client represents an MCP client interface
type StdioMCPClient ¶
type StdioMCPClient struct {
// contains filtered or unexported fields
}
func NewStdioMCPClient ¶
func NewStdioMCPClient( command string, args ...string, ) (*StdioMCPClient, error)
func (*StdioMCPClient) CallTool ¶
func (c *StdioMCPClient) CallTool( ctx context.Context, name string, arguments map[string]interface{}, ) (*mcp.CallToolResult, error)
func (*StdioMCPClient) Close ¶
func (c *StdioMCPClient) Close() error
func (*StdioMCPClient) Complete ¶
func (c *StdioMCPClient) Complete( ctx context.Context, ref interface{}, argument mcp.CompleteArgument, ) (*mcp.CompleteResult, error)
func (*StdioMCPClient) GetPrompt ¶
func (c *StdioMCPClient) GetPrompt( ctx context.Context, name string, arguments map[string]string, ) (*mcp.GetPromptResult, error)
func (*StdioMCPClient) Initialize ¶
func (c *StdioMCPClient) Initialize( ctx context.Context, capabilities mcp.ClientCapabilities, clientInfo mcp.Implementation, protocolVersion string, ) (*mcp.InitializeResult, error)
func (*StdioMCPClient) ListPrompts ¶
func (c *StdioMCPClient) ListPrompts( ctx context.Context, cursor *string, ) (*mcp.ListPromptsResult, error)
func (*StdioMCPClient) ListResources ¶
func (c *StdioMCPClient) ListResources( ctx context.Context, cursor *string, ) (*mcp.ListResourcesResult, error)
func (*StdioMCPClient) ListTools ¶
func (c *StdioMCPClient) ListTools( ctx context.Context, cursor *string, ) (*mcp.ListToolsResult, error)
func (*StdioMCPClient) ReadResource ¶
func (c *StdioMCPClient) ReadResource( ctx context.Context, uri string, ) (*mcp.ReadResourceResult, error)
func (*StdioMCPClient) SetLevel ¶
func (c *StdioMCPClient) SetLevel( ctx context.Context, level mcp.LoggingLevel, ) error
func (*StdioMCPClient) Subscribe ¶
func (c *StdioMCPClient) Subscribe(ctx context.Context, uri string) error
func (*StdioMCPClient) Unsubscribe ¶
func (c *StdioMCPClient) Unsubscribe(ctx context.Context, uri string) error
Click to show internal directories.
Click to hide internal directories.