mcp-inventory
A Claude Skill: point-in-time MCP server config inventory. Never spawns a
configured server. No dependencies beyond Python 3's standard library, no
network call.
Provenance
Ported from packages/engine/src/mcp_audit/mod.rs (task E5-T07) — same
permission classification, same unpinned-floating-launcher (npx/uvx)
detection, same FNV-1a config-hash, same declared-config-text injection
scan (reusing the same five pattern families as rules::injection).
Update, widened same week as E31-T14's language-coverage push: the
source module's own unpinned-version check grew from npx-only to also
recognize uvx (the standard launcher for Python-ecosystem MCP servers,
real-verified to share npx's own <package>@<version> pin syntax) —
ported straight across, including the same honest carve-out for pipx run/Docker-image/direct-binary launches (see the source module's own
doc for why those stay unflagged).
Update, task L5-T04 (2026-08-16): the launcher check is a table now —
launchers.py, ported from the engine's mcp_audit::launchers — covering
npx/npm exec/bunx/bun x/pnpm dlx/yarn dlx (pkg@1.2.3),
uvx/uv tool run (pkg@1.2.3), pipx run (pkg==1.2.3), deno run
(npm:/jsr:/URL specifiers with @version), docker/podman run (a
version tag or @sha256: digest; untagged or :latest floats), dnx
(Tool@1.2.3), gem exec (gem:1.2.3), go run (module@v1.2.3;
@latest floats), nix run (a /<rev> in the flake ref; a bare
nixpkgs#pkg follows the registry), and the never-floating families
(cargo run -p, bundle exec, dotnet tool run, java -jar, an absolute
or relative binary path) reported as launcher_family = "absolute-binary".
The old pipx/Docker carve-out is closed. engine_parity.py replays the
engine's launcher fixture rows through this port on every CI run.
Deliberately scoped down from the source — stated plainly, not an
oversight:
- No drift tracking. The source persists each run's config hash in
a local database and diffs the next run against it. This port has no
memory between runs — it prints the current hash so you can compare
it yourself, but tracking that over time is out of scope here.
- No transcript-based prune recommendations. The source scans
Claude Code's own session transcript history for which servers
actually got called, to flag ones that look unused. That needs
parsing Claude Code's transcript format — not attempted in this port.
- No
--apply / config mutation. The source can remove
never-used servers from .mcp.json directly. This port is read-only,
full stop — it never writes to any config file.
Why it never runs a configured server
Real per-server tool-schema token cost and noticing that a server's live
tools changed after it was reviewed (a package behaving differently
between calls) both require actually
speaking the MCP protocol to a running server process. Spawning a
third-party server's configured command merely to audit it would
execute exactly the untrusted code an audit exists to flag, before a
human ever reviewed it. What this tool checks instead, safely, from the
declared config alone: transport class (local stdio vs. remote http/
sse/bare url), whether it declares env vars, whether an npx/uvx
install has no version pin, and whether the declared config text itself
(name/command/args/env keys, never values) contains an injection-shaped
pattern.
Verification
tests/test_mcp_inventory.py covers: permission classification (local vs.
remote, by url/type), unpinned-floating-launcher detection (npx
unscoped/scoped/version-pinned/npm exec variant, uvx pinned/unpinned,
pipx/Docker's deliberate non-detection), the FNV-1a hash's stability and
per-field boundary-mix property, injection-pattern matching against
declared config text, missing/malformed config file handling (never an
error), and CLI/JSON/exit-code behavior. Run:
cd community-skills/mcp-inventory
python3 -m pytest tests/ --cov=mcp_inventory --cov-report=term-missing
License
See LICENSE (included alongside this skill in its download).