Documentation
¶
Index ¶
Constants ¶
const LatestProtocolVersion = "2025-06-18"
LatestProtocolVersion is the MCP revision this server prefers when a client asks for one it does not know.
Variables ¶
This section is empty.
Functions ¶
func Instructions ¶ added in v1.9.0
func Instructions() string
Instructions returns the server instructions sent during initialize.
func RefreshLatestVersion ¶ added in v1.10.0
RefreshLatestVersion runs the CLI's update check in the background, so the next session's notice is current. Without it, someone who only uses the CLI through an assistant never gets one: the terminal check skips agents and never runs under `mcp serve`. It writes only the state file, never stdout, which carries the JSON-RPC stream. The check is due at most daily; if the process exits first, the check recorded the attempt and retries an hour later.
Types ¶
type JSONRPCError ¶
type JSONRPCResponse ¶
type JSONRPCResponse struct {
JSONRPC string `json:"jsonrpc"`
ID interface{} `json:"id,omitempty"`
Result interface{} `json:"result,omitempty"`
Error *JSONRPCError `json:"error,omitempty"`
}
type MCPServer ¶
type MCPServer struct {
// contains filtered or unexported fields
}
MCP Server
func NewMCPServer ¶
func NewMCPServer(config MCPServerConfig, client client.Client) *MCPServer
Create new MCP server
func (*MCPServer) Done ¶ added in v1.9.0
func (s *MCPServer) Done() <-chan struct{}
Done is closed once the server stops handling messages, which happens when the client closes the input stream. Callers wait on it so that a disconnected client ends the process instead of leaving it running with nothing to read.
type MCPServerConfig ¶
type MCPServerConfig struct {
Transport string `yaml:"transport" mapstructure:"transport"`
Port int `yaml:"port" mapstructure:"port"`
AuditLogging bool `yaml:"audit_logging" mapstructure:"audit_logging"`
// AllowExec lets exec_service run commands inside a customer's containers.
// Off by default: it is the one tool here that executes arbitrary code in a
// running environment, so it is the operator's call, not the assistant's.
AllowExec bool `yaml:"allow_exec" mapstructure:"allow_exec"`
// LatestVersion is the newest release the CLI's update check has cached,
// if any. Never read from or written to the config file.
LatestVersion string `yaml:"-" mapstructure:"-"`
}
MCP Server configuration