mcp

package
v0.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: LGPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer() *server.MCPServer

NewServer creates and configures the Cardinal MCP server with all tools registered. The returned *server.MCPServer is transport-agnostic: callers choose how to serve it (stdio for the world-cli command, or an HTTP transport when hosted from a long-running app such as the Cardinal Editor).

Types

type ClusterInput

type ClusterInput struct {
	Operation string `` /* 430-byte string literal not displayed */
	WorldPath string `` /* 279-byte string literal not displayed */
	Purge     bool   `` /* 351-byte string literal not displayed */
}

ClusterInput is the structured input for the cluster tool.

type ClusterOutput

type ClusterOutput struct {
	Operation    string   `json:"operation"              jsonschema_description:"The operation that was applied"`
	Purged       bool     `json:"purged"                 jsonschema_description:"Whether the cluster was deleted as part of this call"`
	Organization string   `json:"organization,omitempty" jsonschema_description:"World organization (start only)"`
	Project      string   `json:"project,omitempty"      jsonschema_description:"World project (start only)"`
	Shards       []string `json:"shards,omitempty"       jsonschema_description:"Shard IDs deployed (start only)"`
	Status       string   `json:"status"                 jsonschema_description:"Human-readable result summary"`
}

ClusterOutput is the structured output for the cluster tool.

type Cmd

type Cmd struct{}

Cmd runs the MCP server. Hidden from help - only called by AI tools like Cursor/Claude. Shows setup instructions if run from terminal.

func (*Cmd) Run

func (c *Cmd) Run() error

Run executes the MCP command.

type DebugControlInput

type DebugControlInput struct {
	ShardID      string `json:"shard_id"                jsonschema_description:"ID of the shard to control"`
	Operation    string `` /* 301-byte string literal not displayed */
	InstanceName string `` /* 178-byte string literal not displayed */
	OperatorURL  string `` /* 127-byte string literal not displayed */
}

DebugControlInput is the structured input for the debug_control tool.

type DebugControlOutput

type DebugControlOutput struct {
	Operation  string `json:"operation"   jsonschema_description:"The operation that was applied"`
	TickHeight uint64 `json:"tick_height" jsonschema_description:"Current tick height; meaningful for pause and step, 0 for resume and reset"`
	Status     string `json:"status"      jsonschema_description:"Human-readable result, e.g. 'paused at tick 42'"`
}

DebugControlOutput is the structured output for the debug_control tool.

type DescribeWorldInput

type DescribeWorldInput struct{}

DescribeWorldInput is the (empty) input for describe_world; it reads the cluster, not a local path.

type DescribeWorldOutput

type DescribeWorldOutput struct {
	Worlds []DescribedWorld `json:"worlds" jsonschema_description:"Worlds currently deployed on the local cluster"`
}

DescribeWorldOutput summarizes the worlds deployed on the cluster.

type DescribedWorld

type DescribedWorld struct {
	Organization string   `json:"organization"`
	Project      string   `json:"project"`
	Shards       []string `json:"shards"`
}

DescribedWorld is one deployed world and its shards.

type EntityState

type EntityState struct {
	ID         uint32         `json:"id"         jsonschema_description:"Entity ID"`
	Components map[string]any `json:"components" jsonschema_description:"Component data keyed by component name"`
}

EntityState is one entity from the snapshot with its decoded components.

type GetNatsLogsInput

type GetNatsLogsInput struct {
	TailLines int `` /* 137-byte string literal not displayed */
}

GetNatsLogsInput is the structured input for the get_nats_logs tool.

type GetNatsLogsOutput

type GetNatsLogsOutput struct {
	Component string `json:"component"`
	Logs      string `json:"logs"`
}

GetNatsLogsOutput is the structured output for get_nats_logs.

type GetShardLogsInput

type GetShardLogsInput struct {
	ShardID      string `json:"shard_id"                jsonschema_description:"ID of the shard whose pod logs should be fetched"`
	InstanceName string `` /* 181-byte string literal not displayed */
	TailLines    int    `` /* 128-byte string literal not displayed */
	OperatorURL  string `` /* 127-byte string literal not displayed */
}

GetShardLogsInput is the structured input for the get_shard_logs tool.

type GetShardLogsOutput

type GetShardLogsOutput struct {
	ShardID string   `json:"shard_id"`
	Pods    []string `json:"pods"     jsonschema_description:"Pod names whose logs are included"`
	Logs    string   `json:"logs"`
}

