Documentation
¶
Overview ¶
Package mcp holds the shape of an mcp.json document and the rules a server definition must satisfy.
It is the contract half of the pair whose implementation is internal/infra/mcp, the same split as internal/core/llm and internal/infra/llm. It sits in core because two callers that cannot share anything higher both need it: loading a file for a run, and inspecting an uploaded plugin package before publishing it, which internal/server does and which may not import internal/config.
Index ¶
Constants ¶
const ( TransportStdio = "stdio" TransportSSE = "sse" TransportHTTP = "http" )
Transport names for a server entry's "type" field.
Variables ¶
This section is empty.
Functions ¶
func ValidateServerConfig ¶
func ValidateServerConfig(id string, s ServerConfig) error
ValidateServerConfig reports why an entry could not start.
It runs against the document as written, so it must not depend on variable expansion: a command of "${BUILDMAX_PLUGIN_ROOT}/bin/server" is present, and whether that path exists is a question for the machine that runs it.
Types ¶
type ConfigRoot ¶
type ConfigRoot struct {
MCPServers map[string]ServerConfig `json:"mcpServers"`
}
ConfigRoot is the root of mcp.json (top-level key mcpServers).
func ParseConfig ¶
func ParseConfig(data []byte) (*ConfigRoot, error)
ParseConfig decodes an mcp.json document without validating its entries.
A document declaring no server returns (nil, nil): an empty file and a missing one mean the same thing to every caller, and neither is an error.