protect-mcp
⚠️ Dieses Repository wurde verschoben. Die aktive Entwicklung wird unter ScopeBlind/scopeblind-gateway fortgesetzt.
Dieser persönliche Fork ist möglicherweise nicht auf dem Stand des kanonischen Repositorys. Bitte verwenden Sie das Organisations-Repository für Issues, Pull Requests und den neuesten Code.
protect-mcp
Sicherheits-Gateway für MCP-Server. Standardmäßig Protokollierung im Shadow-Modus, tool-spezifische Richtlinien, optionale lokale Ed25519-Belege und verifizierungsfreundliche Audit-Ausgabe.
Aktueller CLI-Pfad: Umhüllen Sie jeden stdio-MCP-Server als transparenten Proxy. Im Shadow-Modus protokolliert er jede tools/call-Anfrage und lässt alles durch. Fügen Sie eine Richtliniendatei hinzu, um tool-spezifische Regeln durchzusetzen. Führen Sie protect-mcp init aus, um lokale Signierschlüssel und Konfigurationen zu generieren, damit das Gateway auch signierte Belege ausstellen kann.
Schnellstart
# Wrap an existing OpenClaw / MCP config into a usable pack
npx @scopeblind/passport wrap --runtime openclaw --config ./openclaw.json --policy email-safe
# Shadow mode — log every tool call, enforce nothing
npx protect-mcp -- node my-server.js
# Generate keys + config template for local signing
npx protect-mcp init
# Shadow mode with local signing enabled
npx protect-mcp --policy protect-mcp.json -- node my-server.js
# Enforce mode
npx protect-mcp --policy protect-mcp.json --enforce -- node my-server.js
# Export an offline-verifiable audit bundle
npx protect-mcp bundle --output audit.jsonRelated MCP server: protect-mcp
Was es tut
protect-mcp sitzt als stdio-Proxy zwischen Ihrem MCP-Client und -Server:
MCP Client ←stdin/stdout→ protect-mcp ←stdin/stdout→ your MCP serverEs fängt tools/call JSON-RPC-Anfragen ab und:
Shadow-Modus (Standard): protokolliert jeden Tool-Aufruf und lässt alles durch
Enforce-Modus: wendet tool-spezifische Richtlinienregeln wie
block,rate_limitundmin_tieranOptionale lokale Signierung: wenn die Signierung konfiguriert ist, wird neben dem strukturierten Protokoll ein Ed25519-signierter Beleg ausgegeben
Alle anderen MCP-Nachrichten (initialize, tools/list, Benachrichtigungen) werden transparent durchgereicht.
Was heute verfügbar ist
Tool-spezifische Richtlinien — blockieren Sie destruktive Tools, begrenzen Sie die Rate teurer Tools und fügen Sie Mindest-Tier-Anforderungen hinzu
Strukturierte Entscheidungsprotokolle — jede Entscheidung wird mit
[PROTECT_MCP]anstderrausgegebenOptionale lokal signierte Belege — werden generiert, wenn Sie mit einer Richtlinie ausführen, die
signing.key_pathenthält, in.protect-mcp-receipts.jsonlgespeichert und unterhttp://127.0.0.1:9876/receiptsbereitgestelltOffline-Verifizierung — verifizieren Sie Belege oder Pakete mit
npx @veritasacta/verifyKein Konto erforderlich — lokale Schlüssel, lokale Richtlinie, lokaler Prozess
Aktuelle Funktionsgrenzen
Diese Punkte sind wichtig, bevor Sie dies einführen oder mit Benutzern sprechen:
Die Signierung erfolgt nicht automatisch auf dem einfachen
npx protect-mcp -- ...Pfad. Dieser Pfad protokolliert Entscheidungen im Shadow-Modus. Für die lokale Signierung führen Sienpx protect-mcp initaus und starten dann das Gateway mit der generierten Richtliniendatei.Tier-bewusste Richtlinienprüfungen sind aktiv, aber die Manifest-Zulassung ist nicht im Standard-CLI/stdio-Pfad integriert. Die CLI setzt Sitzungen standardmäßig auf
unknown, es sei denn, eine Host-Integration ruft die Zulassungs-API programmatisch auf.Die Anmeldeinformationskonfiguration validiert derzeit umgebungsbasierte Referenzen und zeichnet Anmeldeinformations-Labels in Protokollen/Belegen auf. Die generische Injektion pro Aufruf in beliebige stdio-Tools ist adapterspezifisch und wird vom Standard-Proxy-Pfad nicht durchgeführt.
Externe PDP-Adapter und Audit-Bundle-Helfer existieren als exportierte Dienstprogramme. Sie sind noch nicht vollständig in den Standard-CLI-Pfad integriert.
Richtliniendatei
{
"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"
}
}
}Richtlinienregeln
Feld | Werte | Beschreibung |
|
| Blockiert dieses Tool explizit |
|
| Grundlegende Zugriffsanforderung |
|
| Mindest-Tier erforderlich, falls Ihr Host den Zulassungsstatus festlegt |
|
| Ratenbegrenzung (z. B. |
Tool-Namen stimmen exakt überein, wobei "*" als Wildcard-Fallback dient.
MCP-Client-Konfiguration
Claude Desktop
Fügen Sie dies zu claude_desktop_config.json hinzu:
{
"mcpServers": {
"my-protected-server": {
"command": "npx",
"args": [
"-y", "protect-mcp",
"--policy", "/path/to/protect-mcp.json",
"--enforce",
"--", "node", "my-server.js"
]
}
}
}Cursor / VS Code
Das gleiche Muster — ersetzen Sie den Server-Befehl durch protect-mcp, das ihn umhüllt.
CLI-Optionen
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 helpProgrammatische Hooks
Die Bibliothek macht auch die Primitive verfügbar, die noch nicht in den Standard-CLI-Pfad integriert sind:
import {
ProtectGateway,
loadPolicy,
evaluateTier,
meetsMinTier,
resolveCredential,
initSigning,
signDecision,
queryExternalPDP,
buildDecisionContext,
createAuditBundle,
} from 'protect-mcp';Verwenden Sie diese, wenn Sie Folgendes hinzufügen möchten:
Manifest-Zulassung vor Beginn einer Sitzung
einen externen PDP (OPA, Cerbos oder einen generischen HTTP-Webhook)
benutzerdefinierte, durch Anmeldeinformationen vermittelte Integrationen
Audit-Bundle-Export für Ihren eigenen Belegspeicher
Entscheidungsprotokolle und Belege
Jeder Tool-Aufruf gibt strukturiertes JSON an stderr aus:
[PROTECT_MCP] {"v":2,"tool":"read_file","decision":"allow","reason_code":"observe_mode","policy_digest":"none","mode":"shadow","timestamp":1710000000}Wenn die Signierung konfiguriert ist, folgt ein signierter Beleg:
[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":"..."}Verifizieren mit der CLI: npx @veritasacta/verify receipt.json
Verifizieren im Browser: scopeblind.com/verify
Audit-Bundles
Das Paket exportiert einen Helfer für in sich geschlossene Audit-Bundles:
{
"format": "scopeblind:audit-bundle",
"version": 1,
"tenant": "my-service",
"receipts": ["..."],
"verification": {
"algorithm": "ed25519",
"signing_keys": ["..."]
}
}Verwenden Sie createAuditBundle() für Ihre eigenen gesammelten signierten Belege.
Philosophie
Shadow zuerst. Sehen Sie, was Agenten tun, bevor Sie etwas erzwingen.
Belege sind besser als reine Dashboard-Protokolle. Signierte Artefakte sollten unabhängig verifizierbar sein.
Halten Sie die Ansprüche eng. Der Standard-CLI-Pfad leistet noch nicht alles, was die langfristige Architektur unterstützen wird.
Bauen Sie auf bestehender Authentifizierung auf. Reißen Sie Ihren Stack nicht auseinander, nur um Kontrolle und Nachweise hinzuzufügen.
Vorfall-verankerte Richtlinienpakete
Werden mit protect-mcp ausgeliefert — jedes verhindert einen echten Angriff:
Richtlinie | Vorfall | OWASP-Kategorien |
| CVE-2025-6514: MCP OAuth-Proxy-Hijack (437K Umgebungen) | A01, A03 |
| Autonomer Terraform-Agent zerstört Produktion | A05, A06 |
| Prompt-Injection über manipuliertes GitHub-Issue | A01, A02, A03 |
| Datendiebstahl durch Agenten über ausgehenden Tool-Missbrauch | A02, A04 |
| Nicht autorisierte Finanztransaktion | A05, A06 |
npx protect-mcp --policy node_modules/protect-mcp/policies/clinejection.json -- node server.jsVollständige OWASP Agentic Top 10 Zuordnung: scopeblind.com/docs/owasp
BYOPE: Externe Richtlinien-Engines
Unterstützt OPA, Cerbos, Cedar (AWS AgentCore) und generische HTTP-Endpunkte:
{
"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 — Signierte Entscheidungsbelege für Machine-to-Machine-Zugriffskontrolle
Patentstatus: 4 australische vorläufige Patente angemeldet (2025-2026), die Entscheidungsbelege mit konfigurierbarer Offenlegung, Tool-Call-Gateway, Agenten-Manifeste und portable Identität abdecken
Verifizierung: MIT-lizenziert —
npx @veritasacta/verify --self-test
Lizenz
MIT — frei zu verwenden, zu ändern, zu verteilen und ohne Einschränkungen darauf aufzubauen.
scopeblind.com · npm · GitHub · IETF Draft
Available Tools
5 toolsdelete_fileB
Delete a file from the filesystem
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path to delete |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and the description does not disclose that deletion is irreversible or mention behavior for missing paths or directories, which is critical for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very short and front-loaded, but could be improved by including context about irreversibility without significant length increase.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a destructive operation with no output schema or annotations, the description lacks completeness: no mention of return values, errors, or required permissions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the parameter description 'File path to delete' is already clear; the description adds no extra meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'delete' and the resource 'file from the filesystem', distinguishing it from sibling tools like read_file (read) and write_file (write).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives, no context about prerequisites or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
deployC
Deploy the application to production
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | Deployment reason | |
| environment | Yes | Target environment |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description fails to disclose behavioral traits like destructiveness, auth requirements, or failure modes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely short (5 words), but underspecified – conciseness should not sacrifice necessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema; description does not explain return values, side effects, or deployment process outcomes.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so parameters are already well-documented. Description adds no extra meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description states 'deploy the application to production' – clear verb and resource, but slightly misleading as schema allows staging also. No confusion with sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives, no prerequisites or when-not-to-use mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_fileB
Read the contents of a file
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path to read |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description only mentions reading without specifying encoding, size limits, existence requirements, or return format, leaving behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise single-sentence description that is front-loaded and efficient with no unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite simplicity, description lacks details on return format, error handling, and behavioral constraints, which are critical for an agent invoking a file read tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a single parameter 'path' described as 'File path to read'; description adds no additional meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb 'read' and resource 'contents of a file', distinguishing it from sibling tools like write_file and delete_file.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives; usage is implied by the name and description but lacks context or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_searchC
Search the web for information
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and the description lacks details on behavior such as rate limits, result format, or limitations, leaving the agent uninformed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (one sentence) but fails to include necessary details, balancing brevity and completeness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and minimal annotations, the description does not adequately cover what the agent needs to know for successful use, such as result types or response details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Only one parameter 'query' with a schema description, and the tool description adds no additional meaning beyond what the schema already provides; high schema coverage baseline is 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Search the web for information' clearly states the verb and resource, and it distinguishes from siblings (file operations and deploy) which are unrelated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives, and no exclusions or context provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
write_fileC
Write content to a file
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path to write | |
| content | Yes | Content to write |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description does not disclose important behavioral traits such as whether the file is overwritten, permissions required, or error handling. Without annotations, the description carries the full burden, and it is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, to-the-point sentence with no wasted words. It earns its place by conveying the core action concisely.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple file write tool, the description lacks completeness. It does not mention return values, overwrite behavior, or any constraints, making it less useful for an AI agent to fully understand the tool's effect.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for both parameters, so the description adds no extra meaning. Baseline 3 is appropriate; the schema already documents path and content adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Write content to a file' clearly states the verb 'Write' and the resource 'content to a file', distinguishing it from sibling tools like read_file and delete_file. However, it does not specify whether it overwrites or appends, which would add more precision.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives. An explicit mention of use cases or exclusions (e.g., when to use deploy instead) is missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
- First observed
delete_file - First observed
deploy - First observed
read_file - First observed
web_search - First observed
write_file
TDQS
Scored across 5 tools
Each tool targets a distinct action: file operations (delete, read, write), deployment, and web search. There is no overlap or ambiguity between them.
Most tools follow verb_noun pattern (delete_file, read_file, write_file, web_search), but 'deploy' lacks a noun, breaking the consistent pattern slightly.
5 tools is a reasonable count, but the mix of file management, deployment, and web search seems odd for a single server scope.
The tool set lacks obvious necessary operations for any single domain: e.g., no update for files, no environment or config for deployment, making it incomplete for a coherent purpose.
Maintenance
Related MCP Connectors
- gatewayOAuthai.sealgate
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for offline verification of signed artifacts — receipts, manifests, and audit bundles. MIT licensed, works without accounts or API calls. Tools: self_test, verify_receipt, verify_bundle, explain_artifact.464 npm5Apache 2.0
- AlicenseNot gradedqualityAmaintenanceSecurity gateway for MCP servers. Wraps any MCP server with per-tool policies (Cedar + JSON), Ed25519-signed decision receipts, human approval gates, and trust tiers. Shadow mode by default — logs everything, blocks nothing.789 npm9MIT
- AlicenseNot gradedqualityBmaintenanceSecurity gateway for MCP tool calls. Sits between your LLM client and MCP servers, enforcing per-tool policies (allow/block/approve/read-only), logging every call, and pausing dangerous operations for human approval in terminal or Slack.2 npm1MIT
- AlicenseNot gradedqualityBmaintenanceSelf-hosted MCP gateway that applies deterministic, compiled policy to tool discovery, invocation, and outbound data flow, with no model in the enforcement path. Every decision emits a hash-chained receipt sealed with Ed25519 and verifiable using public keys only.Apache 2.0