
mcp-audit
io.github.firatmio由 GitHub 帳號 firatmio 發布v0.1.0更新於 Oct 24, 2026
Transparent audit proxy for MCP servers: logs every tool call, flags poisoning and rug pulls.
發布方自己的服務:audit.domains - Domain Valuation
概覽
一個透明代理,置於 MCP 伺服器之前,記錄每次工具呼叫,並標記工具投毒、rug pull 與被拒絕的工具。
- 可以做什麼
- 可包裝本機 stdio MCP 伺服器,或代理遠端 HTTP 伺服器,把每個請求和回應記錄為 JSON 行,包含時間戳、伺服器、方法、工具名稱和參數。它會掃描工具描述和 schema 中的七種投毒模式,對工具做指紋以發現後續描述或 schema 變更,並可透過 RBAC 規則攔截被拒絕的呼叫並回傳 JSON-RPC 錯誤。選用 webhook 可轉送事件,本機日誌採用背壓而非丟棄事件。
- 適用情境
- 當你需要了解代理呼叫了哪些工具、傳入什麼參數時使用;也適合發現伺服器在工具描述中隱藏指令、或在核准後修改描述的情況。也可在呼叫到達上游伺服器前執行工具拒絕清單。
- 執行需求
- 以本機程序形式在使用者機器上執行,可透過 npm(mcp-audit-proxy)或下載的執行檔安裝;從原始碼建置需要 Go 1.24 或更新版本。未宣告帳號、API 金鑰或環境變數。設定為選用,讀取順序為命令列參數、MCP_AUDIT_CONFIG、./mcp-audit.yaml 或 ~/.mcp-audit/config.yaml。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 mcp-audit,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-audit
[License] [Go Reference] [Audit MCP on mcprush]
A package-lock and flight recorder for MCP tool descriptions.
An MCP server's tool descriptions go straight into your model's context, and a
server can change them at any time. mcp-audit sits transparently in front of
any MCP server and:
- pins every tool the first time it is seen, and raises an alarm on every
session after a description or schema changes, until a person reviews the
change with
mcp-audit lock diffand approves it withmcp-audit lock approve; - records every message — which tool was called, with which arguments, and what came back — to a local JSONL file;
- flags prompt injection in tool descriptions and in tool results;
- blocks only what you tell it to, with optional allow/deny rules.
Everything runs locally. No account, no cloud, no telemetry: nothing leaves your machine unless you configure a webhook. One Go binary, Apache 2.0.
That is the whole setup. No config file, nothing blocked, everything recorded.
The recording is scripts/demo.sh, which runs the whole
story end to end against a stub server, in a temp directory that leaves your
real state alone:
Install
No install needed — run it through npm, in front of the server you already use:
Or download a binary for your platform from the latest release.
Note: the npm package and the release binaries are still 0.1.0, which predates
mcp-audit lockand result scanning. Until 0.2.0 is out, build from source to get them.
Build from source — Go 1.24 or newer, no other dependencies:
Or install straight into your GOBIN:
Quick start
Local (stdio) MCP servers
Put mcp-audit run -- in front of the command you already run:
Remote (Streamable HTTP) MCP servers
Point the proxy at the upstream server and your client at the proxy:
Authentication is not touched: Authorization headers, OAuth flows and
Mcp-Session-Id all pass through exactly as they arrive.
Read the log
Every message is one JSON line:
Some things you can do with it straight away:
Connecting your MCP client
See examples/clients/ for drop-in config snippets for
Claude Desktop, Cursor and Windsurf. The pattern is always the same: keep the
command you had, and put mcp-audit run -- in front of it.
What it detects
Recording is the default. These checks run on top of it and, apart from RBAC, never block anything — they flag the event and print an alarm to stderr.
Tool poisoning
A poisoned MCP server hides instructions in a tool description. The user only
sees a tool called echo; the model reads the rest. mcp-audit scans every
advertised description and schema field for seven patterns:
How often it cries wolf
A heuristic that flags every tool gets ignored, so the false-positive rate is
measured, not guessed. testdata/corpus/benign holds the tool lists of real MCP
servers — the official reference servers, and servers published by Microsoft
(Playwright), the Chrome DevTools team, Notion, Supabase and others — captured
with scripts/corpus-capture and pinned to exact package versions.
testdata/corpus/benign-results holds real tool results: the filesystem server
reading the MCP specification. Everything is run through the same policy engine
the proxy uses, with the default configuration:
The table is generated by go test ./internal/corpus, which fails if it no
longer matches what the detectors do. Every flagged item, and the heuristic
behind it, is listed in testdata/corpus/RESULTS.md.
The result set is small and comes from a single server, so treat its rate as a
first reading rather than a settled number.
This measures false alarms only. It says nothing about how many attacks the heuristics catch: a detector that flags nothing would score 0% here too. A detection rate needs a corpus of real attacks, which does not exist here yet.
Prompt injection in tool results
A tool's description is written by the server's author. Its result is often written by nobody you trust: the issue someone filed, the page a search returned, the ticket a customer opened. Instructions in that content reach the model the same way the real data does, with no malicious server involved.
mcp-audit scans every tools/call result — text blocks, embedded resources,
resource links, structuredContent, and JSON-RPC error messages — for language
addressed to the model, and flags the event result_injection_suspect:
It uses only three of the description rules: instruction_override,
hidden_instruction and concealment. The others misfire on ordinary content:
measured on the benign results, exfiltration matched OAuth documentation
sending the user to an https:// URL and cross_tool_instruction matched
"before invoking any tool". credential_bait and invisible_characters are
left out without having misfired there, because file reads in a coding session
mention .env and ~/.ssh all the time, and zero-width joiners and tag
characters are ordinary parts of emoji.
The cost of a scan is bounded, because the stdio pump reads the next message only once it is done:
- at most the first 1 MiB of a result's JSON is walked, and at most the first 64 KiB of its text is scanned — text placed beyond that is not seen, which is the trade for a predictable cost;
- base64 payloads (images, audio, blobs) are skipped;
- results are forwarded before they are scanned, so the client never waits.
go test ./internal/policy -bench ResultScan measures it on your machine. A
result is matched to its request by id, so a response whose request the proxy
did not see is not scanned. Turn it off with policy.result_scanning: false.
Rug pulls
A rug pull is a server that advertises a harmless tool, waits for you to approve
it, and changes the description days later. mcp-audit fingerprints every tool
(SHA-256 over description + input schema) and remembers it in
~/.mcp-audit/state/tools.json, so the check survives restarts — which is the
only way it could ever catch the attack.
The approved version stays the baseline, so the alarm repeats every session
until a person looks at the change and decides. Think package-lock.json, for
tool descriptions:
lock status exits with status 1 while anything is pending, so it also works
as a CI or pre-launch check.
RBAC
The one check that can block. With no rules it allows everything; add a rule and a refused call never reaches the server — the client gets a JSON-RPC error instead.
How it compares
Other tools cover some of the same ground, and some of them cover more. What each one documents:
Read from each project's README on 2026-10-21: agent-scan v0.6,
mcp-context-protector main, P4ST4S/mcp-audit v1.3.0. A "—" means that
documentation does not describe the feature, not that the project could never
have it. Corrections are welcome as issues.
In short: agent-scan inventories everything agent-related on a machine, using
Snyk's service; mcp-context-protector enforces, blocking a server after a
change instead of only raising an alarm; P4ST4S/mcp-audit is an audit and
observability gateway. mcp-audit is the lockfile and flight recorder, and
nothing but a rule you wrote ever blocks.
Configuration
Entirely optional. See config.example.yaml for the
annotated version. mcp-audit looks for a config file in this order:
--config <path>$MCP_AUDIT_CONFIG./mcp-audit.yaml~/.mcp-audit/config.yaml
If it finds none, it uses built-in defaults and says so.
Windows paths in YAML: write them with forward slashes (
"C:/Users/you/logs.jsonl") or in single quotes ('C:\Users\you\logs.jsonl'). Inside double quotes a backslash is a YAML escape character.
Sending events elsewhere
The local JSONL log is always on. A webhook is optional and best-effort — if it is down, delivery is retried four times over about three seconds and then that event is dropped from that sink only. The local log is never affected.
CLI reference
Without --server-name, a stdio server is named after what it runs, not after
the launcher: npx -y @modelcontextprotocol/server-filesystem is
server-filesystem, uvx mcp-server-fetch is mcp-server-fetch, docker run … ghcr.io/github/github-mcp-server is github-mcp-server, and
node ./weather-server/build/index.js is weather-server. The name matters: it
is the key tool fingerprints are pinned under, so two servers must not share
one. An HTTP server is named after its --target URL.
Design guarantees
- Transparent. Every byte the client sends reaches the server unchanged, and vice versa. The only exception is a call RBAC refuses.
- The local log never loses an event. It applies backpressure rather than dropping. Every other sink is best-effort and drops instead of slowing the proxy down.
- Cheap. Parsing costs about 8µs per tool-call round trip on a modern
laptop — roughly 1/600th of the 5ms latency budget. See
ARCHITECTURE.mdfor the measurements. - A message it cannot parse is still forwarded. Auditing must never break a working MCP session.
- Detectors flag; only rules block. Rug-pull, tool-poisoning and result-injection checks raise alarms and mark events. The only thing that refuses a call is an RBAC rule you wrote.
- Nothing leaves the machine by default. The log, the tool fingerprints and every check are local. Events go elsewhere only if you configure a webhook.
Development
The race detector needs a C toolchain. On Windows, scoop install mingw (or
MSYS2) provides one; the performance assertion skips itself under -race,
since instrumented memory accesses measure the detector rather than the code.
CI runs on a self-hosted runner and therefore only on pushes to main — see
docs/ci.md for why, and for what would have to change before a
pull_request trigger would be safe. Pull requests are tested by pulling the
branch and running the suite locally.
cmd/dummy-mcp-server is a stub MCP server for testing the proxy against. It
speaks both stdio and Streamable HTTP and has flags for staging the attacks the
detectors look for:
To add a server to the false-positive corpus, capture its tool list at a pinned version, then regenerate the results and review the diff:
To capture tool results instead, add -calls calls.json (a JSON array of
{"tool": ..., "arguments": {...}}) and write to testdata/corpus/benign-results;
-redact <path> replaces a local path with <root>, and the capture refuses to
write a file that still contains your home directory. Record where the content
the calls read comes from with -content-source and -content-license.
Check the captured file for anything machine-specific before committing it, and skip servers that phone home on startup.
The module layout, the data model and the design decisions behind them are in
ARCHITECTURE.md.
License
Apache License 2.0 — free to use, modify and redistribute,
commercially included, with an explicit patent grant. See NOTICE.
來源:README.md,提交 3014778
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Audit 整合
audit.domains - Domain Valuation
domains.audit官方發布者
確定性的網域名稱估值服務:提供公允價值區間、真實可比成交紀錄、可用性查詢,以及經 DNS 驗證的待售網域市場。
Revenue Agent — OpenAPI Audit & Change Detection
news.prh官方發布者
一個遠端 MCP 端點,用於稽核 OpenAPI 規格並偵測 API 變更,每次分析透過 Base 上的 x402 收取 0.10 USDC。

SEO Audit & Broken Link Checker
由 GitHub 帳號 prometheus-maker 發布
由 Apify 託管的 MCP 伺服器,用來稽核網站頁面的 SEO 中繼資料並找出失效連結與圖片,回傳每頁評分。

FinePrint AI Legal Risk & Contract Audit MCP Server
由 GitHub 帳號 RitualDev-Lab 發布
在本機記憶體中執行的合約風險掃描器,為編碼代理評估法律合約、NDA 與租約風險並產生修訂建議。

Mcp Supply Audit
由 GitHub 帳號 kimmawla 發布
把 MCP 伺服器當成供應鏈產物來稽核:登錄檔項目、PyPI/npm 套件、用戶端設定與工具定義,全為唯讀靜態檢查。