Documentation
¶
Overview ¶
Package mcp wraps calls to CockroachDB's Managed MCP Server.
This is intentionally read-only: it never issues writes. All state- changing actions go through the ccloud package instead, gated by human approval. Keeping these concerns in separate packages makes the "observe vs act" boundary obvious in code review and in the demo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client holds the connection to the Managed MCP Server endpoint.
func (*Client) GetClusterHealth ¶
func (c *Client) GetClusterHealth(ctx context.Context) (*ClusterSnapshot, error)
GetClusterHealth calls the MCP server's cluster-health tool (list databases/tables, node status, replication) — read-only.
type ClusterSnapshot ¶
type ClusterSnapshot struct {
CPUPercent float64 `json:"cpu_percent"`
ActiveQueries int `json:"active_queries"`
ContentionEvents int `json:"contention_events"`
ReplicationStatus string `json:"replication_status"`
Raw map[string]interface{} `json:"raw"`
CapturedAt time.Time `json:"captured_at"`
}
ClusterSnapshot is our own normalized view of whatever the MCP server returns — MCP tool responses are free-form JSON, so we shape them into something the rest of the app can rely on.
func (*ClusterSnapshot) ToJSON ¶
func (s *ClusterSnapshot) ToJSON() ([]byte, error)
ToJSON is a convenience for logging the raw context alongside a decision