Documentation
¶
Index ¶
- type MCPClient
- type SSEMCPClient
- func (c *SSEMCPClient) CallTool(ctx context.Context, name string, arguments map[string]interface{}) (*mcp.CallToolResult, error)
- func (c *SSEMCPClient) Close() error
- func (c *SSEMCPClient) Complete(ctx context.Context, ref interface{}, argument mcp.CompleteArgument) (*mcp.CompleteResult, error)
- func (c *SSEMCPClient) GetEndpoint() *url.URL
- func (c *SSEMCPClient) GetPrompt(ctx context.Context, name string, arguments map[string]string) (*mcp.GetPromptResult, error)
- func (c *SSEMCPClient) Initialize(ctx context.Context, capabilities mcp.ClientCapabilities, ...) (*mcp.InitializeResult, error)
- func (c *SSEMCPClient) ListPrompts(ctx context.Context, cursor *string) (*mcp.ListPromptsResult, error)
- func (c *SSEMCPClient) ListResources(ctx context.Context, cursor *string) (*mcp.ListResourcesResult, error)
- func (c *SSEMCPClient) ListTools(ctx context.Context, cursor *string) (*mcp.ListToolsResult, error)
- func (c *SSEMCPClient) Ping(ctx context.Context) error
- func (c *SSEMCPClient) ReadResource(ctx context.Context, uri string) (*mcp.ReadResourceResult, error)
- func (c *SSEMCPClient) SetLevel(ctx context.Context, level mcp.LoggingLevel) error
- func (c *SSEMCPClient) Start(ctx context.Context) error
- func (c *SSEMCPClient) Subscribe(ctx context.Context, uri string) error
- func (c *SSEMCPClient) Unsubscribe(ctx context.Context, uri string) error
- 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 SSEMCPClient ¶ added in v0.2.0
type SSEMCPClient struct {
// contains filtered or unexported fields
}
func NewSSEMCPClient ¶ added in v0.2.0
func NewSSEMCPClient(baseURL string) (*SSEMCPClient, error)
func (*SSEMCPClient) CallTool ¶ added in v0.2.0
func (c *SSEMCPClient) CallTool( ctx context.Context, name string, arguments map[string]interface{}, ) (*mcp.CallToolResult, error)
func (*SSEMCPClient) Close ¶ added in v0.2.0
func (c *SSEMCPClient) Close() error
func (*SSEMCPClient) Complete ¶ added in v0.2.0
func (c *SSEMCPClient) Complete( ctx context.Context, ref interface{}, argument mcp.CompleteArgument, ) (*mcp.CompleteResult, error)
func (*SSEMCPClient) GetEndpoint ¶ added in v0.2.0
func (c *SSEMCPClient) GetEndpoint() *url.URL
func (*SSEMCPClient) GetPrompt ¶ added in v0.2.0
func (c *SSEMCPClient) GetPrompt( ctx context.Context, name string, arguments map[string]string, ) (*mcp.GetPromptResult, error)
func (*SSEMCPClient) Initialize ¶ added in v0.2.0
func (c *SSEMCPClient) Initialize( ctx context.Context, capabilities mcp.ClientCapabilities, clientInfo mcp.Implementation, protocolVersion string, ) (*mcp.InitializeResult, error)
func (*SSEMCPClient) ListPrompts ¶ added in v0.2.0
func (c *SSEMCPClient) ListPrompts( ctx context.Context, cursor *string, ) (*mcp.ListPromptsResult, error)
func (*SSEMCPClient) ListResources ¶ added in v0.2.0
func (c *SSEMCPClient) ListResources( ctx context.Context, cursor *string, ) (*mcp.ListResourcesResult, error)
func (*SSEMCPClient) ListTools ¶ added in v0.2.0
func (c *SSEMCPClient) ListTools( ctx context.Context, cursor *string, ) (*mcp.ListToolsResult, error)
func (*SSEMCPClient) ReadResource ¶ added in v0.2.0
func (c *SSEMCPClient) ReadResource( ctx context.Context, uri string, ) (*mcp.ReadResourceResult, error)
func (*SSEMCPClient) SetLevel ¶ added in v0.2.0
func (c *SSEMCPClient) SetLevel( ctx context.Context, level mcp.LoggingLevel, ) error
func (*SSEMCPClient) Start ¶ added in v0.2.0
func (c *SSEMCPClient) Start(ctx context.Context) error
func (*SSEMCPClient) Subscribe ¶ added in v0.2.0
func (c *SSEMCPClient) Subscribe(ctx context.Context, uri string) error
func (*SSEMCPClient) Unsubscribe ¶ added in v0.2.0
func (c *SSEMCPClient) Unsubscribe(ctx context.Context, uri string) error
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.