Metadata-Version: 2.5
Name: mcp-shield-proxy
Version: 0.1.0
Summary: Enterprise runtime security gateway, shadow isolation, and honeytoken framework for the Model Context Protocol (MCP).
License: MIT License
        
        Copyright (c) 2026 The Blue Pheonix
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.115.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp[cli]>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: uvicorn[standard]>=0.30.0
Requires-Dist: websockets>=12.0
Description-Content-Type: text/markdown

# MCP-Shield

**Runtime security gateway, shadow workspace isolation, and active honey-token deception for the Model Context Protocol (MCP).**

MCP-Shield protects AI coding agents against indirect prompt injection, silent credential exfiltration, test-suite RCE, and mid-session tool rug-pulls without modifying your existing MCP servers.

---

## Quickstart

```bash
pip install mcp-shield-proxy
```

### 1. Audit & Wrap Your Agent Config

Scan your existing MCP client configuration for Lethal Trifecta risks and generate a shielded configuration (`<config>.shield.json`):

```bash
mcp-shield init --config mcp_config.json
```

### 2. Launch the Control Server & Web Console

Run inside your target project directory:

```bash
mcp-start
```

Opens the live security console at `http://127.0.0.1:8000` (use `--no-browser` or `--project-dir <path>` to customize).

### 3. Check Resolved Paths

```bash
mcp-shield status
```

---

## Core Security Pillars

1. **SHA-256 Tool Pinning**: Fingerprints every tool's name, description, and input schema on `tools/list`. Mid-session schema or description mutations trigger an immediate `RUG_PULL_DETECTED` block (`-32002`).
2. **Shadow Copy Isolation**: Once a session reads untrusted external data (`UNTRUSTED_READ`), writes and safe reads are transparently redirected into an isolated shadow workspace (`~/.mcp-shield/temp_shadows/<session_id>`) while real `.env` files remain untouched.
3. **Offline Docker Sandbox**: Terminal commands (`run_terminal`) execute inside a network-disabled (`--network=none`), resource-capped Docker container (`mcp-shield-sandbox`) mounted strictly to the shadow workspace.
4. **Honey-Token Deception & Exit-Door Freeze**: Sensitive file reads (`.env`, `.ssh`, `id_rsa`, `secrets`) serve per-session decoy honey-tokens. Outbound `EXIT_DOOR` calls (`post_comment`, `send_email`, `git_push`) are scanned across raw, reversed, URL-encoded, and Base64 forms (`TRAP_TRIGGERED`), and clean exit calls freeze for explicit human approval.

