Skip to content
Generated from the .d.ts files published in guardlink@2.0.0. Report problems against guardlink, not this page.

mcp

Everything exported by guardlink/mcp, from the .d.ts files published in guardlink@2.0.0. See the entry points for the other subpaths, and use guardlink as a library for worked examples.

Property Type Description
ambiguous? boolean Set when more than one declared record tied at the winning tier. The result holds the first by declaration order; candidates names the whole tie so the caller can re-query precisely instead of trusting an arbitrary pick.
candidates? string[] Identifiers of every record tied with the one returned. Present only when ambiguous.
count number -
external_id? ExternalIdSummary GL-204 — present when the query was an external identifier (cwe:, owasp:). Read external_id.declared before treating count: 0 as “nothing exposed”: it also distinguishes “this model has never heard of that weakness class”.
matched_against? string What the ref actually matched against — the thing to check when matched_via is substring.
matched_via? MatchKind How the query’s reference was resolved. Present on every form that resolves a ref. substring means the answer came from a partial match and should be treated as a suggestion, not an identification.
query string -
results any[] -
type string -

Property Type
annotation string
category string
confidence "high" | "medium" | "low"
file string
line? number
reason string

Property Type
diff? string
file? string
model ThreatModel
root string

createServer(): McpServer

GuardLink MCP Server — exports and stdio entry point.

McpServer

#mcp to #cmd-injection [high] cwe:CWE-78 – “Accepts tool calls from external MCP clients”

#mcp – “All tool calls validated by server.ts before execution”

MCPClient -> #mcp via stdio – “MCP protocol transport”

#mcp and MCPClient (#mcp-boundary) – “Trust boundary at MCP protocol”

– “D35: the guardlink-mcp bin executes this module directly, so it carries a shebang and a main guard. Startup errors go to stderr — stdout is the JSON-RPC channel and a stray line there corrupts the transport.”


lookup(model, query): LookupResult

Parameter Type
model ThreatModel
query string

LookupResult


startStdioServer(): Promise<void>

Start the MCP server on stdio transport. Called from CLI: guardlink mcp

Promise<void>


suggestAnnotations(opts): Promise<Suggestion[]>

Parameter Type
opts SuggestOptions

Promise<Suggestion[]>