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
PandoTools []llmtools.BaseTool // Optional native Pando tools exposed as MCP tools
// Token is the bearer token required on "Authorization: Bearer <token>"
// for every HTTP request except /health. Empty means the HTTP transport is
// unauthenticated (existing embedded-server deployments that never set a
// token keep their current behavior); the pando mcp-server command never
// leaves this empty, generating one when none is configured (see
// cmd/mcp_server.go).
Token string
// AllowedOrigins is the browser-origin CORS allow-list. An empty (or nil)
// list is the safe default: no Access-Control-* headers are emitted and a
// preflight OPTIONS is refused with 403, since loopback Go/CLI clients are
// not browsers and send no Origin header at all. A configured origin still
// has to authenticate with the bearer token: this list only decides which
// pages are allowed to *attempt* a call, never a substitute for Token.
AllowedOrigins []string
}
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.