Documentation
¶
Overview ¶
Package dispatch aggregates tools of several worker Lambda functions into one MCP server. The dispatcher lists tools of workers once (at cold start) and forwards tools/call to the worker owning the tool through Lambda Invoke, together with the caller's TokenInfo. Each worker keeps its own IAM role (least privilege per tool), clients connect to the single endpoint.
Workers are Lambda functions running serve.Handler, e.g. serve.Tool.
Index ¶
Constants ¶
const ( // Comma separated names (or ARNs) of worker functions EnvWorkers = "CLOUDMCP_WORKERS" // Implementation name and version reported to clients EnvName = "CLOUDMCP_NAME" EnvVersion = "CLOUDMCP_VERSION" // CloudWatch namespace of metrics, metrics are disabled if empty EnvMetrics = "CLOUDMCP_METRICS" )
Environment variables of the dispatcher function (cmd/dispatcher).
Variables ¶
This section is empty.
Functions ¶
func New ¶
New lists tools of all workers and returns the MCP server forwarding tool calls to workers. Call it at cold start, the tools are listed once. Tool names must be unique across workers.
Workers list their tools without the caller's identity (TokenInfo is nil), use serve.Filter at the dispatcher to choose tools per caller.
Types ¶
type Config ¶
type Config struct {
// Implementation reported to clients (required)
Implementation *mcp.Implementation
// Options of the MCP server
Options *mcp.ServerOptions
// Names (or ARNs) of worker functions
Workers []string
// Lambda client
Client Invoker
}
Config of the dispatcher.