Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/MilindGaharwar/fettleWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/milindgaharwar/fettle/mcp-approve)<a href="https://agentmods.dev/commands/milindgaharwar/fettle/mcp-approve"><img src="https://agentmods.dev/badge/commands/milindgaharwar/fettle/mcp-approve.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00021 | $0.01019 |
| Opus 5 | $0.00010 | $0.00509 |
| Sonnet 5 | $0.00004 | $0.00204 |
| Haiku 4.5 | $0.00002 | $0.00102 |
Grade A, and why
mcp-approve scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootlowPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
- Writes to a temp file then sudo copies it to the ledger path Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- Grep for red flags: `child_process.exec`, `eval(`, `Function(`, `fs.writeFile`, `process.env`, outbound network calls, obfuscated code This is a copy
94% identical to fettle-mcp-approve — 9 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Run the full 5-phase MCP Zero-Trust Validation Protocol to audit a package, then — with human approval — add it to the root-owned allowlist ledger.
Procedure
-
Parse arguments. Extract package name and exact version from $ARGUMENTS (e.g.,
@playwright/[email protected]). If no version is pinned, STOP and ask for an exact version — unpinned packages are never approved. -
Locate the ledger. The allowlist lives at
~/.config/fettle/mcp-allowlist.jsonby default. Precedence: a policy-pinned[gates.mcp_trust].allowlist_pathin the effective config wins; otherwise theMCP_ALLOWLIST_PATHenv var; otherwise the default. Checkfettle config --print-effectivefor a pinned path. -
Check if already approved. Read the allowlist ledger and check if this exact package@version is already present under
packages. If so, report it and stop. -
Phase 1 — Package Provenance & Supply Chain
- Run
npm view <package>@<version> --jsonto get publisher, download stats, repo link, publish date - Verify publisher is the expected organization
- Cross-reference npm maintainers against known project contributors
- Check for recent ownership transfers or suspicious maintainer changes
- Run
npm auditfor known CVEs - Present findings to user with PASS/WARN/FAIL for each check
- Run
-
Phase 2 — Source Code Review
- Download without installing:
npm pack <package>@<version> - Extract tarball to
/tmp/mcp-audit-<package>/ - Review ALL runtime files (not just README)
- Grep for red flags:
child_process.exec,eval(,Function(,fs.writeFile,process.env, outbound network calls, obfuscated code - Map every exposed MCP tool to its blast radius
- Count total lines of runtime code
- Present findings to user
- Download without installing:
-
Phase 3 — Dependency Tree Audit
- Count transitive dependencies
- Check
npm auditon full resolved tree - Flag dependencies with <100 weekly downloads or recent ownership transfers
- Present findings to user
-
Phase 4 — Runtime Isolation Test
- Start the MCP server in a subprocess
- Check ports opened (
ss -tulpn), filesystem paths touched, DNS lookups - Test one benign operation and observe side effects
- Verify no unexpected phone-home or persistent connections
- Present findings to user
-
Phase 5 — Permission Scoping
- Recommend MCP tool allowlist for settings.json
- Recommend network restrictions if supported
- Recommend
--isolatedmode if available - Recommend output directory restrictions
- Present recommendations to user
-
Compute tarball SHA256. Run sha256sum on the downloaded tarball.
-
Write audit report. Save the full audit report (all 5 phases with findings) to
.fettle/audits/<package>-<version>.mdwith date and auditor. -
Present summary and ask for human approval. Show:
- Overall verdict: APPROVE / REJECT / CONDITIONAL
- Phase-by-phase summary (PASS/WARN/FAIL)
- Any conditions or restrictions
- Ask: "Do you approve adding @ to the allowlist?"
-
If approved, update the ledger via sudo. Use a Python script that:
- Reads the current allowlist ledger
- Adds the new package entry under
packageswithversion,sha256_tarball(npm) orsha256_wheel(Python), audit date, auditor, report path, andapproved_by_human: true; setallow_source: trueonly when a source build was explicitly audited - Writes to a temp file then sudo copies it to the ledger path
- Sets ownership to root:root and permissions to 0644
-
Confirm the ledger was updated by reading it back.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 81 lines · 21 tokens per session scan A 607d36ceee45
mcp-approve is a command published in the GitHub repository MilindGaharwar/fettle (2 stars, last pushed 3d ago), licensed Apache-2.0. It adds 21 tokens to every session and 1,019 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 2 findings (asks for root, runs shell commands). It is 94% identical to fettle-mcp-approve, differing in 9 lines, and is treated as a copy.
Other commands, from other repositories
scout-scan
Scan a path with Scout and walk through the security findings.
kb-ingest
Ingest external material into Sources/ inside the bound project KB, then update registry, index, and daily note as needed.
atomic-plan
Write a design doc (concepts, business rules, approaches) and a checkpoint-table spec (contract) for non-trivial work; inline spec only for trivial. Gauges triviality; loops spec authoring with subagents. Human-facing artifact, Mermaid diagrams allowed.
afo
Open feature worktree in terminal and start agent (shortcut for feature-open).
pick-agent
A command that helps users choose and import only the agent role they need, such as a frontend developer, researcher, or editor.
test
Generate tests for the specified code or feature.