Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToolPrefix ¶
ToolPrefix namespaces every tool of one server: MCP_<server>_.
Types ¶
type CallResult ¶
CallResult is a tools/call result flattened to text. IsError marks a failure the tool reported in its result rather than as a JSON-RPC error.
type Client ¶
type Client interface {
// Discover checks the server is up and speaks our protocol version. It is
// the liveness probe.
Discover(ctx context.Context) error
// ListTools returns every tool the server advertises.
ListTools(ctx context.Context) ([]Tool, error)
// CallTool runs a tool under its bare, un-namespaced name.
CallTool(ctx context.Context, name string, args map[string]any) (CallResult, error)
}
Client talks to one MCP server.
type ServerStatus ¶
type ServerStatus struct {
TotalServers int `json:"total_servers"`
ConnectedServers int `json:"connected_servers"`
TotalTools int `json:"total_tools"`
}
ServerStatus is the aggregate connection status of the whole server set.
type ServerStatusUpdateEvent ¶
type ServerStatusUpdateEvent struct {
ServerName string
Connected bool
TotalServers int
ConnectedServers int
TotalTools int
Tools map[string]agentdomain.Tool
}
ServerStatusUpdateEvent is pushed through the UI notifier whenever a server connects, disconnects, or changes its tool count. Tools holds the agent tools of a server that just connected, keyed by namespaced name.
type Supervisor ¶
type Supervisor interface {
// GetTotalServers returns the number of configured MCP servers.
GetTotalServers() int
// StartMonitoring begins background liveness probes, pushing every
// ServerStatusUpdateEvent through the UI notifier injected at
// construction. Idempotent; the initial status is emitted asynchronously.
StartMonitoring(ctx context.Context)
// DiscoverTools probes every server once and returns the agent tools of
// those that answered, keyed by their namespaced name.
DiscoverTools(ctx context.Context) map[string]agentdomain.Tool
// StartServers starts all MCP servers that have run=true (non-fatal).
StartServers(ctx context.Context) error
// StopServers stops all running MCP server containers.
StopServers(ctx context.Context) error
// Close stops monitoring, stops containers, and cleans up resources.
Close() error
}
Supervisor owns the configured MCP servers: their containers, their liveness, and the agent tools built from what they advertise.