Skip to main content
MCP server CX Codex

mcp-audit — Claude Code MCP server: what it does, how to install

mcp-audit is an Claude Code MCP server that wraps any MCP server as a proxy: it pins tool descriptions, records every call to a local log and flags injected instructions.

Apache-2.0 ★ 5 updated 2026-10-23

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add mcp-audit-proxy -- npx -y mcp-audit-proxy
Open on GitHub

What mcp-audit does

The proxy sits between a client and an MCP server and writes down everything that crosses it: tool name, arguments, response. Tool descriptions and schemas get pinned the first time they appear. Change one later and every new session raises an alarm until someone reads the diff with mcp-audit lock diff and clears it with mcp-audit lock approve.

Detectors for rug-pull, tool-poisoning and result-injection run on top of the recording and print a warning to stderr. Only an allow or deny rule stops a call. The scanner looks for requests to keep quiet, paths like ~/.ssh or .env, sends to an outside URL, and invisible characters.

A local server gets wrapped with mcp-audit run -- <command>; a remote one goes through mcp-audit serve --target https://example.com/mcp --listen :9000. Events land in ~/.mcp-audit/logs/events.jsonl, one JSON line each, and nothing is sent anywhere unless a webhook is configured. A source build takes Go 1.24 or newer; the npm package and release binaries sit at 0.1.0, so mcp-audit lock and result scanning come only from that build.

What it helps with

  • catch a tool description that changed between sessions
  • log which tools an agent called and with what arguments
  • stop a call with an allow or deny rule
  • find injected instructions in a tool description or its output
  • inspect a flagged change with mcp-audit lock diff before approving it

Example prompts for the agent

  • Read the log at ~/.mcp-audit/logs/events.jsonl and list the tools called in the last session with their arguments
  • Run mcp-audit lock diff and tell me whether the echo tool description changed
  • Start npx mcp-audit-proxy run -- npx -y @modelcontextprotocol/server-filesystem /tmp and show what ends up in the log

How to install mcp-audit

Platform CLI

claude mcp add mcp-audit-proxy -- npx -y mcp-audit-proxy

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about mcp-audit

How do I install mcp-audit in Claude Code?

Run claude mcp add mcp-audit -- npx -y mcp-audit-proxy. The client pulls the package through npx, so there is nothing else to install.

What does mcp-audit do?

It acts as a proxy in front of an MCP server: pins tool descriptions, records calls into a local JSONL log, and marks description swaps and injected instructions in results.

What do I need to run mcp-audit?

The npx route runs without installing anything. A build from source needs Go 1.24 or newer and no other dependencies.

Similar MCP servers

All MCP servers for Security →

Project sponsors

Companies that keep this analytics open