Documentation
¶
Overview ¶
Package mcp serves the agent surface of an application over stdio, S16.
`avero mcp` speaks the Model Context Protocol: JSON-RPC 2.0 over the standard input and the standard output. The server holds seven tools. Every tool except scaffold_slice reads and writes nothing, and the server never runs a command that a caller names. It runs the fixed steps of the gate and the inspection of the application, and nothing else.
Index ¶
Constants ¶
const ( // KindCompile is a fault of the Go compiler or of go vet. KindCompile = "compile" // KindAvero is a fault that Avero printed, with its repair. KindAvero = "avero" // KindUnknown is a line that names no position. KindUnknown = "unknown" )
The kinds of fault.
const ( // ProtocolVersion is the version of the Model Context Protocol. ProtocolVersion = "2025-06-18" // ServerName names the server in the handshake. ServerName = "avero" // JSONRPCVersion is the version of the transport. JSONRPCVersion = "2.0" )
The protocol that the server speaks.
const SchemaID = "https://avero.dev/schema/mcp-results/v1"
SchemaID names the schema of the tool results. See mcp/schema.json.
Variables ¶
var Schema []byte
Schema holds mcp/schema.json. The structured result of each tool follows the definition of its name. See AN-3.
var Version = "dev"
Version is the version of the server. The release build sets it.
Functions ¶
Types ¶
type Fault ¶
type Fault struct {
// Kind is compile, avero or unknown.
Kind string `json:"kind"`
// File names the file of the fault.
File string `json:"file"`
// Line names the line of the fault.
Line int `json:"line"`
// Column names the column of the fault.
Column int `json:"column"`
// Message states the fault.
Message string `json:"message"`
// Repair states what to do. It is one sentence.
Repair string `json:"repair"`
// Generated reports a fault that a generated file raised.
Generated bool `json:"generated"`
// SourceFile names the file that the person wrote, for a fault of a
// generated file. See DX-6.
SourceFile string `json:"source_file"`
// SourceLine names the line that the person wrote.
SourceLine int `json:"source_line"`
}
Fault is one fault that explain_error found.
type Server ¶
type Server struct {
// Dir is the root of the application.
Dir string
// Slice writes one feature slice. scaffold_slice calls it, and the CLI
// supplies the same function that `avero slice` runs.
Slice func(dir, name string) (files []string, registered bool, err error)
// Generate proves that every generated file of the application is
// current. The gate step of run_verify calls it.
Generate func(dir string) error
}
Server answers the Model Context Protocol for one application.
The two functions are fields, because the scaffolder and the generators live in packages that this one does not import. `avero mcp` supplies them. See design rule 3.
type Tool ¶
type Tool struct {
// Name is the name that a caller sends.
Name string `json:"name"`
// Description states what the tool returns, in one line.
Description string `json:"description"`
// InputSchema states the arguments of the tool.
InputSchema map[string]any `json:"inputSchema"`
// contains filtered or unexported fields
}
Tool is one tool of the server.