Documentation
¶
Overview ¶
Package mcpserver exposes the daemon to coding agents over the Model Context Protocol (stdio). Agents can reuse running servers instead of launching duplicates, start what they need, and read logs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Modes = []Mode{ReadOnly, Start, Full}
Modes lists the modes in order of what they allow.
Functions ¶
Types ¶
type Container ¶
type Container struct {
Name string `json:"name"`
Service string `json:"service,omitempty" jsonschema:"compose service"`
Project string `json:"project,omitempty" jsonschema:"compose project"`
Server string `json:"server,omitempty" jsonschema:"the server it belongs to"`
IssueFor []string `json:"issueFor,omitempty" jsonschema:"servers it needs attention for: unhealthy, restarting, or failed while the server ran"`
Image string `json:"image"`
State string `json:"state" jsonschema:"created, running, paused, restarting, removing, exited or dead"`
Status string `json:"status" jsonschema:"the engine's summary, e.g. Up 3 hours (healthy)"`
Health string `json:"health,omitempty" jsonschema:"starting, healthy or unhealthy"`
Buildable bool `json:"buildable,omitempty" jsonschema:"the compose service is known to build its image"`
Failed bool `json:"failed,omitempty" jsonschema:"exited in failure (not finished or stopped on request), or dead"`
ExitCode *int `json:"exitCode,omitempty"`
Restarts int `json:"restarts,omitempty"`
Ports []string `json:"ports,omitempty" jsonschema:"published ports as host:container/protocol"`
NetworkPorts []int `` /* 153-byte string literal not displayed */
Dir string `json:"projectDir,omitempty" jsonschema:"compose project directory, where docker compose commands for it run"`
}
Container is the compact view of a container returned to agents.
type Mode ¶ added in v0.3.0
type Mode string
Mode is what the tools may change.
const ( // ReadOnly offers only the tools that change nothing, and never starts // the daemon. ReadOnly Mode = "read-only" // Start adds ensure_server, which may start the daemon and servers. Start Mode = "start" // Full also offers restarting and stopping servers and container actions. Full Mode = "full" )
type Options ¶ added in v0.3.0
type Options struct {
// Mode is what the tools may change; "" is Full.
Mode Mode
// Dirs limits every tool to the projects in these directories; none
// means every project.
Dirs []string
}
Options select what the MCP server offers.
type Server ¶
type Server struct {
RestartPending bool `json:"restartPending"`
ListenPorts []int `json:"listenPorts,omitempty"`
Listening bool `json:"listening"`
Name string `json:"name"`
Group string `json:"group,omitempty"`
Status string `json:"status" jsonschema:"stopped, starting, running, stopping, crashed, exited or blocked"`
Oneshot bool `` /* 180-byte string literal not displayed */
Schedule string `json:"schedule,omitempty" jsonschema:"crontab expression in local time that starts the server"`
NextRun string `json:"nextRun,omitempty" jsonschema:"when the schedule next starts it (RFC 3339)"`
URL string `json:"url,omitempty" jsonschema:"direct URL on loopback"`
Alias string `json:"alias,omitempty" jsonschema:"same server through http://<name>.localhost"`
Port int `json:"port,omitempty"`
Dir string `json:"dir"`
Cmd string `json:"cmd"`
Note string `json:"note,omitempty"`
External string `json:"external,omitempty" jsonschema:"set when another process holds the port"`
CPU float64 `json:"cpuPercent,omitempty"`
MemMB int64 `json:"memMB,omitempty"`
Exposure string `` /* 312-byte string literal not displayed */
NetworkWarning bool `` /* 177-byte string literal not displayed */
Containers []Container `json:"containers,omitempty" jsonschema:"containers attached by project mapping, directory or local project ID"`
Outcome string `json:"outcome,omitempty" jsonschema:"what ensure_server did: reused (already running) or started"`
Computer string `json:"computer,omitempty" jsonschema:"the other computer the server runs on; its URLs open from this one"`
Temporary bool `` /* 160-byte string literal not displayed */
Origin string `json:"origin,omitempty" jsonschema:"the configured server a temporary server copies"`
Worktree string `json:"worktree,omitempty" jsonschema:"the checkout a temporary server runs in"`
}
Server is the compact view returned to agents.