Documentation
¶
Overview ¶
pkg/protocol/protocol.go
Index ¶
- func ValidateCapabilities(serverCapabilities MCPCapabilities, requiredCapabilities []string) error
- type InitializeRequest
- type InitializeResponse
- type LoggingCapability
- type MCPCapabilities
- type MCPError
- type MCPNotification
- type MCPRequest
- type MCPResponse
- type PromptsCapability
- type ResourcesCapability
- type SamplingCapability
- type ToolsCapability
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateCapabilities ¶
func ValidateCapabilities(serverCapabilities MCPCapabilities, requiredCapabilities []string) error
ValidateCapabilities checks if the server capabilities match the given capabilities
Types ¶
type InitializeRequest ¶
type InitializeRequest struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities MCPCapabilities `json:"capabilities"`
ClientInfo struct {
Name string `json:"name"`
Version string `json:"version"`
} `json:"clientInfo"`
}
InitializeRequest represents an initialize request
type InitializeResponse ¶
type InitializeResponse struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities MCPCapabilities `json:"capabilities"`
ServerInfo struct {
Name string `json:"name"`
Version string `json:"version"`
} `json:"serverInfo"`
Instructions string `json:"instructions,omitempty"`
}
InitializeResponse represents an initialize response
type LoggingCapability ¶
type LoggingCapability struct {
}
LoggingCapability represents logging capability
type MCPCapabilities ¶
type MCPCapabilities struct {
Resources *ResourcesCapability `json:"resources,omitempty"`
Tools *ToolsCapability `json:"tools,omitempty"`
Prompts *PromptsCapability `json:"prompts,omitempty"`
Sampling *SamplingCapability `json:"sampling,omitempty"`
Logging *LoggingCapability `json:"logging,omitempty"`
}
MCPCapabilities represents MCP capabilities
type MCPError ¶
type MCPError struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data,omitempty"`
}
MCPError represents an MCP error
type MCPNotification ¶
type MCPNotification struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
MCPNotification represents an MCP notification
type MCPRequest ¶
type MCPRequest struct {
JSONRPC string `json:"jsonrpc"`
ID interface{} `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
MCPRequest represents an MCP request
type MCPResponse ¶
type MCPResponse struct {
JSONRPC string `json:"jsonrpc"`
ID interface{} `json:"id"`
Result json.RawMessage `json:"result,omitempty"`
Error *MCPError `json:"error,omitempty"`
}
MCPResponse represents an MCP response
type PromptsCapability ¶
type PromptsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
PromptsCapability represents prompts capability
type ResourcesCapability ¶
type ResourcesCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
Subscribe bool `json:"subscribe,omitempty"`
}
ResourcesCapability represents resources capability
type SamplingCapability ¶
type SamplingCapability struct {
}
SamplingCapability represents sampling capability
type ToolsCapability ¶
type ToolsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
ToolsCapability represents tools capability