name: audit-mcp
description: Audit every configured MCP server — trust level, allowlist, last-update, risk flags
when_to_use:
- User asks to audit or review MCP configuration
- Scheduled weekly security check
- After installing a new MCP server
- Before granting allow_sampling: true
toolsets:
- terminal
- file
audit-mcp — MCP Server Security Audit
Walk every server declared in ~/.hermes/config.yaml under mcp_servers: and produce a structured report with risk flags.
Procedure
Read the config. Load
~/.hermes/config.yamland extract themcp_servers:block. If the block is empty or missing, report "No MCP servers configured" and exit.For each server, collect:
- Server name and transport (
stdioifcommand:present,httpifurl:present) - Declared
trust:level (trusted/community/untrusted; defaultcommunityif unset) allow_sampling:flag (defaultfalse)tools_allowlist:presence and length- Source identifier: npm package (parse from
args:), git URL, or HTTP origin - Last-updated timestamp:
- npm:
npm view <pkg> time.modified - git:
git -C <path> log -1 --format=%cI - http: attempt a
HEADand grabLast-Modified
- npm:
- Server name and transport (
Risk-flag each server:
- 🔴 HIGH:
trust: trustedAND reads untrusted content (web scraping, email parsing, public RSS). List any tool names matching/scrape|fetch|email|rss|crawl/ias evidence. - 🔴 HIGH:
allow_sampling: trueANDtrustis nottrusted. - 🟡 MEDIUM: last updated > 90 days ago.
- 🟡 MEDIUM: no
tools_allowlistfor a server with > 10 tools exposed. - 🟡 MEDIUM: referenced
${VAR}inenv:is not set in~/.hermes/.env. - 🟢 LOW: unscoped
enabled_for, making the server available in every profile.
- 🔴 HIGH:
Render a table. Columns: name, transport, trust, sampling, tools-allowed / tools-exposed, last-update age, flags.
Summarize next steps. Group findings by flag color and recommend:
- HIGH: "Change
trust:tocommunityoruntrusted, disable sampling, add tools_allowlist." - MEDIUM stale: "Run
npm update <pkg>or rebuild the git source; verify release notes." - MEDIUM missing allowlist: "Add
tools_allowlist:with the specific tools you actually use."
- HIGH: "Change
Offer to apply fixes. Ask the user if they'd like to:
- Downgrade any
trusted→community - Disable
allow_samplingon flagged servers - Write a suggested
tools_allowlistbased onhermes logsusage history
- Downgrade any
Never auto-apply without confirmation.
Output format
Report as markdown. Paste into Telegram / Discord / dashboard as-is. Example:
## MCP Security Audit — 2026-04-17
### 🔴 HIGH (1)
- **random-scraper** — trusted + reads untrusted content (`scrape_url`, `fetch_rss`)
### 🟡 MEDIUM (2)
- **postgres** — last updated 127 days ago (package @modelcontextprotocol/server-postgres)
- **github** — no tools_allowlist, 34 tools exposed
### 🟢 LOW (1)
- **filesystem** — enabled_for empty, loads in every profile
### Recommendations
1. Change `random-scraper` to `trust: untrusted` and add tools_allowlist.
2. `npm update @modelcontextprotocol/server-postgres`.
3. Scope `github` to the 6 tools actually used in last 30d.
Notes
- Runs entirely locally. No data leaves the host.
- Pair with
cron.yamlto run weekly (see Part 19). - Uses
terminalto execnpm view/git log; usesfileto read the config.