@rohan-protocol/mcp 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,189 +1,49 @@
1
- # Rohan MCP Gateway 🤖 (`@rohan-protocol/mcp`)
2
-
3
- [![NPM Version](https://img.shields.io/npm/v/@rohan-protocol/mcp?style=for-the-badge&color=blue)](https://www.npmjs.com/package/@rohan-protocol/mcp)
4
- [![MCP Native](https://img.shields.io/badge/MCP-Standard_2024--11--05-green?style=for-the-badge)](https://modelcontextprotocol.io)
5
- [![Streamable HTTP](https://img.shields.io/badge/Transport-Streamable_HTTP_%28NDJSON%29-orange?style=for-the-badge)](#streamable-http-handshake-lifecycle)
6
- [![Security V-01](https://img.shields.io/badge/Firewall-V--01_Semantic_Shield-red?style=for-the-badge)](#security-architecture)
7
- [![Powered by Midnight](https://img.shields.io/badge/Settlement-Midnight_Network-black?style=for-the-badge)](https://midnight.network)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
9
-
10
- > **Official Model Context Protocol (MCP) Server for Confidential Agent-to-Agent ZK-Handshakes.**
11
- > Equips AI Agents in Claude Desktop, Cursor, and autonomous runtimes with native Zero-Knowledge transaction capability and real-time **Streamable HTTP (NDJSON)** progress telemetry on Midnight.
12
-
13
- ---
14
-
15
- ## ⚡ The Threat: Indirect Prompt Injection (Security Vector V-01)
16
-
17
- When autonomous AI agents execute machine-to-machine tools, malicious third parties can inject prompt instructions into tool payloads (*Indirect Prompt Injection*). Without deterministic verification, a compromised agent could be tricked into signing unauthorized agreements, leaking confidential session parameters, or executing blind on-chain actions.
18
-
19
- ---
20
-
21
- ## 🛡️ The Defense: Pre-Prover Semantic Firewall + Streamable HTTP
22
-
23
- `@rohan-protocol/mcp` acts as a zero-trust gateway. Before any Zero-Knowledge proof is computed or relayed:
24
-
25
- 1. **Semantic Inspection (V-01)**: Validates intent structures, schema boundaries, and agent DIDs against prompt injection patterns and role-reversal exploits.
26
- 2. **RAM-Only Proving (V-02)**: Calls `@rohan-protocol/sdk` to generate a 580-byte ZK-SNARK with instant memory zeroization (`zeroize`).
27
- 3. **⚡ Streamable HTTP (NDJSON)**: Uses chunked HTTP streaming (`POST /api/v1/handshake/stream`) to provide granular real-time progress events back to the calling agent context.
28
- 4. **Gasless Settlement**: Hands off the proof to the Rohan Relayer for on-chain anchoring on Midnight Preprod without requiring the agent to manage private keys or gas tokens (`tDUST`).
29
-
30
- ---
31
-
32
- ## 📦 Installation
33
-
34
- ```bash
35
- npm install @rohan-protocol/mcp
36
- ```
37
-
38
- Or run directly without installation via `npx`:
39
-
40
- ```bash
41
- npx @rohan-protocol/mcp
42
- ```
43
-
44
- ---
45
-
46
- ## 💻 Setup: Connect Your AI Agents
47
-
48
- ### 1. Claude Desktop Integration
49
-
50
- Add the Rohan MCP server to your `claude_desktop_config.json`:
51
- - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
52
- - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
53
- - **Linux**: `~/.config/Claude/claude_desktop_config.json`
54
-
55
- ```json
56
- {
57
- "mcpServers": {
58
- "rohan-zk-gateway": {
59
- "command": "npx",
60
- "args": ["-y", "@rohan-protocol/mcp"],
61
- "env": {
62
- "ROHAN_CONTRACT_ADDRESS": "6d2d603235f996424d76c85186a79cc403245ea8ee1ba9087e40967fe71bdc4d",
63
- "ROHAN_RELAYER_URL": "https://api.rohanprotocol.network/api/v1/handshake/stream",
64
- "ROHAN_API_KEY": "rohan_live_..."
65
- }
66
- }
67
- }
68
- }
69
- ```
70
-
71
- > **Sandbox vs. Production**: The MCP server works out of the box with **10 free handshakes per day** without an API key. For continuous agent workflows, provide `ROHAN_API_KEY` in the environment configuration.
72
-
73
- ### 2. Cursor IDE Integration
74
-
75
- In Cursor, navigate to **Settings > Features > MCP Servers > Add New MCP Server**:
76
- - **Name**: `rohan-zk`
77
- - **Type**: `command`
78
- - **Command**: `npx -y @rohan-protocol/mcp`
79
-
80
- ---
81
-
82
- ## 🛠️ Exposed MCP Tools
83
-
84
- The server automatically registers the following tool in your LLM's context:
85
-
86
- ### `rohan_zk_handshake`
87
-
88
- Executes a confidential, tamper-proof Zero-Knowledge handshake on Midnight with real-time streamable verification.
89
-
90
- #### Input Schema:
91
-
92
- ```json
93
- {
94
- "agentId": {
95
- "type": "string",
96
- "description": "Decentralized Identifier (DID) of the initiator agent (e.g. did:midnight:agent-01)"
97
- },
98
- "intent": {
99
- "type": "string",
100
- "description": "Semantic action plan, financial intent, or agreement to seal in ZK"
101
- },
102
- "counterpartyId": {
103
- "type": "string",
104
- "description": "Optional DID of the target recipient agent"
105
- }
106
- }
107
- ```
108
-
109
- #### Example Agent Invocation Prompt:
110
-
111
- > *"Claude, seal our data-sharing agreement with `did:midnight:agent-partner` using Rohan ZK Handshake."*
112
-
113
- ---
114
-
115
- <a id="streamable-http-handshake-lifecycle"></a>
116
- ## ⚡ Streamable HTTP Handshake Lifecycle
117
-
118
- During tool execution, the MCP server connects to the Relayer via Chunked Transfer-Encoding (NDJSON), processing the following sequential stages:
119
-
120
- ```text
121
- 📡 [LIVE CHUNK] stage: 'received' | Data: {"stage":"received","timestamp":1788903808207}
122
- 📡 [LIVE CHUNK] stage: 'firewall_approved' | Data: {"stage":"firewall_approved","v01":"passed"}
123
- 📡 [LIVE CHUNK] stage: 'subsidizing_gas' | Data: {"stage":"subsidizing_gas","gasPayer":"rohan-relayer-node-01"}
124
- 📡 [LIVE CHUNK] stage: 'confirmed' | Data: {"stage":"confirmed","status":"success","txHash":"0x7c92...","intentHash":"0916..."}
125
- ```
126
-
127
- #### Returned Structured Receipt to LLM:
128
-
129
- ```json
130
- {
131
- "status": "success",
132
- "receipt": {
133
- "stage": "confirmed",
134
- "status": "success",
135
- "contractAddress": "6d2d603235f996424d76c85186a79cc403245ea8ee1ba9087e40967fe71bdc4d",
136
- "intentHash": "0916542f526dd3117104f23f113873a5331fdc2d885340081aef79dab0ee7393",
137
- "txHash": "0x7c92f75ca7d3bc8c767953b69c29d87d3848084c68d401bbd7987ff1afdb8271",
138
- "gasPaidBy": "rohan-relayer-node-01",
139
- "timestamp": 1788903808208
140
- }
141
- }
142
- ```
143
-
144
- ---
145
-
146
- <a id="security-architecture"></a>
147
- ## 🔒 Security Architecture (V-01 & V-02)
148
-
149
- ```text
150
- ┌────────────────────────────────────────────────────────┐
151
- │ AI Agent (Claude / Cursor / Headless Bot) │
152
- │ "Perform confidential handshake with Agent B" │
153
- └──────────────────────────┬─────────────────────────────┘
154
- │ 💬 MCP Tool Request: rohan_zk_handshake
155
- ▼
156
- ┌────────────────────────────────────────────────────────┐
157
- │ 🛡️ PRE-PROVER SEMANTIC FIREWALL (V-01) │
158
- │ - Inspects against indirect injection patterns │
159
- │ - Validates schema and DID integrity │
160
- └──────────────────────────┬─────────────────────────────┘
161
- │ ✅ Filter Passed
162
- ▼
163
- ┌────────────────────────────────────────────────────────┐
164
- │ 📦 @rohan-protocol/sdk (Local WASM Engine) │
165
- │ - Computes ZK-Proof in isolated RAM │
166
- │ - Multi-pass memory wipe destroys witness w (V-02) │
167
- └──────────────────────────┬─────────────────────────────┘
168
- │ 📡 Streamable HTTP (POST /api/v1/handshake/stream)
169
- ▼
170
- ┌────────────────────────────────────────────────────────┐
171
- │ ⚡ Rohan Relayer & Gas Station (NDJSON Stream) │
172
- │ - Chunk 1: stage: 'received' │
173
- │ - Chunk 2: stage: 'firewall_approved' │
174
- │ - Chunk 3: stage: 'subsidizing_gas' │
175
- │ - Chunk 4: stage: 'confirmed' (on-chain finalization)│
176
- └──────────────────────────┬─────────────────────────────┘
177
- │
178
- ┌──────────────────────────▼─────────────────────────────┐
179
- │ 🌌 Midnight Network Settlement Layer │
180
- │ - Compact Smart Contract: rohan_handshake │
181
- │ - Preprod Address: 6d2d603235f996424d76c85186a... │
182
- └────────────────────────────────────────────────────────┘
183
- ```
184
-
185
- ---
186
-
187
- ## 📄 License
188
-
189
- MIT © Rohan Protocol. Part of the Private Agentic Economy.
1
+ @rohan-protocol/mcp
2
+
3
+ ![Bild](https://img.shields.io/badge/NPM-v0.6.0-blue?style=for-the-badge)
4
+ ![Bild](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)
5
+
6
+ Official Model Context Protocol (MCP) server for Rohan Protocol.
7
+ Equips autonomous AI agents (Claude Desktop, Cursor, Gemini, Google ADK) with confidential Zero-Knowledge state transitions on Midnight Blockchain.
8
+ Features
9
+
10
+ Pre-Prover Semantic Firewall (V-01): Defends autonomous agents from indirect prompt injections and malicious payload expansions.
11
+
12
+ Universal Tool Interface: Exposes standard-compliant rohan_zk_handshake tool schema for LLMs in 100% technical English.
13
+
14
+ Gasless L1 Anchoring: Routes state commitments through the Rohan Relayer Pool with sponsored $tDUST network gas.
15
+
16
+ Installation & Setup
17
+ Claude Desktop
18
+
19
+ Add to your claude_desktop_config.json:
20
+ code JSON
21
+
22
+ {
23
+ "mcpServers": {
24
+ "rohan-zk-shield": {
25
+ "command": "npx",
26
+ "args": ["-y", "@rohan-protocol/mcp"],
27
+ "env": {
28
+ "ROHAN_RELAYER_URL": "https://api.rohanprotocol.network/api/v1/handshake",
29
+ "ROHAN_API_KEY": "rohan_live_..."
30
+ }
31
+ }
32
+ }
33
+ }
34
+
35
+ Cursor IDE
36
+
37
+ Open Settings → Features → MCP Servers → Add New MCP Server:
38
+
39
+ Name: rohan-shield
40
+
41
+ Type: command
42
+
43
+ Command: npx -y @rohan-protocol/mcp
44
+
45
+ Environment: ROHAN_API_KEY=rohan_live_...
46
+
47
+ License
48
+
49
+ MIT © Rohan Protocol.
package/dist/firewall.js CHANGED
@@ -12,10 +12,10 @@ export class SemanticFirewall {
12
12
  }
13
13
  const serialized = JSON.stringify(intent.payload);
14
14
  if (serialized.length > 8192) {
15
- return false; // Denial-of-Service Schutz
15
+ return false; // Denial-of-Service Protection (Payload size cap)
16
16
  }
17
17
  if (this.INJECTION_REGEX.test(serialized)) {
18
- return false; // Prompt Injection blockiert
18
+ return false; // Semantic Prompt Injection detected
19
19
  }
20
20
  return true;
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"firewall.js","sourceRoot":"","sources":["../src/firewall.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAU,eAAe,GACrC,uKAAuK,CAAC;IAE1K,MAAM,CAAC,QAAQ,CAAC,MAAuB;QACrC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACzF,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,oBAAoB,IAAI,MAAM,CAAC,MAAM,KAAK,2BAA2B,CAAC,EAAE,CAAC;YAChH,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC1D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC,CAAC,2BAA2B;QAC3C,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1C,OAAO,KAAK,CAAC,CAAC,6BAA6B;QAC7C,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
1
+ {"version":3,"file":"firewall.js","sourceRoot":"","sources":["../src/firewall.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAU,eAAe,GACrC,uKAAuK,CAAC;IAE1K,MAAM,CAAC,QAAQ,CAAC,MAAuB;QACrC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACzF,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,oBAAoB,IAAI,MAAM,CAAC,MAAM,KAAK,2BAA2B,CAAC,EAAE,CAAC;YAChH,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC1D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC,CAAC,kDAAkD;QAClE,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1C,OAAO,KAAK,CAAC,CAAC,qCAAqC;QACrD,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
package/dist/gateway.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { RohanRelayerClient } from '../../sdk/dist/index.js';
1
+ import { RohanRelayerClient } from '@rohan-protocol/sdk';
2
2
  export interface RohanMcpGatewayOptions {
3
3
  transport?: 'stdio' | 'streamable-http';
4
4
  relayerUrl?: string;
@@ -6,7 +6,7 @@ export interface RohanMcpGatewayOptions {
6
6
  apiKey?: string;
7
7
  }
8
8
  /**
9
- * ⚡ RohanMcpGateway
9
+ * RohanMcpGateway
10
10
  * Connects AI Agent pipelines (Google ADK 2.0, Gemini, Claude, Cursor)
11
11
  * to the Rohan Protocol Gas Station via Streamable HTTP (NDJSON) or Stdio.
12
12
  */
@@ -31,18 +31,14 @@ export declare class RohanMcpGateway {
31
31
  type: string;
32
32
  description: string;
33
33
  };
34
- proof: {
35
- type: string;
36
- description: string;
37
- };
38
- publicInputs: {
34
+ counterpartyId: {
39
35
  type: string;
40
36
  description: string;
41
37
  };
42
38
  };
43
39
  required: string[];
44
40
  };
45
- execute: (params: any) => Promise<any>;
41
+ execute: (params: any) => Promise<import("@rohan-protocol/sdk").HandshakeReceipt>;
46
42
  };
47
43
  }
48
44
  //# sourceMappingURL=gateway.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,aAAa,EAAE,kBAAkB,CAAC;IAElD,YAAY,OAAO,GAAE,sBAA2B,EAO/C;IAED;;OAEG;IACH,SAAS;QAEL,IAAI;QACJ,WAAW;QACX,UAAU;YACR,IAAI;YACJ,UAAU;gBACR,OAAO;oBAAI,IAAI;oBAAY,WAAW;;gBACtC,MAAM;oBAAI,IAAI;oBAAY,WAAW;;gBACrC,KAAK;oBAAI,IAAI;oBAAY,WAAW;;gBACpC,YAAY;oBAAI,IAAI;oBAAY,WAAW;;;YAE7C,QAAQ;;QAEV,OAAO,WAAiB,GAAG;MAI9B;CACF"}
1
+ {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,aAAa,EAAE,kBAAkB,CAAC;IAElD,YAAY,OAAO,GAAE,sBAA2B,EAO/C;IAED;;OAEG;IACH,SAAS;QAEL,IAAI;QACJ,WAAW;QACX,UAAU;YACR,IAAI;YACJ,UAAU;gBACR,OAAO;oBAAI,IAAI;oBAAY,WAAW;;gBACtC,MAAM;oBAAI,IAAI;oBAAY,WAAW;;gBACrC,cAAc;oBAAI,IAAI;oBAAY,WAAW;;;YAE/C,QAAQ;;QAEV,OAAO,WAAiB,GAAG;MAI9B;CACF"}
package/dist/gateway.js CHANGED
@@ -1,6 +1,6 @@
1
- import { RohanRelayerClient } from '../../sdk/dist/index.js';
1
+ import { RohanRelayerClient } from '@rohan-protocol/sdk';
2
2
  /**
3
- * ⚡ RohanMcpGateway
3
+ * RohanMcpGateway
4
4
  * Connects AI Agent pipelines (Google ADK 2.0, Gemini, Claude, Cursor)
5
5
  * to the Rohan Protocol Gas Station via Streamable HTTP (NDJSON) or Stdio.
6
6
  */
@@ -11,7 +11,7 @@ export class RohanMcpGateway {
11
11
  this.transport = options.transport || 'streamable-http';
12
12
  this.relayerClient = new RohanRelayerClient({
13
13
  relayerUrl: options.relayerUrl || 'http://127.0.0.1:4005/api/v1/handshake',
14
- contractAddress: options.contractAddress || '6d2d603235f996424d76c85186a79cc403245ea8ee1ba9087e40967fe71bdc4d',
14
+ contractAddress: options.contractAddress || '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e',
15
15
  apiKey: options.apiKey,
16
16
  });
17
17
  }
@@ -25,15 +25,14 @@ export class RohanMcpGateway {
25
25
  parameters: {
26
26
  type: 'object',
27
27
  properties: {
28
- agentId: { type: 'string', description: 'Identifier of calling agent' },
29
- intent: { type: 'string', description: 'Semantic action intent' },
30
- proof: { type: 'string', description: 'ZK-SNARK proof payload' },
31
- publicInputs: { type: 'object', description: 'Public inputs for on-chain verification' },
28
+ agentId: { type: 'string', description: 'Decentralized Identifier (DID) of calling agent' },
29
+ intent: { type: 'string', description: 'Semantic action intent or agreement payload' },
30
+ counterpartyId: { type: 'string', description: 'Optional recipient agent identifier' },
32
31
  },
33
32
  required: ['agentId', 'intent'],
34
33
  },
35
34
  execute: async (params) => {
36
- return await this.relayerClient.submitProof(params);
35
+ return await this.relayerClient.submitHandshake(params);
37
36
  },
38
37
  };
39
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.js","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAS7D;;;;GAIG;AACH,MAAM,OAAO,eAAe;IACV,SAAS,CAAS;IAClB,aAAa,CAAqB;IAElD,YAAY,OAAO,GAA2B,EAAE;QAC9C,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,iBAAiB,CAAC;QACxD,IAAI,CAAC,aAAa,GAAG,IAAI,kBAAkB,CAAC;YAC1C,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,wCAAwC;YAC1E,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,kEAAkE;YAC9G,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO;YACL,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,qGAAqG;YAClH,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,OAAO,EAAE,EAAE,IAA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DAAiD,EAAE;oBAC3F,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE;oBACtF,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;iBACvF;gBACD,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;aAChC;YACD,OAAO,EAAE,KAAK,EAAE,MAAW,EAAE,EAAE;gBAC7B,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAC1D,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
package/dist/server.js CHANGED
@@ -3,44 +3,48 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
5
5
  import { SemanticFirewall } from './firewall.js';
6
- import { RohanClient } from '../../sdk/dist/index.js';
7
- // Midnight Preprod Contract Adresse
8
- const CONTRACT_ADDRESS = process.env.ROHAN_CONTRACT_ADDRESS || '6d2d603235f996424d76c85186a79cc403245ea8ee1ba9087e40967fe71bdc4d';
6
+ import { RohanClient } from '@rohan-protocol/sdk';
7
+ const CONTRACT_ADDRESS = process.env.ROHAN_CONTRACT_ADDRESS || '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e';
9
8
  const RELAYER_URL = process.env.ROHAN_RELAYER_URL || 'http://127.0.0.1:4005/api/v1/handshake';
10
- const rohanClient = new RohanClient(CONTRACT_ADDRESS);
9
+ const API_KEY = process.env.ROHAN_API_KEY || '';
10
+ const rohanClient = new RohanClient({
11
+ contractAddress: CONTRACT_ADDRESS,
12
+ relayerUrl: RELAYER_URL,
13
+ apiKey: API_KEY,
14
+ });
11
15
  /**
12
- * 🛡️ ROHAN PROTOCOL MCP SERVER
13
- * Ermöglicht KI-Agenten native Zero-Knowledge Handshakes über das Model Context Protocol.
16
+ * ROHAN PROTOCOL MCP SERVER
17
+ * Empowers autonomous LLM agents with native Zero-Knowledge Handshakes via Model Context Protocol.
14
18
  */
15
19
  const server = new Server({
16
20
  name: 'rohan-protocol-mcp',
17
- version: '0.5.0',
21
+ version: '0.6.0',
18
22
  }, {
19
23
  capabilities: {
20
24
  tools: {},
21
25
  },
22
26
  });
23
- // 1. Tool-Liste für LLMs deklarieren
27
+ // 1. Declare tool schema for LLMs (100% Technical English)
24
28
  server.setRequestHandler(ListToolsRequestSchema, async () => {
25
29
  return {
26
30
  tools: [
27
31
  {
28
32
  name: 'rohan_zk_handshake',
29
- description: 'Führt einen kryptographischen Zero-Knowledge Handshake auf der Midnight Blockchain aus. Beweist einen Intent oder eine Vereinbarung zwischen Agenten ohne Preisgabe vertraulicher Inhalte.',
33
+ description: 'Executes a cryptographic zero-knowledge state transition on Midnight Blockchain. Proves an intent, transaction, or inter-agent agreement without exposing confidential parameters.',
30
34
  inputSchema: {
31
35
  type: 'object',
32
36
  properties: {
33
37
  agentId: {
34
38
  type: 'string',
35
- description: 'Die dezentrale Identität (DID) oder ID des initiierenden Agenten',
39
+ description: 'Decentralized Identifier (DID) or identifier of the initiating agent',
36
40
  },
37
41
  intent: {
38
42
  type: 'string',
39
- description: 'Der semantische Aktionsplan oder Vereinbarungsinhalt, der im ZK-Proof versiegelt wird',
43
+ description: 'Semantic action plan, payload, or agreement terms to be cryptographically committed',
40
44
  },
41
45
  counterpartyId: {
42
46
  type: 'string',
43
- description: 'Optionale ID des Empfänger-Agenten',
47
+ description: 'Optional identifier of counterparty agent',
44
48
  },
45
49
  },
46
50
  required: ['agentId', 'intent'],
@@ -49,13 +53,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
49
53
  ],
50
54
  };
51
55
  });
52
- // 2. Tool-Aufruf ausführen
56
+ // 2. Execute tool invocation
53
57
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
54
58
  if (request.params.name !== 'rohan_zk_handshake') {
55
- throw new Error(`Unbekanntes Tool: ${request.params.name}`);
59
+ throw new Error(`Unknown tool: ${request.params.name}`);
56
60
  }
57
61
  const args = request.params.arguments;
58
- // A. Semantic Firewall Prüfung (Sicherheits-Vektor V-01)
62
+ // A. Semantic Firewall Verification (Security Vector V-01)
59
63
  const isValid = SemanticFirewall.validate({
60
64
  agentId: args.agentId,
61
65
  action: 'rohan_zk_handshake',
@@ -76,29 +80,19 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
76
80
  };
77
81
  }
78
82
  try {
79
- // B. ZK-Proof im Client-RAM generieren (inkl. V-02 Memory Sanitation!)
80
- const proofData = await rohanClient.generateHandshakeProof({
83
+ // B. Generate cryptographic commitment & submit via Relayer
84
+ const receipt = await rohanClient.submitHandshake({
81
85
  agentId: args.agentId,
82
86
  intent: args.intent,
87
+ counterpartyId: args.counterpartyId,
83
88
  });
84
- // C. Proof an Relayer (Gas Station) übermitteln
85
- const headers = { 'Content-Type': 'application/json' };
86
- if (process.env.ROHAN_API_KEY) {
87
- headers['x-rohan-api-key'] = process.env.ROHAN_API_KEY;
88
- }
89
- const response = await fetch(RELAYER_URL, {
90
- method: 'POST',
91
- headers,
92
- body: JSON.stringify(proofData),
93
- });
94
- const receipt = await response.json();
95
89
  return {
96
90
  content: [
97
91
  {
98
92
  type: 'text',
99
93
  text: JSON.stringify({
100
94
  status: 'success',
101
- message: 'Zero-Knowledge Handshake erfolgreich auf Midnight Blockchain verankert!',
95
+ message: 'Zero-Knowledge Handshake successfully settled on Midnight Blockchain.',
102
96
  receipt,
103
97
  }, null, 2),
104
98
  },
@@ -123,10 +117,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
123
117
  async function run() {
124
118
  const transport = new StdioServerTransport();
125
119
  await server.connect(transport);
126
- console.error('🛡️ Rohan Protocol MCP Server läuft via Stdio...');
120
+ console.error('🛡️ Rohan Protocol MCP Server running via stdio (v0.6.0)...');
127
121
  }
128
122
  run().catch((error) => {
129
- console.error('Fataler Serverfehler:', error);
123
+ console.error('Fatal MCP server error:', error);
130
124
  process.exit(1);
131
125
  });
132
126
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,oCAAoC;AACpC,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,kEAAkE,CAAC;AAClI,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,wCAAwC,CAAC;AAE9F,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,OAAO;CACjB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF,qCAAqC;AACrC,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IAC1D,OAAO;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EACT,4LAA4L;gBAC9L,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,OAAO,EAAE;4BACP,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,kEAAkE;yBAChF;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,WA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AAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;wBACE,MAAM,EAAE,SAAS;wBACjB,OAAO,EAAE,uEAAuE;wBAChF,OAAO;qBACR,EACD,IAAI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,OAAO,EAAE,KAAK;wBACd,KAAK,EAAE,GAAG,CAAC,OAAO,IAAI,4BAA4B;qBACnD,CAAC;iBACH;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;AAC/E,CAAC;AAED,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACpB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rohan-protocol/mcp",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "Model Context Protocol (MCP) Gateway for Rohan Protocol ZK-Handshakes",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@modelcontextprotocol/sdk": "^1.30.0",
14
- "@rohan-protocol/sdk": "^0.5.2"
14
+ "@rohan-protocol/sdk": "^0.6.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "*",
package/smithery.yaml CHANGED
@@ -14,7 +14,7 @@ startCommand:
14
14
  args: ['-y', '@rohan-protocol/mcp@latest'],
15
15
  env: {
16
16
  ROHAN_FIREWALL_LEVEL: 'V-01_STRICT',
17
- ROHAN_CONTRACT_ADDRESS: '6d2d603235f996424d76c85186a79cc403245ea8ee1ba9087e40967fe71bdc4d',
17
+ ROHAN_CONTRACT_ADDRESS: '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e',
18
18
  ROHAN_RELAYER_URL: 'https://api.rohanprotocol.network/api/v1/handshake/stream',
19
19
  ...(config.rohanApiKey ? { ROHAN_API_KEY: config.rohanApiKey } : {})
20
20
  }
package/src/firewall.ts CHANGED
@@ -21,11 +21,11 @@ export class SemanticFirewall {
21
21
 
22
22
  const serialized = JSON.stringify(intent.payload);
23
23
  if (serialized.length > 8192) {
24
- return false; // Denial-of-Service Schutz
24
+ return false; // Denial-of-Service Protection (Payload size cap)
25
25
  }
26
26
 
27
27
  if (this.INJECTION_REGEX.test(serialized)) {
28
- return false; // Prompt Injection blockiert
28
+ return false; // Semantic Prompt Injection detected
29
29
  }
30
30
 
31
31
  return true;
package/src/gateway.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { RohanRelayerClient } from '../../sdk/dist/index.js';
1
+ import { RohanRelayerClient } from '@rohan-protocol/sdk';
2
2
 
3
3
  export interface RohanMcpGatewayOptions {
4
4
  transport?: 'stdio' | 'streamable-http';
@@ -8,7 +8,7 @@ export interface RohanMcpGatewayOptions {
8
8
  }
9
9
 
10
10
  /**
11
- * ⚡ RohanMcpGateway
11
+ * RohanMcpGateway
12
12
  * Connects AI Agent pipelines (Google ADK 2.0, Gemini, Claude, Cursor)
13
13
  * to the Rohan Protocol Gas Station via Streamable HTTP (NDJSON) or Stdio.
14
14
  */
@@ -20,7 +20,7 @@ export class RohanMcpGateway {
20
20
  this.transport = options.transport || 'streamable-http';
21
21
  this.relayerClient = new RohanRelayerClient({
22
22
  relayerUrl: options.relayerUrl || 'http://127.0.0.1:4005/api/v1/handshake',
23
- contractAddress: options.contractAddress || '6d2d603235f996424d76c85186a79cc403245ea8ee1ba9087e40967fe71bdc4d',
23
+ contractAddress: options.contractAddress || '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e',
24
24
  apiKey: options.apiKey,
25
25
  });
26
26
  }
@@ -35,15 +35,14 @@ export class RohanMcpGateway {
35
35
  parameters: {
36
36
  type: 'object',
37
37
  properties: {
38
- agentId: { type: 'string', description: 'Identifier of calling agent' },
39
- intent: { type: 'string', description: 'Semantic action intent' },
40
- proof: { type: 'string', description: 'ZK-SNARK proof payload' },
41
- publicInputs: { type: 'object', description: 'Public inputs for on-chain verification' },
38
+ agentId: { type: 'string', description: 'Decentralized Identifier (DID) of calling agent' },
39
+ intent: { type: 'string', description: 'Semantic action intent or agreement payload' },
40
+ counterpartyId: { type: 'string', description: 'Optional recipient agent identifier' },
42
41
  },
43
42
  required: ['agentId', 'intent'],
44
43
  },
45
44
  execute: async (params: any) => {
46
- return await this.relayerClient.submitProof(params);
45
+ return await this.relayerClient.submitHandshake(params);
47
46
  },
48
47
  };
49
48
  }
package/src/server.ts CHANGED
@@ -9,22 +9,26 @@ import {
9
9
  } from '@modelcontextprotocol/sdk/types.js';
10
10
 
11
11
  import { SemanticFirewall } from './firewall.js';
12
- import { RohanClient } from '../../sdk/dist/index.js';
12
+ import { RohanClient } from '@rohan-protocol/sdk';
13
13
 
14
- // Midnight Preprod Contract Adresse
15
- const CONTRACT_ADDRESS = process.env.ROHAN_CONTRACT_ADDRESS || '6d2d603235f996424d76c85186a79cc403245ea8ee1ba9087e40967fe71bdc4d';
14
+ const CONTRACT_ADDRESS = process.env.ROHAN_CONTRACT_ADDRESS || '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e';
16
15
  const RELAYER_URL = process.env.ROHAN_RELAYER_URL || 'http://127.0.0.1:4005/api/v1/handshake';
16
+ const API_KEY = process.env.ROHAN_API_KEY || '';
17
17
 
18
- const rohanClient = new RohanClient(CONTRACT_ADDRESS);
18
+ const rohanClient = new RohanClient({
19
+ contractAddress: CONTRACT_ADDRESS,
20
+ relayerUrl: RELAYER_URL,
21
+ apiKey: API_KEY,
22
+ });
19
23
 
20
24
  /**
21
- * 🛡️ ROHAN PROTOCOL MCP SERVER
22
- * Ermöglicht KI-Agenten native Zero-Knowledge Handshakes über das Model Context Protocol.
25
+ * ROHAN PROTOCOL MCP SERVER
26
+ * Empowers autonomous LLM agents with native Zero-Knowledge Handshakes via Model Context Protocol.
23
27
  */
24
28
  const server = new Server(
25
29
  {
26
30
  name: 'rohan-protocol-mcp',
27
- version: '0.5.0',
31
+ version: '0.6.0',
28
32
  },
29
33
  {
30
34
  capabilities: {
@@ -33,28 +37,28 @@ const server = new Server(
33
37
  }
34
38
  );
35
39
 
36
- // 1. Tool-Liste für LLMs deklarieren
40
+ // 1. Declare tool schema for LLMs (100% Technical English)
37
41
  server.setRequestHandler(ListToolsRequestSchema, async () => {
38
42
  return {
39
43
  tools: [
40
44
  {
41
45
  name: 'rohan_zk_handshake',
42
46
  description:
43
- 'Führt einen kryptographischen Zero-Knowledge Handshake auf der Midnight Blockchain aus. Beweist einen Intent oder eine Vereinbarung zwischen Agenten ohne Preisgabe vertraulicher Inhalte.',
47
+ 'Executes a cryptographic zero-knowledge state transition on Midnight Blockchain. Proves an intent, transaction, or inter-agent agreement without exposing confidential parameters.',
44
48
  inputSchema: {
45
49
  type: 'object',
46
50
  properties: {
47
51
  agentId: {
48
52
  type: 'string',
49
- description: 'Die dezentrale Identität (DID) oder ID des initiierenden Agenten',
53
+ description: 'Decentralized Identifier (DID) or identifier of the initiating agent',
50
54
  },
51
55
  intent: {
52
56
  type: 'string',
53
- description: 'Der semantische Aktionsplan oder Vereinbarungsinhalt, der im ZK-Proof versiegelt wird',
57
+ description: 'Semantic action plan, payload, or agreement terms to be cryptographically committed',
54
58
  },
55
59
  counterpartyId: {
56
60
  type: 'string',
57
- description: 'Optionale ID des Empfänger-Agenten',
61
+ description: 'Optional identifier of counterparty agent',
58
62
  },
59
63
  },
60
64
  required: ['agentId', 'intent'],
@@ -64,10 +68,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
64
68
  };
65
69
  });
66
70
 
67
- // 2. Tool-Aufruf ausführen
71
+ // 2. Execute tool invocation
68
72
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
69
73
  if (request.params.name !== 'rohan_zk_handshake') {
70
- throw new Error(`Unbekanntes Tool: ${request.params.name}`);
74
+ throw new Error(`Unknown tool: ${request.params.name}`);
71
75
  }
72
76
 
73
77
  const args = request.params.arguments as {
@@ -76,7 +80,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
76
80
  counterpartyId?: string;
77
81
  };
78
82
 
79
- // A. Semantic Firewall Prüfung (Sicherheits-Vektor V-01)
83
+ // A. Semantic Firewall Verification (Security Vector V-01)
80
84
  const isValid = SemanticFirewall.validate({
81
85
  agentId: args.agentId,
82
86
  action: 'rohan_zk_handshake',
@@ -99,26 +103,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
99
103
  }
100
104
 
101
105
  try {
102
- // B. ZK-Proof im Client-RAM generieren (inkl. V-02 Memory Sanitation!)
103
- const proofData = await rohanClient.generateHandshakeProof({
106
+ // B. Generate cryptographic commitment & submit via Relayer
107
+ const receipt = await rohanClient.submitHandshake({
104
108
  agentId: args.agentId,
105
109
  intent: args.intent,
110
+ counterpartyId: args.counterpartyId,
106
111
  });
107
112
 
108
- // C. Proof an Relayer (Gas Station) übermitteln
109
- const headers: Record<string, string> = { 'Content-Type': 'application/json' };
110
- if (process.env.ROHAN_API_KEY) {
111
- headers['x-rohan-api-key'] = process.env.ROHAN_API_KEY;
112
- }
113
-
114
- const response = await fetch(RELAYER_URL, {
115
- method: 'POST',
116
- headers,
117
- body: JSON.stringify(proofData),
118
- });
119
-
120
- const receipt = await response.json();
121
-
122
113
  return {
123
114
  content: [
124
115
  {
@@ -126,7 +117,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
126
117
  text: JSON.stringify(
127
118
  {
128
119
  status: 'success',
129
- message: 'Zero-Knowledge Handshake erfolgreich auf Midnight Blockchain verankert!',
120
+ message: 'Zero-Knowledge Handshake successfully settled on Midnight Blockchain.',
130
121
  receipt,
131
122
  },
132
123
  null,
@@ -154,10 +145,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
154
145
  async function run() {
155
146
  const transport = new StdioServerTransport();
156
147
  await server.connect(transport);
157
- console.error('🛡️ Rohan Protocol MCP Server läuft via Stdio...');
148
+ console.error('🛡️ Rohan Protocol MCP Server running via stdio (v0.6.0)...');
158
149
  }
159
150
 
160
151
  run().catch((error) => {
161
- console.error('Fataler Serverfehler:', error);
152
+ console.error('Fatal MCP server error:', error);
162
153
  process.exit(1);
163
154
  });