Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    MCP Config & Tool-Rug-Pull Hash Lock

    1

    MCP safety gate: audits MCP configs for unpinned npx/uvx servers, plaintext secrets and missing transport types, and locks tool definitions with SHA-256 so silent tool-description edits (rug pulls) fail verification. Offline Python stdlib.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    MCP Config & Tool-Rug-Pull Hash Lock

    Example session with this skill installed

    Audit my current .mcp.json file for security risks and then lock the current tool definitions from tools_list.json into a new lockfile.

    • Read your context and instructions
    • Compiled the mcp config

    I have completed the MCP security audit and generated the tool lockfile.

    MCP Security Audit & Lock Results

    The configuration audit identified no critical risks in your .mcp.json. All server versions are pinned, and environment variables are properly used for secrets. I have also generated a deterministic SHA-256 lockfile for your tool definitions.

    Audit Summary

    RuleStatusFinding
    UNPINNED_SERVER[PASS]All npx / uvx packages use @x.y.z pinning.
    PLAINTEXT_SECRET[PASS]No raw tokens detected; ${VAR} indirection found.
    MISSING_TYPE[PASS]All servers declare valid transport types and endpoints.

    Lockfile Generation

    The tools.lock.json has been created with the following SHA-256 digests:

    • fetch_web_content: a7d2...f912 (locked)
    • search_database: 33e1...bb04 (locked)
    • execute_script: c889...e221 (locked)

    Next steps

    1. Commit the tools.lock.json to your repository to establish the security baseline.
    2. Integrate python scripts/mcp_hash_lock_gate.py verify into your CI pipeline.
    3. If a RUG_PULL_DETECTED error occurs, manually inspect the tool description diffs before re-locking.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Above-the-Fold Hook (3-Second Value)

    Stop connecting AI coding agents to unpinned npx/uvx MCP servers with hardcoded tokens—and catch silent MCP tool rug-pulls before a mutated tool description hijacks your agent.

    MCP Config & Tool-Rug-Pull Hash Lock delivers a deterministic 3-layer MCP security guardrail (SKILL.md 2-job workflow + JSON Schema Draft 2020-12 contracts + zero-dependency Python 3 stdlib hash-lock engine) that audits .mcp.json / mcpServers configs for UNPINNED_SERVER, PLAINTEXT_SECRET, and MISSING_TYPE, pins every approved tools/list definition ({name, description, inputSchema}) to a canonical SHA-256 lockfile offline, and exits 1 ([BLOCKED]) with exact field-level diffs on any RUG_PULL_DETECTED, TOOL_ADDED, or TOOL_REMOVED.


    What's Inside (3-Layer Architecture + 60-Second Test Pack)

    • Layer 1 — 2-Job MCP Security SOP (SKILL.md): Strict numbered workflow for Claude Code, Cursor, and Codex CLI enforcing Job A (MCP Config Audit) and Job B (Tool-Definition SHA-256 Lockfile & Rug-Pull Verification) with fail-closed hard gates (exit 1 on any violation, zero auto-relocking).
    • Layer 2 — JSON Schema Draft 2020-12 Contracts (schemas/):
      • schemas/mcp_lockfile.schema.json: Strictly typed SHA-256 lockfile contract (lockfile_version, generated_at, hash_algorithm, tool_count, and tools map of tool_name -> sha256 + description_sha256, input_schema_sha256, canonical_bytes, description_length, and input_schema_keys).
      • schemas/audit_report.schema.json: Machine-readable report contract (mode, status, exit_code, generated_at, summary, findings, diffs) emitted by --json and --out-report across all three subcommands.
    • Layer 3 — Zero-Dependency Hash-Lock Gate (scripts/mcp_hash_lock_gate.py): 100% Python 3 standard library (argparse, datetime, hashlib, json, pathlib, re, sys, typing) with three subcommands:
      • audit-config: Scans .mcp.json / mcpServers (or servers) for UNPINNED_SERVER (npx / uvx without explicit @x.y.z or ==x.y.z), PLAINTEXT_SECRET (raw tokens >= 20 chars or secret prefixes such as sk-, ghp_, xoxb-, eyJ, Bearer , while allowing ${ENV_VAR} placeholders and redacting exposed values in output), and MISSING_TYPE (missing or inconsistent type / command / url).
      • lock: Serializes each tool's {name, description, inputSchema} from exported tools/list JSON (supporting both {"tools": [...]} and {"result": {"tools": [...]}}) into deterministic canonical JSON and writes a SHA-256 lockfile (exit 0).
      • verify: Compares current tools/list JSON against the lockfile and exits 1 ([BLOCKED]) on RUG_PULL_DETECTED (reporting exact changed fields—description and/or inputSchema—plus old -> new short SHA-256 hashes), TOOL_ADDED, or TOOL_REMOVED. Exits 0 ([PASS]) only on a 100% match.
    • 60-Second Test Pack (examples/):
      • examples/mcp_config_fail.json: Risky MCP config planting 1 UNPINNED_SERVER (npx -y @acme/filesystem-mcp) and 1 PLAINTEXT_SECRET (env.GITHUB_TOKEN synthetic token).
      • examples/mcp_config_pass.json: Hardened MCP config with exact version pins (@2.1.0, @1.4.2), ${GITHUB_TOKEN} indirection, and explicit type fields (stdio and http).
      • examples/tools_v1.json & examples/tools_v1.lock.json: Baseline 3-tool tools/list export (read_doc, search_notes, list_files) and its generated SHA-256 lockfile.
      • examples/tools_v2_fail.json: Mutated tools/list export planting 1 RUG_PULL_DETECTED (read_doc description silently edited with a hidden exfiltration prompt) and 1 TOOL_ADDED (export_env_debug).

    Who This Is For & Prerequisites

    Built for:

    • Engineering, DevSecOps, and AI platform teams using MCP servers in Claude Code, Cursor, or Codex CLI who want deterministic supply-chain and rug-pull verification offline.
    • Solo developers and security reviewers auditing third-party .mcp.json configurations and pinning MCP tool schemas in Git/CI without installing external security packages.

    Prerequisites:

    • Python 3.9+ (uses Python 3 standard library only — zero pip install, zero external packages, zero network calls).
    • Works cross-platform on Windows (pure ASCII cp1252-safe output), macOS, and Linux.

    60-Second Quick-Start

    Run directly from the skill folder:

    # 1. Audit risky MCP config (catches UNPINNED_SERVER + PLAINTEXT_SECRET, exit 1)
    python scripts/mcp_hash_lock_gate.py audit-config --config examples/mcp_config_fail.json
    
    # 2. Audit hardened MCP config (pinned versions + ${GITHUB_TOKEN} + explicit type, exit 0)
    python scripts/mcp_hash_lock_gate.py audit-config --config examples/mcp_config_pass.json
    
    # 3. Generate deterministic SHA-256 lockfile from approved baseline tools/list (exit 0)
    python scripts/mcp_hash_lock_gate.py lock --tools examples/tools_v1.json --out examples/tools_v1.lock.json
    
    # 4. Verify baseline tools/list against lockfile (100% SHA-256 match, exit 0)
    python scripts/mcp_hash_lock_gate.py verify --tools examples/tools_v1.json --lock examples/tools_v1.lock.json
    
    # 5. Verify mutated tools/list against lockfile (catches RUG_PULL_DETECTED + TOOL_ADDED, exit 1)
    python scripts/mcp_hash_lock_gate.py verify --tools examples/tools_v2_fail.json --lock examples/tools_v1.lock.json
    

    Real Terminal Proof

    1. Job A (audit-config) — Catching Unpinned npx Server & Plaintext Token (exit code 1)

    $ python scripts/mcp_hash_lock_gate.py audit-config --config examples/mcp_config_fail.json
    ============================================================================
    MCP CONFIG & TOOL-RUG-PULL HASH LOCK -- CONFIG AUDIT REPORT
    ============================================================================
    Mode            : audit-config
    Config Target   : examples/mcp_config_fail.json
    Servers Scanned : 2
    Total Findings  : 2
    ----------------------------------------------------------------------------
    Rule Counts     : PLAINTEXT_SECRET=1, UNPINNED_SERVER=1
    
    Findings:
      1. [HIGH] UNPINNED_SERVER (server=filesystem, field=args)
         Detail: Server 'filesystem' runs unpinned npx package '@acme/filesystem-mcp' (missing exact @x.y.z version pin).
         Fix   : Pin '@acme/filesystem-mcp' to an exact version such as '@acme/filesystem-mcp@1.0.0' instead of floating/latest resolution.
      2. [CRITICAL] PLAINTEXT_SECRET (server=github, field=env.GITHUB_TOKEN)
         Detail: Server 'github' stores plaintext secret in env.GITHUB_TOKEN (matches secret prefix 'ghp_': ghp_*** (len=38)).
         Fix   : Replace hardcoded secret with environment variable indirection '${GITHUB_TOKEN}' and rotate the exposed credential.
    ----------------------------------------------------------------------------
    [BLOCKED] Config audit failed: 2 security violation(s) detected.
    ============================================================================
    # Exit code: 1
    

    2. Job A (audit-config) — Clean Hardened MCP Config Approved (exit code 0)

    $ python scripts/mcp_hash_lock_gate.py audit-config --config examples/mcp_config_pass.json
    ============================================================================
    MCP CONFIG & TOOL-RUG-PULL HASH LOCK -- CONFIG AUDIT REPORT
    ============================================================================
    Mode            : audit-config
    Config Target   : examples/mcp_config_pass.json
    Servers Scanned : 3
    Total Findings  : 0
    ----------------------------------------------------------------------------
    [PASS] Config audit approved: 0 findings across 3 MCP server(s).
    ============================================================================
    # Exit code: 0
    

    3. Job B (lock) — Generating Canonical SHA-256 Tool Lockfile (exit code 0)

    $ python scripts/mcp_hash_lock_gate.py lock --tools examples/tools_v1.json --out examples/tools_v1.lock.json
    ============================================================================
    MCP CONFIG & TOOL-RUG-PULL HASH LOCK -- LOCKFILE GENERATOR
    ============================================================================
    Mode            : lock
    Tools Source    : examples/tools_v1.json
    Lockfile Output : examples/tools_v1.lock.json
    Hash Algorithm  : sha256
    ----------------------------------------------------------------------------
    Locked Tool Digests (canonical {name, description, inputSchema}):
      [LOCKED] list_files               sha256=f5f35398f8b6... (bytes=239)
      [LOCKED] read_doc                 sha256=2af52fcb1b35... (bytes=301)
      [LOCKED] search_notes             sha256=bdc79f59beac... (bytes=332)
    ----------------------------------------------------------------------------
    [PASS] Lockfile written: 3 tool(s) pinned with SHA-256.
    ============================================================================
    # Exit code: 0
    

    4. Job B (verify) — Baseline Tools Match Lockfile 100% (exit code 0)

    $ python scripts/mcp_hash_lock_gate.py verify --tools examples/tools_v1.json --lock examples/tools_v1.lock.json
    ============================================================================
    MCP CONFIG & TOOL-RUG-PULL HASH LOCK -- RUG-PULL VERIFICATION
    ============================================================================
    Mode            : verify
    Tools Target    : examples/tools_v1.json
    Lockfile        : examples/tools_v1.lock.json
    Tool Counts     : Scanned=3 | Locked=3 | Matched=3 | Diffs=0
    ----------------------------------------------------------------------------
    [PASS] Verification approved: 3/3 tool(s) match locked SHA-256 digests 100%.
    ============================================================================
    # Exit code: 0
    

    5. Job B (verify) — Blocking Silent Tool Rug-Pull & Unapproved Tool Addition (exit code 1)

    $ python scripts/mcp_hash_lock_gate.py verify --tools examples/tools_v2_fail.json --lock examples/tools_v1.lock.json
    ============================================================================
    MCP CONFIG & TOOL-RUG-PULL HASH LOCK -- RUG-PULL VERIFICATION
    ============================================================================
    Mode            : verify
    Tools Target    : examples/tools_v2_fail.json
    Lockfile        : examples/tools_v1.lock.json
    Tool Counts     : Scanned=4 | Locked=3 | Matched=2 | Diffs=2
    ----------------------------------------------------------------------------
    Diff Counts     : RUG_PULL_DETECTED=1, TOOL_ADDED=1
    
    Detected Tool Diffs:
      1. [HIGH] TOOL_ADDED (tool=export_env_debug, changed=added)
         Hash  : <none> -> 2511aa7d1ff8
         Detail: Unexpected unapproved tool 'export_env_debug' appeared (sha256=2511aa7d1ff8 not in lockfile).
         Fix   : Audit 'export_env_debug' description and inputSchema for unauthorized capabilities; do not re-lock until approved by a human reviewer.
      2. [CRITICAL] RUG_PULL_DETECTED (tool=read_doc, changed=description)
         Hash  : 2af52fcb1b35 -> c77a06899eaf
         Detail: Tool 'read_doc' SHA-256 hash changed (changed: description; 2af52fcb1b35 -> c77a06899eaf).
         Fix   : BLOCK execution of 'read_doc'. Inspect the upstream diff in description for prompt injection or schema tampering before any manual re-lock.
    ----------------------------------------------------------------------------
    [BLOCKED] Verification failed: 2 issue(s) detected. Do NOT execute mutated or unapproved tools.
    ============================================================================
    # Exit code: 1
    

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Requires Python 3 environment. Human review is mandatory before locking or re-locking definitions. Does not automatically fix config errors.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Software
    serversuv (Python tool runner)Python@acme/filesystem-mcpNode.jsserver

    Permissions

    Terminal / Shell
    Write Files
    Network Access
    Listedtoday

    What's inside

    Frequently Asked Questions

    It prevents 'tool rug-pulls' where a remote server changes a tool's description or schema after you've approved it, potentially injecting malicious instructions into your LLM workflow. Additionally, it audits your configuration files to flag unpinned packages and exposed plaintext secrets before they become security risks.

    The skill is designed to work with any Model Context Protocol (MCP) compatible environment, including Claude Code, Cursor, and Codex CLI. It requires a standard Python 3 installation to run the deterministic hashing engine.

    Setup is straightforward: run the 'audit-config' tool to check your existing setup, then use the 'lock' command to generate SHA-256 digests of your approved tool definitions. These hashes serve as a permanent baseline for future verification.

    No, this skill provides a deterministic security gate using Python's standard library to ensure 100% accuracy. Unlike LLM-based auditing, which can suffer from hallucinations, this tool uses exact SHA-256 matching to detect even a single character change in a tool's schema.

    You receive the full Python-based security engine, including the audit, lock, and verify commands. The package also includes documentation on integrating these tools into your CI/CD pipelines for automated security gating.

    New in Security