Documentation
¶
Overview ¶
Package server defines the MCP server: its tools, their inputs and outputs, and the validation between an agent's request and the lookups.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = ""
Version is set at build time for container images, with -ldflags "-X .../internal/server.Version=...". Use BuildVersion to read it.
Functions ¶
func BuildVersion ¶
func BuildVersion() string
BuildVersion is the server's own version, as reported to clients. When the binary was not given one at build time, it falls back to the module version Go records for `go install ...@v1.2.3`, and to "dev" for a local build.
func NewHTTPHandler ¶
func NewHTTPHandler(mcpServer *mcp.Server, options HTTPOptions) http.Handler
NewHTTPHandler serves the MCP server over Streamable HTTP as the 2026-07-28 revision describes it: one endpoint at /mcp that accepts POST, no sessions, and requests from other browser origins refused. /healthz answers 200 for load balancers and container probes, and needs no token.
Types ¶
type ComponentInput ¶
type ComponentInput struct {
Name string `json:"name,omitempty" jsonschema:"product name, such as LiteLLM or GitLab. Give this or image."`
Image string `` /* 158-byte string literal not displayed */
Version string `` /* 132-byte string literal not displayed */
Ecosystem string `` /* 152-byte string literal not displayed */
Package string `json:"package,omitempty" jsonschema:"package name within the ecosystem"`
Repo string `json:"repo,omitempty" jsonschema:"upstream GitHub repository as owner/name, to read its security advisories"`
CPE string `json:"cpe,omitempty" jsonschema:"NVD product as vendor:product, such as gitlab:gitlab"`
}
ComponentInput identifies one component.
type ComponentSummary ¶
type ComponentSummary struct {
Component ResolvedComponent `json:"component"`
Status string `` /* 129-byte string literal not displayed */
Reason string `json:"reason"`
Counts intel.Counts `json:"counts"`
LatestVersion string `json:"latestVersion,omitempty"`
VersionStatus string `json:"versionStatus"`
Support intel.Support `json:"support" jsonschema:"whether this version's release line still receives fixes"`
OlderAdvisories int `json:"olderAdvisories" jsonschema:"advisories that apply but were left out because they predate since"`
TopAdvisories []string `json:"topAdvisories" jsonschema:"ids of the most urgent advisories, at most 5"`
Failed []string `json:"failedSources" jsonschema:"sources that could not be checked for this component"`
}
ComponentSummary is one row of a batch answer.
type HTTPOptions ¶
type HTTPOptions struct {
// Token, when set, must be presented by every MCP request as
// "Authorization: Bearer <token>". When empty there is no authentication,
// and the server must only be reachable by callers you trust.
Token string
// JSON answers each request with a single application/json body instead
// of a text/event-stream. Both are valid Streamable HTTP; the stream is
// the default, and plain JSON suits proxies that buffer responses.
JSON bool
Logger *slog.Logger
}
HTTPOptions configure the Streamable HTTP transport.
type ResolvedComponent ¶
type ResolvedComponent struct {
Name string `json:"name"`
Version string `json:"version,omitempty"`
VersionFrom string `json:"versionFrom,omitempty" jsonschema:"where the version came from: input or image-tag"`
ResolvedFrom string `` /* 145-byte string literal not displayed */
Ecosystem string `json:"ecosystem,omitempty"`
Package string `json:"package,omitempty"`
Repo string `json:"repo,omitempty"`
CPE string `json:"cpe,omitempty"`
}
ResolvedComponent is how the server understood the request.