Documentation
¶
Index ¶
- Constants
- type AggregatedManifest
- type ClientCapabilities
- type ClientInfo
- type ClientSamplingCapability
- type ContentBlock
- type Error
- type Handler
- type HealthcheckCapability
- type InitializeParams
- type InitializeResult
- type MCPServerInstance
- func (m *MCPServerInstance) GetServer() *server.MCPServer
- func (m *MCPServerInstance) ServeSSE(addr string) error
- func (m *MCPServerInstance) ServeStdio() error
- func (m *MCPServerInstance) ServeStreamableHTTP(addr string) error
- func (m *MCPServerInstance) SetStdioPool(p *pool.StdioPool)
- func (m *MCPServerInstance) SetupGatewayTools()
- type ParamInfo
- type Prompt
- type PromptArgument
- type PromptsCapability
- type PromptsListParams
- type PromptsListResult
- type Request
- type Resource
- type ResourcesCapability
- type ResourcesListParams
- type ResourcesListResult
- type Response
- type RootsCapability
- type ServerCapabilities
- type ServerInfo
- type ServerSamplingCapability
- type Tool
- type ToolCache
- type ToolsCallParams
- type ToolsCallResult
- type ToolsCapability
- type ToolsListParams
- type ToolsListResult
Constants ¶
View Source
const ( MethodInitialize = "initialize" MethodInitialized = "notifications/initialized" MethodToolsList = "tools/list" MethodToolsCall = "tools/call" MethodSearchTools = "search_tools" MethodResourcesList = "resources/list" MethodResourcesRead = "resources/read" MethodPromptsList = "prompts/list" MethodPromptsGet = "prompts/get" MethodPing = "ping" MethodShutdown = "shutdown" )
View Source
const ( ErrCodeParseError = -32700 ErrCodeInvalidRequest = -32600 ErrCodeMethodNotFound = -32601 ErrCodeInvalidParams = -32602 ErrCodeInternalError = -32603 ErrCodeServerError = -32000 )
View Source
const JSONRPCVersion = "2.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedManifest ¶
type ClientCapabilities ¶
type ClientCapabilities struct {
Roots *RootsCapability `json:"roots,omitempty"`
Sampling *ClientSamplingCapability `json:"sampling,omitempty"`
}
type ClientInfo ¶
type ClientSamplingCapability ¶
type ClientSamplingCapability struct{}
type ContentBlock ¶
type Error ¶
type Error struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data,omitempty"`
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandlerWithToolStore ¶
func (*Handler) HandleRequest ¶
func (*Handler) ResetManifest ¶
func (h *Handler) ResetManifest()
type HealthcheckCapability ¶
type HealthcheckCapability struct{}
type InitializeParams ¶
type InitializeParams struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities ClientCapabilities `json:"capabilities"`
ClientInfo ClientInfo `json:"clientInfo"`
}
type InitializeResult ¶
type InitializeResult struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities ServerCapabilities `json:"capabilities"`
ServerInfo ServerInfo `json:"serverInfo"`
}
type MCPServerInstance ¶
type MCPServerInstance struct {
// contains filtered or unexported fields
}
func NewMCPServerInstance ¶
func NewMCPServerInstance(logger *slog.Logger) *MCPServerInstance
func (*MCPServerInstance) GetServer ¶
func (m *MCPServerInstance) GetServer() *server.MCPServer
func (*MCPServerInstance) ServeSSE ¶
func (m *MCPServerInstance) ServeSSE(addr string) error
func (*MCPServerInstance) ServeStdio ¶
func (m *MCPServerInstance) ServeStdio() error
func (*MCPServerInstance) ServeStreamableHTTP ¶
func (m *MCPServerInstance) ServeStreamableHTTP(addr string) error
func (*MCPServerInstance) SetStdioPool ¶
func (m *MCPServerInstance) SetStdioPool(p *pool.StdioPool)
func (*MCPServerInstance) SetupGatewayTools ¶
func (m *MCPServerInstance) SetupGatewayTools()
type Prompt ¶
type Prompt struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Arguments []PromptArgument `json:"arguments,omitempty"`
}
type PromptArgument ¶
type PromptsCapability ¶
type PromptsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
type PromptsListParams ¶
type PromptsListParams struct {
Cursor string `json:"cursor,omitempty"`
}
type PromptsListResult ¶
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
ID interface{} `json:"id"`
}
func (*Request) IsNotification ¶
type ResourcesCapability ¶
type ResourcesListParams ¶
type ResourcesListParams struct {
Cursor string `json:"cursor,omitempty"`
}
type ResourcesListResult ¶
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
Result json.RawMessage `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
ID interface{} `json:"id"`
}
type RootsCapability ¶
type RootsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
type ServerCapabilities ¶
type ServerCapabilities struct {
Tools *ToolsCapability `json:"tools,omitempty"`
Resources *ResourcesCapability `json:"resources,omitempty"`
Prompts *PromptsCapability `json:"prompts,omitempty"`
Sampling *ServerSamplingCapability `json:"sampling,omitempty"`
Health *HealthcheckCapability `json:"healthcheck,omitempty"`
}
type ServerInfo ¶
type ServerSamplingCapability ¶
type ServerSamplingCapability struct{}
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema json.RawMessage `json:"inputSchema"`
}
type ToolsCallParams ¶
type ToolsCallParams struct {
Name string `json:"name"`
Arguments json.RawMessage `json:"arguments,omitempty"`
}
type ToolsCallResult ¶
type ToolsCallResult struct {
Content []ContentBlock `json:"content"`
IsError bool `json:"isError,omitempty"`
}
type ToolsCapability ¶
type ToolsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
type ToolsListParams ¶
type ToolsListParams struct {
Cursor string `json:"cursor,omitempty"`
}
type ToolsListResult ¶
Click to show internal directories.
Click to hide internal directories.