Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
Method string `json:"method"`
Params json.RawMessage `json:"params"`
}
Request represents a JSON-RPC style request with a method and optional params.
type Response ¶
type Response struct {
Result interface{} `json:"result,omitempty"`
Error string `json:"error,omitempty"`
}
Response represents a JSON-RPC style response.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a basic MCP server that manages tools and routes requests.
func (*Server) HandleRequest ¶
HandleRequest routes a request to the appropriate handler based on method.
func (*Server) RegisterTool ¶
RegisterTool adds a tool to the server's registry.
type Tool ¶
type Tool struct {
Name string
Description string
Handler func(params json.RawMessage) (json.RawMessage, error)
}
Tool represents an MCP tool with a name, description, and handler function.
Click to show internal directories.
Click to hide internal directories.