Scopeblind Mcp

io.github.tomjwxf由 GitHub 账号 tomjwxf 发布v1.0.2更新于 Oct 24, 2026

Scan, protect, and monitor APIs from AI coding tools. Device-level rate limiting.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

将 stdio MCP 服务器包装为代理,记录、限流、拦截并可对每次工具调用签名。

可以做什么
protect-mcp 作为 stdio 代理位于 MCP 客户端与 MCP 服务器之间,拦截 tools/call 的 JSON-RPC 请求,其他消息则透明转发。默认的 shadow 模式会记录每次工具调用并全部放行;配合策略文件与 enforce 参数时,可按工具执行 block、rate_limit、min_tier 等规则。配置签名后会生成 Ed25519 签名的决策回执,并可导出可离线验证的审计包。它还附带以真实事件为背景的策略包,并支持 OPA、Cerbos、Cedar 等外部策略引擎。
适用场景
当你需要了解或控制 AI 编码工具实际在 MCP 服务器上调用了什么时使用,例如先观察代理行为,再拦截破坏性工具、限制高开销工具的调用频率,或生成可签名的审计证据。主要面向在本机包装现有 stdio 服务器的桌面场景。
运行要求
需要 Node.js 与 npx 在本机以 stdio 方式运行该 npm 包。执行拦截或签名需要策略 JSON 文件;运行 init 会生成本地 Ed25519 密钥与配置模板。未声明需要账号、API 密钥或环境变量。在直接代理路径上签名不会自动启用。
安装前请注意
enforce 模式会拦截工具调用,建议先用 shadow 模式测试。策略文件可能通过环境变量名引用凭据,凭据标签会写入日志与回执。签名回执会保存在本地并通过本地 HTTP 端点暴露,审计包也可导出,分享前请确认其中内容。README 说明这是个人分支,可能落后于官方仓库。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Scopeblind Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

⚠️ This repository has moved. Active development continues at ScopeBlind/scopeblind-gateway.

This personal fork may be behind the canonical repository. Please use the org repo for issues, pull requests, and the latest code.

protect-mcp

Security gateway for MCP servers. Shadow-mode logs by default, per-tool policies, optional local Ed25519 receipts, and verification-friendly audit output.

Current CLI path: wrap any stdio MCP server as a transparent proxy. In shadow mode it logs every tools/call request and allows everything through. Add a policy file to enforce per-tool rules. Run protect-mcp init to generate local signing keys and config so the gateway can also emit signed receipts.

Quick Start

bash
# Wrap an existing OpenClaw / MCP config into a usable packnpx @scopeblind/passport wrap --runtime openclaw --config ./openclaw.json --policy email-safe
# Shadow mode — log every tool call, enforce nothingnpx protect-mcp -- node my-server.js
# Generate keys + config template for local signingnpx protect-mcp init
# Shadow mode with local signing enablednpx protect-mcp --policy protect-mcp.json -- node my-server.js
# Enforce modenpx protect-mcp --policy protect-mcp.json --enforce -- node my-server.js
# Export an offline-verifiable audit bundlenpx protect-mcp bundle --output audit.json

What It Does

protect-mcp sits between your MCP client and server as a stdio proxy:

MCP Client ←stdin/stdout→ protect-mcp ←stdin/stdout→ your MCP server

It intercepts tools/call JSON-RPC requests and:

  • Shadow mode (default): logs every tool call and allows everything through
  • Enforce mode: applies per-tool policy rules such as block, rate_limit, and min_tier
  • Optional local signing: when signing is configured, emits an Ed25519-signed receipt alongside the structured log

All other MCP messages (initialize, tools/list, notifications) pass through transparently.

What Ships Today

  • Per-tool policies — block destructive tools, rate-limit expensive ones, and attach minimum-tier requirements
  • Structured decision logs — every decision is emitted to stderr with [PROTECT_MCP]
  • Optional local signed receipts — generated when you run with a policy containing signing.key_path, persisted to .protect-mcp-receipts.jsonl, and exposed at http://127.0.0.1:9876/receipts
  • Offline verification — verify receipts or bundles with npx @veritasacta/verify
  • No account required — local keys, local policy, local process

Current Capability Boundaries

These are important before you roll this out or talk to users:

  • Signing is not automatic on the bare npx protect-mcp -- ... path. That path logs decisions in shadow mode. For local signing, run npx protect-mcp init and then start the gateway with the generated policy file.
  • Tier-aware policy checks are live, but manifest admission is not wired into the default CLI/stdio path. The CLI defaults sessions to unknown unless a host integration calls the admission API programmatically.
  • Credential config currently validates env-backed credential references and records credential labels in logs/receipts. Generic per-call injection into arbitrary stdio tools is adapter-specific and is not performed by the default proxy path.
  • External PDP adapters and audit bundle helpers exist as exported utilities. They are not yet fully wired into the default CLI path.

Policy File

json
{  "default_tier": "unknown",  "tools": {    "dangerous_tool": { "block": true },    "admin_tool": { "min_tier": "signed-known", "rate_limit": "5/hour" },    "read_tool": { "require": "any", "rate_limit": "100/hour" },    "*": { "rate_limit": "500/hour" }  },  "signing": {    "key_path": "./keys/gateway.json",    "issuer": "protect-mcp",    "enabled": true  },  "credentials": {    "internal_api": {      "inject": "env",      "name": "INTERNAL_API_KEY",      "value_env": "INTERNAL_API_KEY"    }  }}

