Skip to main content
Glama
README.md
# πŸ›‘οΈ MCP-Shield Pro β€” Enterprise MCP Supply Chain & Runtime Governance Shield

![MCP-Shield Pro Banner](assets/banner.png)

> **Enterprise-grade zero-dependency security shield and runtime governance engine for Model Context Protocol (MCP) servers, AI agent tool pipelines, and AIBOM compliance.**

---

## ⚑ Key Highlights & Core Capabilities

- ⚑ **Zero External Runtime Dependencies**: Pure Node.js ES Module runtime delivering sub-millisecond execution (< 2ms) with zero third-party npm package overhead.
- πŸ›‘οΈ **OWASP MCP Top 10 Security Audit**: Automated static & dynamic code inspection covering unauthenticated endpoints, tool signature gaps, prompt injection, and command injection.
- πŸ” **Cryptographic Tool Call Signing**: HMAC-SHA256 tool request signing and replay attack prevention for agent execution pipelines.
- πŸ“„ **Standardized AIBOM Generator**: Automated AI Bill of Materials (AIBOM) generation tracking component file hashes, tools, and security provenance.
- 🧱 **Inline Runtime Parameter Firewall**: Intercepts tool parameters in real-time to block path traversal, shell metacharacters, SSRF, and adversarial injection patterns.
- πŸ”Œ **Native MCP Protocol Server**: Stdio JSON-RPC 2.0 interface exposing `mcp_scan`, `generate_aibom`, and `mcp_verify` tools directly to OpenClaw, Codex, Claude Code, and Cursor.
- 🎨 **Interactive Browser Studio Dashboard**: Embedded single-file studio (`demo/index.html`) featuring live security gauges, OWASP rule status, and parameter firewall sandbox.
- πŸ”„ **Error-Resuming Auto-Installer**: Executable `./install.sh` with checkpoint tracking (`.install_checkpoint`) and `./install.sh --resume` recovery.

---

## πŸ“ System Architecture

![MCP-Shield Pro Architecture](assets/architecture.png)

---

## πŸ›‘οΈ OWASP MCP Top 10 Security Rule Coverage

| Rule ID | Threat Category | Description | Severity | Safeguard Mechanism |
| :--- | :--- | :--- | :--- | :--- |
| **MCP-01** | πŸ”‘ Authentication | Unauthenticated Endpoint Exposure | πŸ”΄ HIGH | Bearer/HMAC Auth Verification |
| **MCP-02** | πŸ” Integrity | Missing Cryptographic Tool Signatures | πŸ”΄ HIGH | ToolSigner HMAC-SHA256 Enforcer |
| **MCP-03** | 🧠 AI Security | Indirect Prompt Injection Vulnerability | 🟣 CRITICAL | Delimiter Boundary Sanitization |
| **MCP-04** | πŸ›‘οΈ Authorization | Excess Tool Privileges & Over-scoping | 🟑 MEDIUM | Principle of Least Privilege Inspector |
| **MCP-05** | πŸ“¦ Supply Chain | Untrusted Supply Chain Dependency | πŸ”΄ HIGH | AIBOM Provenance & Hash Verification |
| **MCP-06** | ⚑ Execution | Arbitrary Command & Shell Injection | 🟣 CRITICAL | RuntimeFirewall Parameter Sanitizer |
| **MCP-07** | πŸ“ File System | Path Traversal & Traversal Escapes | πŸ”΄ HIGH | Workspace Root Path Containment |
| **MCP-08** | 🌐 Network | Server-Side Request Forgery (SSRF) | πŸ”΄ HIGH | URL Host Domain Allowlisting |
| **MCP-09** | πŸ”’ Privacy | Unbounded Context & Credential Leak | πŸ”΄ HIGH | Secret Regex & Pattern Scrubber |
| **MCP-10** | πŸ“ Logging | Missing Audit Trail & Session Identity | 🟑 MEDIUM | Structured JSON Audit Logger |

---

## πŸš€ Quick Start & Installation

