fettle: Command for Claude Code

.github/prompts/fettle-mcp-approve.prompt.md

fettle-mcp-approve is a command for Claude Code, GitHub Copilot from MilindGaharwar/fettle. It costs 23 tokens per session (1,024 once invoked), scanned A, original, Apache-2.0.

A command that audits a specific, version-pinned MCP package before approving it for installation. MCP packages add tools or connections that an agent can use.

In plain words
What is it for?
Use it to validate an exact npm package version, review its publisher and maintainers, and request human approval before recording it in the allowlist.
Why use it?
It checks the package's source and supply chain before adding it to a trusted allowlist, reducing the risk of installing an untrusted package.

Command for Claude CodeGitHub Copilot

Written for Claude Code and GitHub Copilot: argument-hint in frontmatter, but also a Copilot chat mode or prompt.

This is MilindGaharwar/fettle's own configuration. It tells Claude Code and GitHub Copilot how to work on fettle itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything fettle configures →

Part of the fettle plugin — 34 commands, 4 hooks shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to MilindGaharwar/fettle. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MilindGaharwar/fettle/main/.github/prompts/fettle-mcp-approve.prompt.md
Clone the repo
git clone --depth 1 https://github.com/MilindGaharwar/fettle

Made for: Claude Code, GitHub Copilot.

Or install fettle, the plugin that ships this one along with the rest of its 34 commands, 4 hooks.

Wrote 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.

agentmods badge for fettle-mcp-approve

README.md
[![agentmods](https://agentmods.dev/badge/commands/milindgaharwar/fettle/fettle-mcp-approve/github.svg)](https://agentmods.dev/commands/milindgaharwar/fettle/fettle-mcp-approve)
Your own site
<a href="https://agentmods.dev/commands/milindgaharwar/fettle/fettle-mcp-approve"><img src="https://agentmods.dev/badge/commands/milindgaharwar/fettle/fettle-mcp-approve/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fettle-mcp-approve

Your own site · 80×15
<a href="https://agentmods.dev/commands/milindgaharwar/fettle/fettle-mcp-approve"><img src="https://agentmods.dev/badge/commands/milindgaharwar/fettle/fettle-mcp-approve.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,024 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01024
Opus 5 $0.00012 $0.00512
Sonnet 5 $0.00005 $0.00205
Haiku 4.5 $0.00002 $0.00102

Measured today against content hash 2fd1d7cde6a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

fettle-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 today.

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
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.github/prompts/fettle-mcp-approve.prompt.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

$ARGUMENTS refers to any text the user typed after the slash command.

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

  1. 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.

  2. Locate the ledger. The allowlist lives at ~/.config/fettle/mcp-allowlist.json by default. Precedence: a policy-pinned [gates.mcp_trust].allowlist_path in the effective config wins; otherwise the MCP_ALLOWLIST_PATH env var; otherwise the default. Check fettle config --print-effective for a pinned path.

  3. 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.

  4. Phase 1 — Package Provenance & Supply Chain

    • Run npm view <package>@<version> --json to 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 audit for known CVEs
    • Present findings to user with PASS/WARN/FAIL for each check
  5. 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
  6. Phase 3 — Dependency Tree Audit

    • Count transitive dependencies
    • Check npm audit on full resolved tree
    • Flag dependencies with <100 weekly downloads or recent ownership transfers
    • Present findings to user
  7. 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
  8. Phase 5 — Permission Scoping

    • Recommend MCP tool allowlist for settings.json
    • Recommend network restrictions if supported
    • Recommend --isolated mode if available
    • Recommend output directory restrictions
    • Present recommendations to user
  9. Compute tarball SHA256. Run sha256sum on the downloaded tarball.

  10. Write audit report. Save the full audit report (all 5 phases with findings) to .fettle/audits/<package>-<version>.md with date and auditor.

  11. 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?"
  12. If approved, update the ledger via sudo. Use a Python script that:

    • Reads the current allowlist ledger
    • Adds the new package entry under packages with version, sha256_tarball (npm) or sha256_wheel (Python), audit date, auditor, report path, and approved_by_human: true; set allow_source: true only 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
  13. Confirm the ledger was updated by reading it back.

Read the full file on GitHub · 82 lines

Changes

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.

  1. today Changed · +2 lines · +7 tokens per session 2fd1d7cde6a9
  2. 9d ago First seen · 80 lines · 16 tokens per session scan A d9935d74112a

Subscribe to this mod's changes

fettle-mcp-approve is a command published in the GitHub repository MilindGaharwar/fettle (4 stars, last pushed yesterday), licensed Apache-2.0. It adds 23 tokens to every session and 1,024 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). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.