Documentation
¶
Overview ¶
Package mcp serves attest to coding agents over the Model Context Protocol.
The server is read-only and offline: it writes no files, opens no sockets and makes no model calls. Every path an agent supplies is resolved inside the project root. The toolset is fixed at startup.
Index ¶
Constants ¶
const ( // MaxFileBytes caps every file the server reads. MaxFileBytes = 32 << 20 // MaxArgumentBytes caps the arguments of one tool call. MaxArgumentBytes = 16 << 20 )
Limits on what one call may carry or read.
const ServerName = "attest"
ServerName is the key the attest entry is written under in every client config.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
Serve runs the server on stdin and stdout until the client disconnects or ctx ends. Only protocol frames go to stdout; logs go to logs.
func ValidateCommand ¶
ValidateCommand checks the launch argv written into client configs.
Types ¶
type InstallResult ¶
type InstallResult struct {
Dir string `json:"dir"`
Created []string `json:"created"`
Updated []string `json:"updated"`
Unchanged []string `json:"unchanged"`
Conflict []string `json:"conflict"`
// Manual lists the conflicts --force cannot resolve: an attest entry that is
// not a [mcp_servers.attest] table. It is not part of the JSON output.
Manual []string `json:"-"`
}
InstallResult lists the client configs by what the install did. Paths are relative to the project directory, with forward slashes.
func Install ¶
func Install(dir string, argv []string, force bool) (InstallResult, error)
Install writes or merges the attest server entry into the Claude Code, Cursor and Codex project configs under dir. Other servers and keys are left as they are. A different existing attest entry is a conflict and is left alone unless force. Every destination is validated and every merge computed before the first write, so a refusal writes nothing.
type ToolInfo ¶
type ToolInfo struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema json.RawMessage `json:"input_schema"`
OutputSchema json.RawMessage `json:"output_schema"`
}
ToolInfo describes one tool for tools/list and `attest mcp --tools --json`.