Documentation
¶
Overview ¶
Package server provides the MCP server implementation.
Index ¶
- type MCPServer
- func (s *MCPServer) AddTool(ctx context.Context, tool *types.Tool, handler ToolHandler) error
- func (s *MCPServer) GetAddress() string
- func (s *MCPServer) RegisterProvider(ctx context.Context, provider plugin.Provider) error
- func (s *MCPServer) ServeHTTP() error
- func (s *MCPServer) ServeStdio() error
- func (s *MCPServer) SetAddress(addr string)
- func (s *MCPServer) Shutdown(ctx context.Context) error
- func (s *MCPServer) UnregisterProvider(ctx context.Context, providerID string) error
- type ToolCallRequest
- type ToolHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MCPServer ¶
type MCPServer struct {
// contains filtered or unexported fields
}
MCPServer represents an MCP server that can be used to handle MCP protocol messages. It supports both static tool registration and dynamic provider-based tools.
func NewMCPServer ¶
NewMCPServer creates a new MCP server with the specified name and version.
func (*MCPServer) GetAddress ¶
GetAddress returns the HTTP address for the server.
func (*MCPServer) RegisterProvider ¶
RegisterProvider registers a tool provider with the server.
func (*MCPServer) ServeStdio ¶
ServeStdio serves the MCP server over standard I/O.
func (*MCPServer) SetAddress ¶
SetAddress sets the HTTP address for the server.
type ToolCallRequest ¶
type ToolCallRequest struct { Name string Parameters map[string]interface{} Session *types.ClientSession }
ToolCallRequest represents a request to execute a tool.
type ToolHandler ¶
type ToolHandler func(ctx context.Context, request ToolCallRequest) (interface{}, error)
ToolHandler is a function that handles tool calls.
Click to show internal directories.
Click to hide internal directories.