Rohan Protocol MCP 服務推出零寫入記憶體隱私防護盾
In-memory privacy shield to prevent context leaks in MCP tools
Rohan Protocol 於 2026 年推出 MCP 服務,採用零寫入與記憶體零化設計,防止工具呼叫時的上下文洩漏與提示注入。
- 核心功能:在客戶端 RAM 內部執行工具引數,並即時零化,確保引數不會進入 LLM 上下文視窗。
本開源 MCP 服務以零寫入、零化記憶體的設計,為工具呼叫提供即時隱私防護,讓開發者可安全整合 LLM 代理,並可透過 npm 直接部署於本機或雲端環境。
官方模型上下文協定(MCP)伺服器 & 安全閘道
記憶體安全代理,防止 LLM 上下文洩漏、憑證外洩與提示注入於工具執行時。
📦 官方開源 MCP 伺服器 Monorepo
核心模型上下文協定(MCP)伺服器實作直接位於此倉庫的packages/mcp/,並以@rohan-protocol/mcp方式釋出於 npm。
從原始碼執行 • MCP 工具 • 客戶端設定 • 架構 • 安全性
⚠️ 公開測試版 (v0.6.0):Rohan 目前強制執行客戶端 RAM 證明隔離、V-01 語義政策防火牆,以及 V-02 確定性記憶體零化(zeroize),以保護 MCP 工具呼叫,同時原生客戶端 WASM ZK-SNARK 証明電路仍在積極研究中(里程碑 1)。
⚡ 問題:MCP 中的明文上下文洩漏
模型上下文協定(MCP)將自主代理連結至工具。然而,傳輸加密(TLS)僅保護傳輸中的資料——在主機邊界,標準 MCP 工具以明文執行:
🔴 WITHOUT ROHAN (Standard MCP)
Agent calls tool ➔ { "api_key": "sk_live_...", "db_password": "secret" } in plaintext
➔ Leaked directly into LLM conversation context & inference logs
➔ Permanent risk of context exfiltration & prompt injection
🟢 WITH ROHAN SHIELD
Agent calls tool ➔ Arguments evaluated strictly in isolated client RAM
➔ V-02 Zeroize wipes witness memory immediately from volatile memory
➔ Zero plaintext parameters ever enter the model context window
🛠️ 從原始碼執行 MCP 伺服器
此倉庫包含完整的開源 MCP 伺服器實作。您可以克隆並在本地使用標準 stdio 執行伺服器:
# 1. Clone the repository git clone https://github.com/rohan-protocol/sdk.git cd sdk # 2. Install dependencies & build packages npm install npm run build # 3. Start the MCP Server directly over stdio node packages/mcp/dist/server.js
或直接透過 npx 執行而不必克隆:
npx -y @rohan-protocol/mcp@latest
🔧 公開 MCP 工具
@rohan-protocol/mcp 伺服器在 JSON-RPC 上註冊標準模型上下文協定工具端點:
| MCP 工具 | 描述 | 輸入引數 |
|---|---|---|
rohan_zk_handshake |
在短暫 RAM 中評估工具執行引數,剔除提示注入,產生 32 位元的加密意圖承諾,並以無 gas 的方式將狀態轉移鎖定於 Midnight。 | targetAgentId (string), intent (string), privatePayload (object) |
🚀 通用 MCP 客戶端設定
1. Claude Desktop
將 rohan-shield 加入您的 claude_desktop_config.json:
{
"mcpServers": {
"rohan-shield": {
"command": "npx",
"args": ["-y", "@rohan-protocol/mcp@latest"],
"env": {
"ROHAN_RELAYER_URL": "https://api.rohanprotocol.network/api/v1/handshake"
}
}
}
}2. Cursor IDE & Windsurf
- 導航至 設定 → 功能 → MCP 伺服器 → 新增 MCP 伺服器。
- 將名稱設定為
rohan-shield。 - 將型別設定為
command。 - 使用命令:
npx -y @rohan-protocol/mcp@latest
📁 Monorepo 結構
rohan-protocol/sdk
├── packages/
│ ├── mcp/ # 🤖 The Official Model Context Protocol (MCP) Server (Stdio)
│ ├── sdk/ # ⚙️ Core in-memory commitment engine & relayer client
│ └── webmcp/ # 🌐 React / Next.js browser hooks with V-07 DOM isolation
├── contracts/ # 📜 Midnight Compact smart contracts (rohan_handshake.compact)
└── README.md
🏗️ 架構
┌─────────────────────────────────────────────────────────────────────────────┐
│ AUTONOMOUS AGENT RUNTIME │
│ Claude Desktop / Cursor IDE / Custom Agent Workflows │
└──────────────────────────────────────┬──────────────────────────────────────┘
│ Tool Execution (JSON-RPC)
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ [@rohan-protocol/mcp] SERVER (packages/mcp) │
│ • Stdio MCP Protocol Server: Compliant with Anthropic MCP Specification │
│ • V-01 Semantic Firewall: Filters hidden Unicode & prompt injections │
└─────────────────────────────────────┬─────────────────────────────────────┘
│ In-Memory Witness
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ [@rohan-protocol/sdk] ENGINE (packages/sdk) │
│ • Ephemeral RAM Commitment (32-Byte Intent Hash) │
│ • V-02 Deterministic Zeroize: Overwrites buffers immediately in memory │
│ • ZERO disk writes. ZERO swap-file exposure. │
└─────────────────────────────────────┬─────────────────────────────────────┘
│ Streamable HTTP (NDJSON)
│ received ➔ approved ➔ proving ➔ anchored
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ ROHAN RELAYER PAYMASTER │
│ • Gasless Transaction Sponsoring ($tDUST covered automatically) │
│ • Scale-to-Zero Native (No persistent SSE connection bottlenecks) │
└─────────────────────────────────────┬─────────────────────────────────────┘
│ Immutable Replay Protection
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ MIDNIGHT BLOCKCHAIN LEDGER │
│ Contract: rohan_handshake.compact (Preprod: 585ac0c4448257507d8ffa2a...) │
└───────────────────────────────────────────────────────────────────────────┘
🛡️ 安全登入 (威脅 & 減輕)
| 威脅 ID | 威脅向量 | 減輕機制 |
|---|---|---|
| V-01 | 對抗性提示注入 | Pre-Prover Semantic Firewall:攔截越界載荷並移除零寬Unicode注入字元 ([\u200B-\u200D\uFEFF])。 |
| V-02 | 殘餘堆疊外洩 | Deterministic Memory Zeroize:多次易失性記憶體清除,使用確定性 0x00 位元組模式覆寫證明緩衝區。 |
| V-05 | 持續性 Socket 耗盡 | Scale-to-Zero NDJSON:使用分塊 Streamable HTTP 取代長期 SSE 連線,允許代理在閒置時關閉。 |
| V-07 | DOM / WebWorker 抓取 | WebMCP 執行緒隔離:將執行緩衝區隔離於 WebWorkers,並受到惡意第三方瀏覽器擴充功能的保護。 |
📄 學術研究
加密基礎、威脅登入及正式數學證明已在我們的研究論文中記錄:
Rohan: A Stateless Zero-Knowledge Trust Gateway for Privacy-Preserving Agentic Workflows via Streamable HTTP
Model Context Protocol Working Group & Rohan Protocol Lab 於 Zenodo / IEEE Spec v2.0 發表 • DOI: 10.5281/zenodo.22730240
🤝 社群 & 貢獻
我們在公開環境中開發。
- 🐛 發現錯誤或旁路向量?開啟 GitHub Issue。
- ⭐️ 支援:考慮為本倉庫點星,協助其他開發者發現以隱私為先的 MCP 工具。
採用 MIT License 授權。由 Rohan Protocol 社群維護。