feat(mcp): add registry posture scanning#280
Conversation
Signed-off-by: Rod Boev <rod.boev@gmail.com>
18f495c to
8c49856
Compare
rng1995
left a comment
There was a problem hiding this comment.
[Automated SkillSpector Review]
Approved. The MCP Registry mode is well scoped: remote acquisition accepts only the exact official registry endpoint, follows pagination with a repeated-cursor guard, and normalizes owner records into stable hashes. Posture checks distinguish unavailable evidence from asserted unsafe values, and CLI routing leaves ordinary skill scans unchanged while rejecting incompatible formats and flags.
Coverage includes normalization, package pinning and hashes, official status, plain-HTTP remotes, pagination, untrusted URL rejection, malformed payloads, risk aggregation, and CLI exit behavior. No correctness, security, schema, or test blocker was found. GitHub currently reports no completed check runs for this head.
Summary
SkillSpector can now inspect MCP Registry server records before a user connects to them. The new scan mode normalizes the official registry payload (server identity, version and status metadata, repository, package, and remote references) into stable hashed snapshots, then reports deterministic posture risks: unpinned packages, missing integrity hashes, missing repository references, deprecated status, and plain-http remotes, all without changing ordinary skill scans.
Refs #121
This design keeps the diffable-snapshot goal proposed in the issue discussion. Checks that depend on fields the official registry does not publish (tool manifests, declared permissions, security contacts, publisher verification flags) are left to follow-up slices against sources that publish them.
Diff Notes
fileSha256integrity, repository presence, official status, and remote transport security, and aggregate finding risk so unsafe scans cross the CLI threshold{var}URL templates pass through; only structurally unusable payloads fail, with source-named errorsskillspector scan --mcp-registryas a thin CLI route with JSON snapshot output, rejecting unsupported non-JSON formats and skill-only flagsScope
This change leaves the skill graph, MCP server transport, existing LP/TP analyzers, baseline and SARIF formats, and provider credentials unchanged. Unknown registry facts remain unknown instead of being scored as confirmed risks. This first slice is MCP Registry only, so it does not add a generic registry-source selector or any Glama/Smithery adapter. Live Glama/Smithery fetchers, tool-manifest posture checks, generalized registry-verification semantics, dependency-CVE resolution, and cross-snapshot diff presentation are follow-up surfaces.
Verification
uv run pytest tests/unit/test_mcp_registry.py tests/unit/test_cli.py -k "mcp_registry or registry"-51 passed, 12 deselected in 1.03suv run pytest tests/unit/test_cli.py -k "scan and not mcp_registry"-11 passed, 11 deselected in 1.08suv run ruff check src/ tests/-All checks passed!uv run ruff format --check src/ tests/-146 files already formatteduv run mypy src/skillspector/mcp_registry.py-Success: no issues found in 1 source fileLive source checked during implementation:
https://registry.modelcontextprotocol.io/v0/servers, schemahttps://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json.