GetShardLogsOutput is the structured output for get_shard_logs.

type GetStateInput

type GetStateInput struct {
	ShardID      string   `json:"shard_id"                jsonschema_description:"ID of the shard to read state from"`
	InstanceName string   `` /* 178-byte string literal not displayed */
	Find         []string `` /* 205-byte string literal not displayed */
	Match        string   `` /* 198-byte string literal not displayed */
	Where        string   `` /* 478-byte string literal not displayed */
	MaxEntities  int      `` /* 141-byte string literal not displayed */
	Organization string   `` /* 138-byte string literal not displayed */
	Project      string   `` /* 133-byte string literal not displayed */
	ShardURL     string   `` /* 242-byte string literal not displayed */
	OperatorURL  string   `` /* 157-byte string literal not displayed */
}

GetStateInput is the structured input for the get_state tool.

type GetStateOutput

type GetStateOutput struct {
	ShardID      string        `json:"shard_id"            jsonschema_description:"Shard the snapshot came from"`
	InstanceName string        `` /* 149-byte string literal not displayed */
	IsPaused     bool          `json:"is_paused"           jsonschema_description:"Whether tick execution is currently paused"`
	TickHeight   uint64        `json:"tick_height"         jsonschema_description:"Tick the snapshot was taken at"`
	Timestamp    string        `json:"timestamp,omitempty" jsonschema_description:"When the shard captured the snapshot (RFC 3339)"`
	Version      uint32        `json:"version,omitempty"   jsonschema_description:"Snapshot format version"`
	EntityCount  int           `json:"entity_count"        jsonschema_description:"Total entities in the world, before filtering"`
	Matched      int           `json:"matched"             jsonschema_description:"Entities that passed the filter, before truncation"`
	Truncated    bool          `json:"truncated"           jsonschema_description:"True when entities was cut short by max_entities"`
	Entities     []EntityState `json:"entities"            jsonschema_description:"Matching entities with their component data"`
}

GetStateOutput is the structured output for the get_state tool.

type GetWorldStartStatusInput

type GetWorldStartStatusInput struct {
	OperatorURL string `` /* 126-byte string literal not displayed */
}

GetWorldStartStatusInput is the structured input for get_world_start_status.

type GetWorldStartStatusOutput

type GetWorldStartStatusOutput struct {
	Pools []ShardPool `json:"pools" jsonschema_description:"Shard pools and their pod instances reported by the cardinal-operator"`
}

GetWorldStartStatusOutput is the structured output for get_world_start_status.

type InspectShardInput

type InspectShardInput struct {
	ShardID     string `` /* 127-byte string literal not displayed */
	OperatorURL string `` /* 126-byte string literal not displayed */
}

InspectShardInput is the structured input for the inspect_shard tool.

type InspectShardOutput

type InspectShardOutput struct {
	Pool ShardPool `json:"pool" jsonschema_description:"The shard's pool and per-pod instance status"`
}

InspectShardOutput is the structured output describing a shard pool's state.

type IntrospectInput

type IntrospectInput struct {
	ShardID      string `json:"shard_id"                jsonschema_description:"ID of the shard to introspect"`
	InstanceName string `` /* 178-byte string literal not displayed */
	Organization string `` /* 138-byte string literal not displayed */
	Project      string `` /* 133-byte string literal not displayed */
	ShardURL     string `` /* 370-byte string literal not displayed */
	OperatorURL  string `` /* 157-byte string literal not displayed */
}

IntrospectInput is the structured input for the introspect tool.

type IntrospectOutput

type IntrospectOutput struct {
	Commands   []NamedSchema `json:"commands"   jsonschema_description:"List of available commands with their schemas"`
	Components []NamedSchema `json:"components" jsonschema_description:"List of available components with their schemas"`
	Events     []NamedSchema `json:"events"     jsonschema_description:"List of available events with their schemas"`
}

IntrospectOutput is the structured output for the introspect tool.

type NamedSchema

type NamedSchema struct {
	Name   string         `json:"name"`
	Schema map[string]any `json:"schema"`
}

NamedSchema is one registered type (command, component, or event) with its schema — the type's protobuf message definition rendered as JSON.

type ReloadInput

type ReloadInput struct {
	WorldPath   string `` /* 218-byte string literal not displayed */
	ShardID     string `` /* 193-byte string literal not displayed */
	Purge       bool   `` /* 212-byte string literal not displayed */
	OperatorURL string `` /* 126-byte string literal not displayed */
}

