LmCast :: Stay tuned in

In-memory privacy shield to prevent context leaks in MCP tools

Recorded: Oct. 20, 2026, 4:11 p.m.

Original Summarized

GitHub - rohan-protocol/sdk · GitHub

Skip to content

Navigation MenuSign inAppearance settingsPlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesCode QualityEnforce quality at mergeAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricingSearch/Sign inSign upAppearance settings

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

rohan-protocolsdkRepository navigationCodeIssuesPull requestsActionsProjectsSecurity and qualityInsightsMore items

sdkPublicNotificationsYou must be signed in to change notification settingsFork0 (0)Star0 (0)You must be signed in to star a repositoryAboutNo description, website, or topics provided.ResourcesReadmeMIT licenseSecurity policySecurity policyActivityCustom propertiesStars0 starsWatchers0 watchingForks0 forksReport repositorymainBranchesTagsGo to fileCodeOpen more actions menuLatest commit History42 Commits42 CommitsFolders and filesNameNameLast commit messageLast commit date.agents.agents  .github/workflows.github/workflows  contractscontracts  examples/google-adkexamples/google-adk  packagespackages  .dockerignore.dockerignore  .gitignore.gitignore  DockerfileDockerfile  LICENSELICENSE  README.mdREADME.md  SECURITY.mdSECURITY.md  glama.jsonglama.json  package-lock.jsonpackage-lock.json  package.jsonpackage.json  server.jsonserver.json  smithery.yamlsmithery.yaml  View all filesRepository files navigationREADMEMIT licenseSecurityMore items
🛡️ Rohan Protocol
Official Model Context Protocol (MCP) Server & Security Gateway
The in-memory security proxy preventing LLM context leaks, credential exfiltration, and prompt injections during tool execution.

📦 Official Open-Source MCP Server Monorepo
The core Model Context Protocol (MCP) server implementation is located directly in this repository at packages/mcp/ and distributed on npm as @rohan-protocol/mcp.

Run from Source • MCP Tools • Client Setup • Architecture • Security

⚠️ Public Beta (v0.6.0): Rohan currently enforces client-side RAM witness isolation, V-01 semantic policy firewalls, and V-02 deterministic memory zeroization (zeroize) to shield MCP tool calls while native client-side WASM ZK-SNARK proving circuits are under active research (Milestone 1).

⚡ The Problem: Plaintext Context Leaks in MCP
The Model Context Protocol (MCP) connects autonomous agents to tools. However, transport encryption (TLS) only protects data in flight — at the host boundary, standard MCP tools execute in cleartext:
🔴 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

🛠️ Running the MCP Server from Source
This repository contains the complete open-source MCP server implementation. You can clone and run the server locally over standard 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
Or run directly via npx without cloning:
npx -y @rohan-protocol/mcp@latest
🔧 Exposed MCP Tools
The @rohan-protocol/mcp server registers standard Model Context Protocol tool endpoints over JSON-RPC:

MCP Tool
Description
Input Parameters

rohan_zk_handshake
Evaluates tool execution parameters in ephemeral RAM, strips prompt injections, generates a cryptographic 32-byte intent commitment, and anchors state transitions gaslessly to Midnight.
targetAgentId (string), intent (string), privatePayload (object)

🚀 Universal MCP Client Setup
1. Claude Desktop
Add rohan-shield to your 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

Navigate to Settings → Features → MCP Servers → Add New MCP Server.
Set the name to rohan-shield.
Set the type to command.
Use the command: npx -y @rohan-protocol/mcp@latest

📁 Monorepo Structure
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

🏗️ Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ 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...) │
└───────────────────────────────────────────────────────────────────────────┘

🛡️ Security Register (Threat & Mitigation)

Threat ID
Threat Vector
Mitigation Mechanism

V-01
Adversarial Prompt Injection
Pre-Prover Semantic Firewall: intercepts out-of-bounds payloads and strips zero-width Unicode injection characters ([\u200B-\u200D\uFEFF]).

V-02
Residual Heap Exfiltration
Deterministic Memory Zeroize: multi-pass volatile memory wiping overwriting witness buffers with deterministic 0x00 byte patterns.

V-05
Persistent Socket Exhaustion
Scale-to-Zero NDJSON: uses chunked Streamable HTTP instead of long-lived SSE connections, allowing proxies to spin down on idle.

V-07
DOM / WebWorker Scraping
WebMCP Thread Isolation: isolates execution buffers inside WebWorkers, shielded from malicious third-party browser extensions.

📄 Academic Research
The cryptographic foundations, threat registers, and formal mathematical proofs are documented in our research paper:

Rohan: A Stateless Zero-Knowledge Trust Gateway for Privacy-Preserving Agentic Workflows via Streamable HTTP
Model Context Protocol Working Group & Rohan Protocol Lab
Published via Zenodo / IEEE Spec v2.0 • DOI: 10.5281/zenodo.22730240

🤝 Community & Contributing
We build in the open.

🐛 Found a bug or bypass vector? Open a GitHub Issue.
⭐️ Support: consider starring the repository to help other developers discover privacy-first MCP tools.

Licensed under the MIT License. Maintained by the Rohan Protocol community.

