Documentation
¶
Overview ¶
Package server implements the MCP server with HTTP Streamable and stdio transports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACPHandler ¶ added in v0.7.0
type ACPHandler struct {
// contains filtered or unexported fields
}
ACPHandler integrates ACP transport with the Mesnada server.
func NewACPHandler ¶ added in v0.7.0
func NewACPHandler(cfg ACPHandlerConfig) *ACPHandler
NewACPHandler creates a new ACP handler for the Mesnada server.
func (*ACPHandler) GetAgent ¶ added in v0.7.0
func (h *ACPHandler) GetAgent() acp.ACPAgent
GetAgent returns the underlying ACP agent.
func (*ACPHandler) GetTransport ¶ added in v0.7.0
func (h *ACPHandler) GetTransport() *acp.HTTPTransport
GetTransport returns the underlying HTTP transport.
func (*ACPHandler) RegisterRoutes ¶ added in v0.7.0
func (h *ACPHandler) RegisterRoutes(mux *http.ServeMux)
RegisterRoutes registers ACP endpoints on the HTTP mux.
func (*ACPHandler) StartCleanup ¶ added in v0.7.0
func (h *ACPHandler) StartCleanup(ctx context.Context)
StartCleanup starts the background cleanup goroutine.
type ACPHandlerConfig ¶ added in v0.7.0
ACPHandlerConfig holds configuration for the ACP handler.
type Config ¶
type Config struct {
Addr string
Orchestrator *orchestrator.Orchestrator
Version string
Commit string
UseStdio bool
AppConfig *config.Config
ACPHandler *ACPHandler // Optional ACP handler for remote connections
Remembrances *rag.RemembrancesService // Optional remembrances service
}
Config holds server configuration.
type JSONRPCError ¶
type JSONRPCError struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
JSONRPCError represents a JSON-RPC 2.0 error.
type JSONRPCRequest ¶
type JSONRPCRequest struct {
JSONRPC string `json:"jsonrpc"`
ID interface{} `json:"id,omitempty"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
JSONRPCRequest represents a JSON-RPC 2.0 request.
type JSONRPCResponse ¶
type JSONRPCResponse struct {
JSONRPC string `json:"jsonrpc"`
ID interface{} `json:"id,omitempty"`
Result interface{} `json:"result,omitempty"`
Error *JSONRPCError `json:"error,omitempty"`
}
JSONRPCResponse represents a JSON-RPC 2.0 response.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the MCP HTTP Streamable and stdio server.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema map[string]interface{} `json:"inputSchema"`
}
Tool represents an MCP tool definition.
type ToolHandler ¶
type ToolHandler func(ctx context.Context, params json.RawMessage) (interface{}, error)
ToolHandler handles a tool call.