Policy Rules

FieldValuesDescription
blocktrueExplicitly block this tool
require"any", "none"Basic access requirement
min_tier"unknown", "signed-known", "evidenced", "privileged"Minimum tier required if your host sets admission state
rate_limit"N/unit"Rate limit (e.g. "5/hour", "100/day")

Tool names match exactly, with "*" as a wildcard fallback.

MCP Client Configuration

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "my-protected-server": {      "command": "npx",      "args": [        "-y", "protect-mcp",        "--policy", "/path/to/protect-mcp.json",        "--enforce",        "--", "node", "my-server.js"      ]    }  }}

Cursor / VS Code

Same pattern — replace the server command with protect-mcp wrapping it.

CLI Options

protect-mcp [options] -- <command> [args...]protect-mcp init
Commands:  init              Generate Ed25519 keypair + config template  status            Show decision stats and local passport identity  digest            Generate a local human-readable summary  receipts          Show recent persisted signed receipts  bundle            Export an offline-verifiable audit bundle
Options:  --policy <path>   Policy/config JSON file  --slug <slug>     Service identifier for logs/receipts  --enforce         Enable enforcement mode (default: shadow)  --verbose         Enable debug logging  --help            Show help

Programmatic Hooks

The library also exposes the primitives that are not yet wired into the default CLI path:

typescript
import {  ProtectGateway,  loadPolicy,  evaluateTier,  meetsMinTier,  resolveCredential,  initSigning,  signDecision,  queryExternalPDP,  buildDecisionContext,  createAuditBundle,} from 'protect-mcp';

Use these if you want to add:

  • manifest admission before a session starts
  • an external PDP (OPA, Cerbos, or a generic HTTP webhook)
  • custom credential-brokered integrations
  • audit bundle export around your own receipt store

Decision Logs and Receipts

Every tool call emits structured JSON to stderr:

json
[PROTECT_MCP] {"v":2,"tool":"read_file","decision":"allow","reason_code":"observe_mode","policy_digest":"none","mode":"shadow","timestamp":1710000000}

When signing is configured, a signed receipt follows:

json
[PROTECT_MCP_RECEIPT] {"v":2,"type":"decision_receipt","algorithm":"ed25519","kid":"...","issuer":"protect-mcp","issued_at":"2026-03-22T00:00:00Z","payload":{"tool":"read_file","decision":"allow","policy_digest":"...","mode":"shadow","request_id":"..."},"signature":"..."}

Verify with the CLI: npx @veritasacta/verify receipt.json Verify in browser: scopeblind.com/verify

Audit Bundles

The package exports a helper for self-contained audit bundles:

json
{  "format": "scopeblind:audit-bundle",  "version": 1,  "tenant": "my-service",  "receipts": ["..."],  "verification": {    "algorithm": "ed25519",    "signing_keys": ["..."]  }}

Use createAuditBundle() around your own collected signed receipts.

Philosophy

  • Shadow first. See what agents are doing before you enforce anything.
  • Receipts beat dashboard-only logs. Signed artifacts should be independently verifiable.
  • Keep the claims tight. The default CLI path does not yet do everything the long-term architecture will support.
  • Layer on top of existing auth. Don't rip out your stack just to add control and evidence.

Incident-Anchored Policy Packs

Ship with protect-mcp — each prevents a real attack:

PolicyIncidentOWASP Categories
clinejection.jsonCVE-2025-6514: MCP OAuth proxy hijack (437K environments)A01, A03
terraform-destroy.jsonAutonomous Terraform agent destroys productionA05, A06
github-mcp-hijack.jsonPrompt injection via crafted GitHub issueA01, A02, A03
data-exfiltration.jsonAgent data theft via outbound tool abuseA02, A04
financial-safe.jsonUnauthorized financial transactionA05, A06
bash
npx protect-mcp --policy node_modules/protect-mcp/policies/clinejection.json -- node server.js

Full OWASP Agentic Top 10 mapping: scopeblind.com/docs/owasp

BYOPE: External Policy Engines

Supports OPA, Cerbos, Cedar (AWS AgentCore), and generic HTTP endpoints:

json
{  "policy_engine": "hybrid",  "external": {    "endpoint": "http://localhost:8181/v1/data/mcp/allow",    "format": "cedar",    "timeout_ms": 200,    "fallback": "deny"  }}

Standards & IP

  • IETF Internet-Draft: draft-farley-acta-signed-receipts-00 — Signed Decision Receipts for Machine-to-Machine Access Control
  • Patent Status: 4 Australian provisional patents pending (2025-2026) covering decision receipts with configurable disclosure, tool-calling gateway, agent manifests, and portable identity
  • Verification: MIT-licensed — npx @veritasacta/verify --self-test

License

MIT — free to use, modify, distribute, and build upon without restriction.

scopeblind.com · npm · GitHub · IETF Draft

来源:README.md,提交 01d2d89

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分