Skip to main content

Module registry

Module registry 

Source
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 matchUnknown — 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:

  1. Cache<paths.home>/registry.json, if present.
  2. Network — fetch from DEFAULT_SOURCE_URL (or a caller-provided URL) when explicitly requested. This is opt-in to keep scan and blacklist runs deterministic by default.
  3. Builtin fallback — a hardcoded list of well-known modelcontextprotocol/servers entries. 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).
RegistryEntry
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.