ReloadInput is the structured input for the reload tool.

type ReloadOutput

type ReloadOutput struct {
	Organization string   `json:"organization" jsonschema_description:"World organization from world.toml"`
	Project      string   `json:"project"      jsonschema_description:"World project from world.toml"`
	Shards       []string `json:"shards"       jsonschema_description:"Shard IDs that were rebuilt and reloaded"`
	Purged       bool     `json:"purged"       jsonschema_description:"Whether the reloaded shards' state was wiped"`
	Status       string   `json:"status"       jsonschema_description:"Human-readable result summary"`
}

ReloadOutput is the structured output for the reload tool.

type SdkGenerateInput

type SdkGenerateInput struct {
	Source   string `` /* 175-byte string literal not displayed */
	GoOut    string `` /* 358-byte string literal not displayed */
	CsOut    string `` /* 140-byte string literal not displayed */
	ProtoOut string `` /* 234-byte string literal not displayed */
}

SdkGenerateInput is the structured input for the sdk_generate tool.

type SdkGenerateOutput

type SdkGenerateOutput struct {
	Source string `json:"source"           jsonschema_description:"Backend directory that was scanned"`
	GoOut  string `json:"go_out,omitempty" jsonschema_description:"Where generated Go was written"`
	CsOut  string `json:"cs_out,omitempty" jsonschema_description:"Where generated C# was written"`
	Report string `` /* 194-byte string literal not displayed */
	Status string `json:"status"           jsonschema_description:"Human-readable result summary"`
}

SdkGenerateOutput is the structured output for the sdk_generate tool.

type SendCommandInput

type SendCommandInput struct {
	ShardID      string         `` /* 128-byte string literal not displayed */
	InstanceName string         `` /* 213-byte string literal not displayed */
	Organization string         `` /* 138-byte string literal not displayed */
	Project      string         `` /* 133-byte string literal not displayed */
	CommandName  string         `` /* 127-byte string literal not displayed */
	Payload      map[string]any `json:"payload"                 jsonschema_description:"JSON payload for the command (the command's input data)"`
	ShardURL     string         `` /* 444-byte string literal not displayed */
	OperatorURL  string         `` /* 157-byte string literal not displayed */
	Email        string         `json:"email,omitempty"         jsonschema_description:"Email for dev auth (defaults to mcp@dev.local)"`
	Region       string         `json:"region,omitempty"        jsonschema_description:"Service address region (defaults to us-west1 for local dev)"`
}

SendCommandInput is the structured input for the send_command tool.

type SendCommandOutput

type SendCommandOutput struct {
	ShardID      string `json:"shard_id"`
	InstanceName string `json:"instance_name"     jsonschema_description:"The pool instance (pod) this command was routed to"`
	CommandName  string `json:"command_name"`
	Message      string `json:"message,omitempty"`
}

SendCommandOutput is the structured output for the send_command tool.

type ShardInstance

type ShardInstance struct {
	Name         string `` /* 128-byte string literal not displayed */
	PodName      string `json:"pod_name,omitempty"      jsonschema_description:"Kubernetes pod name (ephemeral; changes on rolling deploy)"`
	Phase        string `json:"phase,omitempty"         jsonschema_description:"Pod phase: Running, Pending, Failed, etc."`
	Ready        bool   `json:"ready"                   jsonschema_description:"Whether the pod passes its readiness checks"`
	RestartCount int32  `json:"restart_count,omitempty" jsonschema_description:"Container restart count"`
	Age          string `json:"age,omitempty"           jsonschema_description:"How long the pod has been running"`
}

ShardInstance describes one running pod (instance) of a shard pool.

type ShardPool

type ShardPool struct {
	ShardID   string          `json:"shard_id"            jsonschema_description:"Shard identifier from world.toml (e.g. 'gameplay')"`
	Namespace string          `json:"namespace,omitempty" jsonschema_description:"Kubernetes namespace the pool runs in"`
	PoolSize  int32           `json:"pool_size,omitempty" jsonschema_description:"Number of instances in the pool"`
	ImageTag  string          `json:"image_tag,omitempty" jsonschema_description:"Deployed image tag"`
	Phase     string          `json:"phase,omitempty"     jsonschema_description:"Pool phase reported by the operator"`
	Instances []ShardInstance `json:"instances"           jsonschema_description:"Per-pod status"`
}

ShardPool describes a shard's operator-managed deployment pool in the cluster.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL