Expand description
BlackList check: classify installed MCP server names against a
crate::registry::Registry of known-good entries.
This is a demo-level signature check: it reads MCP server names
from .mcp.json (cwd) and .claude.json (under crate::Paths::user_home)
at call time, then assigns each name one of three verdicts:
UnknownVerdictKind::KnownGood— exact name match in the registry.UnknownVerdictKind::LikelyTyposquat— Levenshtein distance == 1 to a registry entry (not identical). High-signal, warn severity.UnknownVerdictKind::InformationalTyposquat— Levenshtein distance == 2 to a registry entry (not identical, and name length > 3). Lower-signal, info severity.UnknownVerdictKind::Unknown— no match; the user has installed an MCP server AgentSec doesn’t recognise. This is neutral, not a block — it just surfaces “we’ve never seen this”.
The classify step does not consume the inventory snapshot — it re-reads the source JSON because the snapshot only stores hashes, not the full structure.
classify groups rows by name, deduplicates across files, and
returns one UnknownVerdict per distinct server name with count
(number of config files it appeared in) and paths (sorted list of
those files).
Structs§
- Unknown
Verdict - One row of
classify’s aggregated output.
Enums§
- Unknown
Verdict Kind - Classification levels.
Functions§
- classify
- Read MCP server names from
.mcp.jsonand.claude.json, classify each one againstregistry, and return one aggregated row per distinct name.