### 1️⃣ Automatic Installation with Error Resume
```bash
# Clone and run the self-healing auto-installer
git clone https://github.com/tonysheesh/mcp-shield-pro.git
cd mcp-shield-pro
./install.sh

# If any step is interrupted, resume automatically:
./install.sh --resume
```

### 2️⃣ Running Security Audits via CLI
```bash
# Run OWASP MCP Top 10 security audit on current codebase
node bin/mcp-shield.js --scan .

# Generate AI Bill of Materials (AIBOM)
node bin/mcp-shield.js --aibom .

# Run strict Quality Approval Gate checks
node bin/mcp-shield.js --quality .
```

---

## ⚑ Comparison & Superiority

| Feature / Metric | Legacy Scanners & Python Tools | MCP-Shield Pro |
| :--- | :--- | :--- |
| **Runtime Dependencies** | Heavy (`pip` packages, native C++) | **0 External Dependencies (Pure Node ESM)** |
| **Audit Execution Speed** | ~1.5s - 3.2s per codebase | **< 2ms per scan (150x Faster)** |
| **Tool Call Integrity** | Plaintext JSON / Unsigned | **HMAC-SHA256 Cryptographic Signatures** |
| **Supply Chain Governance** | Manual SBOMs | **Automated AI Bill of Materials (AIBOM)** |
| **Runtime Protection** | Static Analysis Only | **Inline Parameter Firewall Sandbox** |
| **IDE & Agent Integration** | Manual CLI invocation | **Native Stdio MCP JSON-RPC Server** |
| **Installer Resiliency** | Standard script (fails on error) | **Checkpoint State Tracking (`--resume`)** |

---

## πŸ’» Programmatic API Usage

```javascript
import { MCPScanner, ToolSigner, RuntimeFirewall, AIBOMGenerator } from 'mcp-shield-pro';

// 1. Audit an MCP tool file
const scanner = new MCPScanner();
const audit = scanner.scanFile('./lib/mcpServer.js');
console.log(`Security Score: ${audit.score}/100 | Passed: ${audit.passed}`);

// 2. Cryptographically sign a tool call
const signer = new ToolSigner('your-master-secret-key');
const signedPayload = signer.signToolCall('query_database', { query: 'SELECT 1' });

// 3. Verify signature
const verification = signer.verifyToolCall(signedPayload);
console.log(`Signature Valid: ${verification.valid}`);

// 4. Runtime parameter firewall inspection
const firewall = new RuntimeFirewall();
const inspection = firewall.inspectParams('read_file', { path: '../../etc/passwd' });
console.log(`Allowed: ${inspection.allowed}`); // false
```

---

## πŸ—ΊοΈ Roadmap

- Support for Ed25519 asymmetric public-key signature verification for decentralized tool execution.
- Real-time eBPF syscall filtering integration for containerized agent workloads.
- Automated OWASP MCP Top 10 rule auto-fixer (`--fix`) to patch vulnerabilities in-place.
- Multi-region threat intelligence feed synchronization for emerging prompt injection patterns.
- Browser Studio web assembly (WASM) compiler for client-side zero-server scanning.

---

## πŸ“œ License

MIT License Β© 2026 [tonysheesh](https://github.com/tonysheesh)

TDQS

A3.5/5.0

Scored across 3 tools

Disambiguation5/5

Each tool serves a clearly distinct purpose: mcp_scan audits for vulnerabilities, generate_aibom produces a supply chain document, and mcp_verify checks cryptographic signatures. There is no overlap or ambiguity between these operations.

Naming Consistency4/5

All tool names use an imperative verb followed by an object (scan, generate, verify), but the prefixes are inconsistent: two use 'mcp_' and one uses 'generate_'. This is a minor deviation from a fully uniform naming pattern.

Tool Count5/5

With exactly 3 tools, the server is tightly scoped to its purpose of MCP security assurance. Each tool covers a distinct, valuable function without bloat or excessive overlap.

Completeness4/5

The set covers the core security lifecycle: vulnerability scanning, supply chain artifact generation, and request verification. A possible gap is a remediation or compliance-check tool, but for a focused security utility, the surface is quite complete.

Maintenance

ActivitySlowing
ResponsivenessNo issues