AboutNo description, website, or topics provided.ResourcesReadmeMIT licenseSecurity policySecurity policyActivityCustom propertiesStars0 starsWatchers0 watchingForks0 forksReport repositoryReleasesPackagesUsed byContributorsLanguages

Footer

© 2026 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Community

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

The repository hosted under the GitHub account rohan-protocol/sdk presents an official open-source implementation of the Model Context Protocol (MCP) server and security gateway, collectively known as the Rohan Protocol SDK. Maintained by the Rohan Protocol community, this project is positioned as a public beta offering—currently at version v0.6.0—that provides an in-memory security proxy designed to prevent leakage of plaintext LLM context, credential exfiltration, and prompt injections during the execution of MCP tools.

At the core of the project lies the identification of a critical vulnerability in standard MCP implementations: while transport encryption such as TLS protects data in transit, MCP tools execute in cleartext at the host boundary, resulting in plaintext transmission of sensitive parameters like API keys and database passwords directly into both the LLM's conversation context and inference logs. This exposes significant risks of context exfiltration and prompt injection. The Rohan Protocol addresses this by enforcing client-side RAM witness isolation, deploying a V-01 semantic policy firewall that intercepts and strips out-of-bounds payloads and zero-width Unicode injection characters, and implementing V-02 deterministic memory zeroization that overwrites witness buffers immediately after use. These measures ensure that no plaintext parameter ever enters the model context window, thereby neutralizing the primary vector of exposure.

The architecture is organized as a monorepo comprising several packages: the `packages/mcp` directory contains the official MCP server implementation, distributed on npm as `@rohan-protocol/mcp`; the `packages/sdk` directory houses the core in-memory commitment engine and relayer client; and `packages/webmcp` includes React and Next.js browser hooks with V-07 DOM isolation. The overall design layers an autonomous agent runtime (such as Claude Desktop, Cursor IDE, or custom agent workflows) above an MCP server that acts as a security gate, which in turn relies on the SDK engine for ephemeral RAM commitment (generating a 32-byte intent hash) and deterministic zeroization, while the Rohan Relayer Paymaster handles gasless transaction sponsoring and scale-to-zero native processing via chunked Streamable HTTP NDJSON, culminating in anchoring of state transitions on the Midnight blockchain ledger, where the `rohan_handshake.compact` smart contract resides.

The MCP server registers a single exposed tool, `rohan_zk_handshake`, which operates over JSON-RPC. This tool evaluates tool execution parameters strictly within ephemeral RAM, strips prompt injection attempts, generates a cryptographic 32-byte intent commitment, and anchors state transitions gaslessly to Midnight. Its input parameters include a string `targetAgentId`, a string `intent`, and an object `privatePayload`. This tool serves as the central mechanism for enforcing the security shields during tool invocation.

To integrate the server with existing client environments, the README provides configuration instructions for Claude Desktop, Cursor IDE, and Windsurf. For Claude Desktop, users are directed to add the server to their `claude_desktop_config.json` by specifying the command `npx`, the argument `-y @rohan-protocol/mcp@latest`, and the environment variable `ROHAN_RELAYER_URL`. For Cursor and Windsurf, users navigate to Settings, Features, MCP Servers, and add the server with the same command and name. The monorepo structure is explicitly defined, with the `packages`, `contracts`, and supporting files such as `README.md`, `LICENSE`, `SECURITY.md`, and configuration files, ensuring a well-organized development environment.

Rohan Protocol formalizes its security posture through a documented threat register that maps specific threats to their corresponding mitigations. V-01 addresses adversarial prompt injection by deploying a pre-prover semantic firewall that intercepts out-of-bounds payloads and strips zero-width Unicode injection characters. V-02 mitigates residual heap exfiltration through deterministic memory zeroization, which overwrites witness buffers with deterministic 0x00 byte patterns. V-05 counters persistent socket exhaustion by employing scale-to-zero NDJSON processing using chunked Streamable HTTP, which allows proxies to spin down on idle. V-07 shields against DOM/WebWorker scraping by isolating execution buffers within WebWorkers, as implemented in the WebMCP package. These mechanisms collectively provide a robust defense-in-depth approach.

The cryptographic foundations, threat registers, and formal mathematical proofs are presented in the accompanying research paper, 'Rohan: A Stateless Zero-Knowledge Trust Gateway for Privacy-Preserving Agentic Workflows via Streamable HTTP,' published via Zenodo and IEEE Specification v2.0 with DOI 10.5281/zenodo.22730240. The project is licensed under the MIT License, allowing for open-source adoption and community contribution, with instructions available for reporting bugs and suggesting improvements through GitHub Issues.

Overall, the Rohan Protocol SDK represents a pioneering effort in privacy-first MCP tooling, balancing security with the flexibility required for autonomous agent workflows. While it remains in public beta, the repository provides a comprehensive, open-source foundation that addresses critical vulnerabilities in standard MCP implementations through a combination of memory isolation, semantic filtering, deterministic zeroization, and blockchain-anchored commitment. The project's emphasis on rigorous security and academic backing, coupled with its community-driven maintenance, positions it as a significant resource for developers and researchers seeking to build secure, context-leak-resistant agent applications.