ShadowRun
ShadowRun
一个面向 MCP 服务器的本地优先 stdio 代理。它位于 AI 代理(Claude Code、Cursor 等)和真实 MCP 服务器之间,在破坏性工具调用(写入、删除、SQL 变更等)执行之前将其拦截,并在内存中保留,直到你从本地仪表板提交或丢弃它们。
与天真的“假成功”拦截器不同,ShadowRun 在拦截的调用被解决之前不会回复代理。伪造响应(例如针对 INSERT ... RETURNING id)会让代理基于尚不存在的数据行动,并使其信念状态与现实产生分歧——因此拦截的调用只是等待(带有超时)而不是。
范围(v0.1)
这有意保持狭窄:一个面向本地 MCP 服务器(Postgres、文件系统等)的单开发者 CLI,与 Claude Code / Cursor 一起使用。它不是团队策略执行网关,没有身份验证,也没有跨重启的持久化——在依赖它处理超出自己机器范围的事情之前,请参阅下面的限制。
Related MCP server: Agentrim MCP
安装与运行
npm install
npm run build将你的代理配置指向代理而不是真实服务器:
{
"mcpServers": {
"postgres": {
"command": "node",
"args": [
"/path/to/shadowrun-mcp/dist/index.js",
"npx", "-y", "@modelcontextprotocol/server-postgres",
"postgresql://localhost:5432/devdb"
]
}
}
}打开 http://127.0.0.1:4040 查看待处理的变更,并提交或丢弃每一个。只读调用(get*、list*、search* 等)会立即通过,永远不会出现在仪表板中。
分类工作原理
参见 src/interceptor.ts — DEFAULT_CONFIG。如果工具调用的名称匹配变更动词模式(write、delete、create 等)且不首先匹配安全读取模式,或者任何字符串参数包含 SQL 变更关键字(insert into、drop table 等),则该工具调用会被拦截。这是一个启发式方法,而非保证——请参阅限制。
限制
启发式分类器。 基于工具名称和参数文本的正则表达式会遗漏巧妙命名的变更工具,并可能过度拦截名称奇怪的读取工具。请将其视为减速带,而非安全边界。
仪表板无身份验证。 它仅绑定到
127.0.0.1,但任何能够访问该端口的本地进程(或理论上进行 DNS 重新绑定的恶意页面)都可以提交/丢弃。不要在共享或不受信任的机器上运行此程序。仅内存存储。 重启代理会丢弃所有待处理的变更——代理的原始调用只会超时。
单开发者,本地使用。 没有共享的审计日志或团队范围的策略执行。如果你需要这些,请考虑使用托管的 MCP 网关。
许可证
AGPL-3.0
This server cannot be deployed
Maintenance
Related MCP Connectors
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceZero-dependency local proxy that wraps any MCP server to redact secrets, strip hidden-Unicode prompt injection, and block writes to protected paths like ~/.ssh and .env.4MIT
- AlicenseNot gradedqualityBmaintenanceA least-privilege enforcement proxy for MCP servers. It sits between MCP clients and upstream servers, enforcing tool policies, hiding denied tools, requiring human approval for risky actions, and providing a structured audit trail.MIT
- AlicenseNot gradedqualityDmaintenanceA zero-infrastructure, local proxy that wraps any stdio MCP server to add audit logging, policy enforcement with regex guards, and per-session/per-day budgets.MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP proxy that records every tool call, restores prior state on undo, and blocks irreversible actions until a human approves them.1,238 npm2MIT