Expand description
Known-good MCP server registry.
A registry is a mapping name → source URL for MCP servers the user
has signalled are safe (because they came from a curated public list,
a personal allowlist, or a cached pull). It feeds the BlackList check
in crate::scan::unknown::classify:
- Exact match of an installed MCP server name against a registry
entry ⇒
KnownGood. - Levenshtein distance ≤ 2 to some entry (and not identical) ⇒
Typosquat— high false-positive risk if the user named their own server something close, but worth surfacing for review. - No match ⇒
Unknown— neutral verdict, just “AgentSec doesn’t recognise this name”.
§Source chain (demo-level)
Phase 0 is a stub for the Service-side signature DB that Phase 1+ would build. For now the resolution order is:
- Cache —
<paths.home>/registry.json, if present. - Network — fetch from
DEFAULT_SOURCE_URL(or a caller-provided URL) when explicitly requested. This is opt-in to keepscanandblacklistruns deterministic by default. - Builtin fallback — a hardcoded list of well-known
modelcontextprotocol/serversentries. Always available, never fails.
The wire format for the network endpoint is a flat JSON array of
{"name": "...", "source": "..."} objects.
Structs§
- Registry
- In-memory known-good registry. Cheap to clone (entries live in a
HashMap, keys are short ASCII names). - Registry
Entry - One registry entry: a known-good MCP server name and where it came from.
Constants§
- DEFAULT_
SOURCE_ URL - Public demo endpoint. Open-source / read-only; the builtin fallback keeps the binary working when this URL is unreachable.