mcp-pin is a tool integrity pinning tool for MCP (Model Context Protocol) servers, designed to solve the problem of "the tool you approved is not the tool you are running." It consists of two parts, a local proxy and a public log, and its core design is zero inference and deterministic hash comparison.
Purpose
MCP servers can change their tool definitions after approval, and most clients will not re-prompt. Tool descriptions are instructions that the model reads; changing a description is equivalent to changing the system prompt. mcp-pin prevents this "tool drift" by pinning the tool metadata at approval time and re-verifying it on every connection.
Key capabilities
- Local proxy: At approval time, it fingerprints all metadata of each tool (name, description, input schema, annotations) as well as the server's prompts and instructions, and re-derives them on every connection. Any change blocks the session and displays the diff. Client traffic is queued until the check completes, and nothing queued is forwarded when drift occurs. Throughout the session, every tool and prompt listing is checked against the pinned values before delivery.
- Public log: Periodically crawls MCP servers, records every version of every tool definition, and preserves history. Hash-linked, signed, downloadable, and verifiable by anyone without needing to trust the publisher.
- Deterministic checks: Instead of asking a model whether a change is dangerous, it computes hashes and compares them.
- One-click wrapping: Automatically discovers MCP servers configured in Claude Desktop, Claude Code, Cursor, VS Code, Gemini CLI, Devin Desktop, Windsurf, Cline, and Codex, backs up configuration files, and places mcp-pin in front of each local server. Remote (URL) servers are left unchanged because the proxy only supports stdio.
- Team lockfile: Commit mcp-pin.lock, which records the tool, prompt, and instruction definitions of each local server, as well as the running package version and registry digest. Team members are blocked on first run until the lockfile is updated.
- CI check: mcp-pin lock --check starts each server, compares against the lockfile, prints labels, and exits with code 1 on any change.
- Organization policy: Generates policies for the AI tools used by the organization, so that every approved local server runs through mcp-pin and is pinned to the organization's lockfile.
- As an MCP Server: mcp-pin itself is also an MCP server that provides read-only tools, allowing agents to inspect public servers before installation, or to report which servers are awaiting review after being blocked.
Usage
- Installation: published via npm (npm package name mcp-pin). mcp-pin on PyPI is an independent project and is unrelated.
- Quick start: in the client configuration, place mcp-pin before the server command. It pins on the first run and verifies on subsequent runs.
- Viewing differences: use mcp-pin review <id> in the terminal to view change details.
- Team use: run mcp-pin lock to generate a lock file, and commit mcp-pin.lock and .mcp.json.
- CI use: run npx -y mcp-pin@0.2.4 lock --check.
- Organization policy: use the mcp-pin policy command to generate a policy file.
Applicable scenarios
- Individual developers want to ensure that MCP server tool definitions are not tampered with.
- Teams share MCP configurations and need to review changes to tool definitions.
- CI processes check whether MCP server definitions and package contents have changed.
- Organizations need unified management of approved MCP servers.
Limitations
- Only stdio servers are supported; remote (HTTP) servers cannot be placed behind the proxy.
- The GitHub Action is experimental and is not recommended for adoption in CI; using a local proxy and lock file is recommended.
- Requires a Node.js environment (installed via npm).
- The public log crawler does not support pagination in versions ≤0.1.0, so records may be incomplete.
- Package version pinning in the lock file is only supported for specific package managers (npx, npm exec, pnpm dlx, yarn dlx, bunx, uvx, pipx run --spec); Docker images are only supported when the configuration pins a digest.
- Policy generation requires manual deployment of the lock file and policy file.
- No graphical interface is provided; it is mainly oriented toward the command line and configuration files.