Documentation
¶
Overview ¶
Package httpcheck probes a Streamable HTTP MCP endpoint with hand-built requests and compares the answers with the transport rules of spec revision 2026-07-28: request metadata headers, error codes and HTTP status, Origin validation and the removal of sessions and GET streams.
Index ¶
Constants ¶
const ( CodeMethodNotFound = -32601 CodeInvalidParams = -32602 CodeHeaderMismatch = -32020 CodeUnsupportedProtocolVersion = -32022 )
JSON-RPC error codes the checks expect.
const Revision = "2026-07-28"
Revision is the protocol revision whose transport rules are checked.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
Endpoint string
Client *http.Client // carries authentication; http.DefaultClient if nil
// Tools from tools/list; the tools/call header checks are skipped without them.
Tools []Tool
}
Checker sends the probe requests.
type ParamHeader ¶
type ParamHeader struct {
Header string // the Mcp-Param-{Header} name part
Path []string // property names from the root
Type string
}
ParamHeader is one valid x-mcp-header annotation: the tool parameter at Path is mirrored into the Mcp-Param-{Header} HTTP header.
func XMCPHeaders ¶
func XMCPHeaders(schema any) ([]ParamHeader, []string)
XMCPHeaders validates the x-mcp-header annotations of an inputSchema (spec 2026-07-28): a non-empty token, unique ignoring case, only on string, integer or boolean properties, and only reachable through a chain of "properties" keys. It returns the valid annotations and the problems.
type Report ¶
type Report struct {
Endpoint string `json:"endpoint"`
SupportedVersions []string `json:"supportedVersions,omitempty"`
Results []Result `json:"results"`
}
Report is the outcome of all checks.
type Result ¶
type Result struct {
Name string `json:"name"`
Status Status `json:"status"`
Detail string `json:"detail,omitempty"`
}
Result is the outcome of one check.