@rohan-protocol/mcp 0.8.1 → 0.8.3

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/dist/server.d.ts CHANGED
@@ -1,44 +1,49 @@
1
1
  #!/usr/bin/env node
2
2
  import { ROHAN_HANDSHAKE_TOOL_SCHEMA } from './identity/handshake.js';
3
- export { ROHAN_HANDSHAKE_TOOL_SCHEMA };
4
- export declare const ROHAN_VERIFY_TOOL_SCHEMA: {
5
- name: string;
6
- description: string;
3
+ import { createRohanMcpServer, ROHAN_MCP_INSTRUCTIONS, ROHAN_EXECUTE_TOOL_WITH_ANNOTATIONS, ROHAN_VERIFY_TOOL_SCHEMA, ROHAN_LEDGER_STATE_TOOL_SCHEMA, ROHAN_HISTORY_TOOL_SCHEMA, ROHAN_AGENT_STATUS_TOOL_SCHEMA } from './mcp-app.js';
4
+ export declare const ROHAN_EXECUTE_TOOL_SCHEMA: {
5
+ annotations: {
6
+ title: string;
7
+ readOnlyHint: boolean;
8
+ destructiveHint: boolean;
9
+ idempotentHint: boolean;
10
+ openWorldHint: boolean;
11
+ };
12
+ name: "rohan_execute_handshake";
13
+ description: "Executes or locally previews a confidential handshake commitment on Midnight. Usage guidelines:\n- Use for a user-authorized settlement; set dryRun: true only when the user asks to preview, test, or inspect a commitment without on-chain settlement (default false).\n- Do not use for reads, history, status, or audit; use rohan_get_ledger_state, rohan_get_transaction_history, rohan_get_agent_status, or rohan_verify_commitment instead.\n- Keep sensitive values in confidentialPayload, actionSummary generic, and private keys out of tool arguments. Follow recoveryAction on errors; after replay check transaction history, and after signature errors check agent status. Payloads are canonicalized and hashed locally.";
7
14
  inputSchema: {
8
- type: string;
9
- properties: {
10
- payload: {
11
- type: string;
12
- description: string;
15
+ readonly type: "object";
16
+ readonly properties: {
17
+ readonly actionSummary: {
18
+ readonly type: "string";
19
+ readonly minLength: 1;
20
+ readonly description: "Required public high-level action label.";
13
21
  };
14
- expectedDigest: {
15
- type: string;
16
- pattern: string;
17
- description: string;
22
+ readonly agentId: {
23
+ readonly type: "string";
24
+ readonly description: "Optional Sovereign Agent DID. Defaults to the local signer's DID and must match it when provided.";
18
25
  };
19
- };
20
- required: string[];
21
- };
22
- };
23
- export declare const ROHAN_LEDGER_STATE_TOOL_SCHEMA: {
24
- name: string;
25
- description: string;
26
- inputSchema: {
27
- type: string;
28
- properties: {};
29
- };
30
- };
31
- export declare const ROHAN_HISTORY_TOOL_SCHEMA: {
32
- name: string;
33
- description: string;
34
- inputSchema: {
35
- type: string;
36
- properties: {
37
- limit: {
38
- type: string;
39
- description: string;
26
+ readonly confidentialPayload: {
27
+ readonly type: "object";
28
+ readonly description: "Optional confidential parameters, canonicalized and hashed locally.";
29
+ };
30
+ readonly counterpartyId: {
31
+ readonly type: "string";
32
+ readonly description: "Optional counterparty agent identifier.";
33
+ };
34
+ readonly dryRun: {
35
+ readonly type: "boolean";
36
+ readonly description: "Only set true when the user asks to preview, test, or inspect the commitment without settling on-chain. Defaults to false.";
37
+ };
38
+ readonly intent: {
39
+ readonly type: "string";
40
+ readonly deprecated: true;
41
+ readonly description: "Deprecated alias. actionSummary remains required.";
40
42
  };
41
43
  };
44
+ readonly required: readonly ["actionSummary"];
45
+ readonly additionalProperties: false;
42
46
  };
43
47
  };
48
+ export { ROHAN_HANDSHAKE_TOOL_SCHEMA, ROHAN_MCP_INSTRUCTIONS, ROHAN_EXECUTE_TOOL_WITH_ANNOTATIONS, ROHAN_VERIFY_TOOL_SCHEMA, ROHAN_LEDGER_STATE_TOOL_SCHEMA, ROHAN_HISTORY_TOOL_SCHEMA, ROHAN_AGENT_STATUS_TOOL_SCHEMA, createRohanMcpServer, };
44
49
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAcA,OAAO,EAEL,2BAA2B,EAE5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,CAAC;AAgCvC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;CAmBpC,CAAC;AAGF,eAAO,MAAM,8BAA8B;;;;;;;CAQ1C,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;CAarC,CAAC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EACL,oBAAoB,EAEpB,sBAAsB,EACtB,mCAAmC,EACnC,wBAAwB,EACxB,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsC,CAAC;AAE7E,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,mCAAmC,EACnC,wBAAwB,EACxB,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EAC9B,oBAAoB,GACrB,CAAC"}
package/dist/server.js CHANGED
@@ -1,266 +1,63 @@
1
1
  #!/usr/bin/env node
2
- import crypto from 'node:crypto';
3
- import { Server } from '@modelcontextprotocol/sdk/server/index.js';
4
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
5
- import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
6
- import { SemanticFirewall } from './firewall.js';
7
- import { RohanClient, sealActionIntent, canonicalizeJson } from '@rohan-protocol/sdk';
3
+ import { RohanClient } from '@rohan-protocol/sdk';
8
4
  import { resolveAgentIdentity } from './identity/keystore.js';
9
- import { resolveHandshakeAgentId, ROHAN_HANDSHAKE_TOOL_SCHEMA, validateHandshakeArguments, } from './identity/handshake.js';
10
- export { ROHAN_HANDSHAKE_TOOL_SCHEMA };
11
- const CONTRACT_ADDRESS = process.env.ROHAN_CONTRACT_ADDRESS || '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e';
12
- const RELAYER_URL = process.env.ROHAN_RELAYER_URL || 'https://api.rohanprotocol.network/api/v1/handshake';
13
- const API_KEY = process.env.ROHAN_API_KEY || '';
14
- const loadedIdentity = await resolveAgentIdentity();
15
- const configuredSigner = loadedIdentity.signer;
16
- console.error(`🛡️ [MCP V-08] Agent identity active (${loadedIdentity.source}): ${loadedIdentity.did}`);
17
- if (loadedIdentity.filePath) {
18
- console.error(`🛡️ [MCP V-08] Keystore path: ${loadedIdentity.filePath}`);
19
- }
20
- const rohanClient = new RohanClient({
21
- contractAddress: CONTRACT_ADDRESS,
22
- relayerUrl: RELAYER_URL,
23
- apiKey: API_KEY,
24
- signer: configuredSigner,
25
- });
26
- const server = new Server({
27
- name: 'rohan-protocol-mcp',
28
- version: '0.8.1',
29
- }, {
30
- capabilities: {
31
- tools: {},
32
- },
33
- });
34
- // ── Tool 2 Schema: Audit / In-Memory Verification ───────────────────────────
35
- export const ROHAN_VERIFY_TOOL_SCHEMA = {
36
- name: 'rohan_verify_commitment',
37
- description: 'Verifies a plaintext confidential payload against its SHA-256 digest using RFC 8785 JSON Canonicalization. Supply the inner payload digest, not the outer on-chain intentHash. Zero gas cost; runs in local memory.',
38
- inputSchema: {
39
- type: 'object',
40
- properties: {
41
- payload: {
42
- type: 'object',
43
- description: 'The plaintext contract, agreement, or intent data to be verified.',
44
- },
45
- expectedDigest: {
46
- type: 'string',
47
- pattern: '^(?:sha256:|0x)?[0-9a-fA-F]{64}$',
48
- description: 'The expected SHA-256 digest of the canonicalized confidential payload (the inner payload digest referenced as digest: sha256:<hash> in actionSummary), not the outer timestamp-salted on-chain intentHash. Accepts raw hex, 0x, or sha256: prefixes.',
49
- },
50
- },
51
- required: ['payload', 'expectedDigest'],
52
- },
53
- };
54
- // ── Tool 3 Schema: Read / Ledger State Inspection ───────────────────────────
55
- export const ROHAN_LEDGER_STATE_TOOL_SCHEMA = {
56
- name: 'rohan_get_ledger_state',
57
- description: 'Reads the current anchored state of the Rohan Protocol smart contract on Midnight Preprod L1. Returns the state root, block height, and last mined transaction hash from memory cache.',
58
- inputSchema: {
59
- type: 'object',
60
- properties: {},
61
- },
62
- };
63
- export const ROHAN_HISTORY_TOOL_SCHEMA = {
64
- name: 'rohan_get_transaction_history',
65
- description: 'Lists historical settlement transactions and receipts anchored on Midnight Preprod L1.',
66
- inputSchema: {
67
- type: 'object',
68
- properties: {
69
- limit: {
70
- type: 'integer',
71
- description: 'Maximum number of historical transactions to return (default: 10, max: 50).',
72
- },
73
- },
74
- },
75
- };
76
- server.setRequestHandler(ListToolsRequestSchema, async () => {
77
- return {
78
- tools: [
79
- ROHAN_HANDSHAKE_TOOL_SCHEMA,
80
- ROHAN_LEDGER_STATE_TOOL_SCHEMA,
81
- ROHAN_HISTORY_TOOL_SCHEMA,
82
- ROHAN_VERIFY_TOOL_SCHEMA,
83
- ],
84
- };
85
- });
86
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
87
- const toolName = request.params.name;
88
- const rawArgs = request.params?.arguments;
89
- if (!rawArgs || typeof rawArgs !== 'object' || Array.isArray(rawArgs)) {
90
- return {
91
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'INVALID_ARGUMENTS: Expected a valid arguments object.' }) }],
92
- isError: true,
93
- };
94
- }
95
- const args = rawArgs;
96
- // ── Tool 1: rohan_zk_handshake ────────────────────────────────────────────
97
- if (toolName === 'rohan_execute_handshake' || toolName === 'rohan_zk_handshake') {
98
- const argumentsError = validateHandshakeArguments(args);
99
- if (argumentsError) {
100
- return {
101
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: argumentsError }) }],
102
- isError: true,
103
- };
104
- }
105
- const identity = resolveHandshakeAgentId(args.agentId, configuredSigner);
106
- if ('error' in identity) {
107
- return {
108
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: identity.error }) }],
109
- isError: true,
110
- };
111
- }
112
- const effectiveAgentId = identity.agentId;
113
- const actionLabel = args.actionSummary;
114
- const isValid = SemanticFirewall.validate({
115
- agentId: effectiveAgentId,
116
- action: 'rohan_execute_handshake',
117
- payload: args,
118
- });
119
- if (!isValid) {
120
- return {
121
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Security Violation: Intent rejected by Semantic Firewall (V-01)' }) }],
122
- isError: true,
123
- };
124
- }
125
- try {
126
- const finalIntent = sealActionIntent(actionLabel, args.confidentialPayload);
127
- const receipt = await rohanClient.submitHandshake({
128
- agentId: effectiveAgentId,
129
- intent: finalIntent,
130
- counterpartyId: args.counterpartyId,
131
- });
132
- return {
133
- content: [{
134
- type: 'text',
135
- text: JSON.stringify({
136
- status: 'success',
137
- message: 'Zero-Knowledge Handshake successfully settled on Midnight Blockchain with Sovereign Identity (V-08).',
138
- agentDid: effectiveAgentId,
139
- receipt,
140
- }, null, 2),
141
- }],
142
- };
143
- }
144
- catch (err) {
145
- return {
146
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: err.message || 'Handshake execution failed' }) }],
147
- isError: true,
148
- };
149
- }
150
- }
151
- // ── Tool 2: rohan_verify_commitment ───────────────────────────────────────
152
- if (toolName === 'rohan_verify_commitment') {
153
- // Payload-Size-Guard (Max 256 KB im RAM)
154
- const payloadString = JSON.stringify(args.payload);
155
- if (payloadString.length > 256 * 1024) {
156
- return {
157
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'PAYLOAD_TOO_LARGE: Plaintext exceeds maximum allowed size of 256 KB.' }) }],
158
- isError: true,
159
- };
160
- }
161
- if (!args.payload || typeof args.payload !== 'object' || Array.isArray(args.payload)) {
162
- return {
163
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Invalid argument: payload must be a non-null object.' }) }],
164
- isError: true,
165
- };
166
- }
167
- if (!args.expectedDigest || typeof args.expectedDigest !== 'string') {
168
- return {
169
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Invalid argument: expectedDigest must be a string.' }) }],
170
- isError: true,
171
- };
172
- }
173
- try {
174
- // LLM Prefix Tolerance: Strips 'sha256:' or '0x'
175
- const normalizedExpected = args.expectedDigest.replace(/^(?:sha256:|0x)/i, '').toLowerCase();
176
- if (!/^[0-9a-f]{64}$/.test(normalizedExpected)) {
177
- return {
178
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Invalid expectedDigest: must resolve to a 64-character hexadecimal SHA-256 hash.' }) }],
179
- isError: true,
180
- };
181
- }
182
- // Single Source of Truth: Canonicalization via @rohan-protocol/sdk
183
- const canonicalPayload = canonicalizeJson(args.payload);
184
- const computedDigest = crypto.createHash('sha256').update(canonicalPayload, 'utf8').digest('hex').toLowerCase();
185
- const match = crypto.timingSafeEqual(Buffer.from(computedDigest, 'hex'), Buffer.from(normalizedExpected, 'hex'));
186
- return {
187
- content: [{
188
- type: 'text',
189
- text: JSON.stringify({
190
- status: 'success',
191
- valid: match,
192
- match,
193
- expectedDigest: normalizedExpected,
194
- computedDigest,
195
- algorithm: 'SHA-256 (RFC 8785 JCS)',
196
- verifiedAt: Date.now(),
197
- }, null, 2),
198
- }],
199
- };
200
- }
201
- catch (err) {
202
- return {
203
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: err.message || 'Verification execution failed' }) }],
204
- isError: true,
205
- };
206
- }
5
+ import { ROHAN_HANDSHAKE_TOOL_SCHEMA } from './identity/handshake.js';
6
+ import { runCli } from './cli.js';
7
+ import { createRohanMcpServer, ROHAN_MCP_VERSION, ROHAN_MCP_INSTRUCTIONS, ROHAN_EXECUTE_TOOL_WITH_ANNOTATIONS, ROHAN_VERIFY_TOOL_SCHEMA, ROHAN_LEDGER_STATE_TOOL_SCHEMA, ROHAN_HISTORY_TOOL_SCHEMA, ROHAN_AGENT_STATUS_TOOL_SCHEMA, } from './mcp-app.js';
8
+ export const ROHAN_EXECUTE_TOOL_SCHEMA = ROHAN_EXECUTE_TOOL_WITH_ANNOTATIONS;
9
+ export { ROHAN_HANDSHAKE_TOOL_SCHEMA, ROHAN_MCP_INSTRUCTIONS, ROHAN_EXECUTE_TOOL_WITH_ANNOTATIONS, ROHAN_VERIFY_TOOL_SCHEMA, ROHAN_LEDGER_STATE_TOOL_SCHEMA, ROHAN_HISTORY_TOOL_SCHEMA, ROHAN_AGENT_STATUS_TOOL_SCHEMA, createRohanMcpServer, };
10
+ function resolveConfiguredNetwork() {
11
+ const raw = (process.env.ROHAN_NETWORK || 'preprod').trim().toLowerCase();
12
+ if (raw !== 'preprod' && raw !== 'testnet' && raw !== 'mainnet') {
13
+ throw new Error(`INVALID_CONFIGURATION: Unsupported ROHAN_NETWORK "${raw}". Expected preprod, testnet, or mainnet.`);
207
14
  }
208
- // ── Tool 3: rohan_get_ledger_state ────────────────────────────────────────
209
- if (toolName === 'rohan_get_ledger_state') {
210
- try {
211
- const ledgerState = await rohanClient.getLedgerState();
212
- const cacheAgeMs = Date.now() - (ledgerState.fetchedAt || Date.now());
213
- return {
214
- content: [{
215
- type: 'text',
216
- text: JSON.stringify({
217
- status: 'success',
218
- contractAddress: ledgerState.contractAddress,
219
- currentStateRoot: ledgerState.currentStateRoot,
220
- blockHeight: ledgerState.blockHeight ?? null,
221
- lastTxHash: ledgerState.lastTxHash ?? null,
222
- network: ledgerState.network || 'midnight-preprod',
223
- isMinedOnChain: ledgerState.isMinedOnChain ?? true,
224
- cacheAgeMs: ledgerState.cacheAgeMs ?? cacheAgeMs,
225
- cacheTtlMs: ledgerState.cacheTtlMs ?? 15000,
226
- fetchedAt: ledgerState.fetchedAt,
227
- }, null, 2),
228
- }],
229
- };
230
- }
231
- catch (err) {
232
- return {
233
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: err.message || 'Failed to fetch ledger state' }) }],
234
- isError: true,
235
- };
236
- }
237
- }
238
- if (toolName === 'rohan_get_transaction_history') {
239
- try {
240
- const rawLimit = Number(args.limit) || 10;
241
- const history = await rohanClient.getTransactionHistory(rawLimit);
242
- return {
243
- content: [{
244
- type: 'text',
245
- text: JSON.stringify({ status: 'success', ...history }, null, 2),
246
- }],
247
- };
248
- }
249
- catch (err) {
250
- return {
251
- content: [{ type: 'text', text: JSON.stringify({ success: false, error: err.message || 'Failed to fetch transaction history' }) }],
252
- isError: true,
253
- };
254
- }
15
+ return raw;
16
+ }
17
+ async function runStdioServer() {
18
+ const CONTRACT_ADDRESS = process.env.ROHAN_CONTRACT_ADDRESS ||
19
+ '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e';
20
+ const RELAYER_URL = process.env.ROHAN_RELAYER_URL || 'https://api.rohanprotocol.network/api/v1/handshake';
21
+ const API_KEY = process.env.ROHAN_API_KEY || '';
22
+ const NETWORK = resolveConfiguredNetwork();
23
+ const loadedIdentity = await resolveAgentIdentity();
24
+ const configuredSigner = loadedIdentity.signer;
25
+ console.error(`🛡️ [MCP V-08] Agent identity active (${loadedIdentity.source}): ${loadedIdentity.did}`);
26
+ if (loadedIdentity.filePath) {
27
+ console.error(`🛡️ [MCP V-08] Keystore path: ${loadedIdentity.filePath}`);
255
28
  }
256
- throw new Error(`Unknown tool: ${toolName}`);
257
- });
258
- async function run() {
29
+ const rohanClient = new RohanClient({
30
+ network: NETWORK,
31
+ contractAddress: CONTRACT_ADDRESS,
32
+ relayerUrl: RELAYER_URL,
33
+ apiKey: API_KEY,
34
+ signer: configuredSigner,
35
+ });
36
+ const server = createRohanMcpServer({
37
+ contractAddress: CONTRACT_ADDRESS,
38
+ relayerUrl: RELAYER_URL,
39
+ network: NETWORK,
40
+ rohanClient,
41
+ configuredSigner,
42
+ loadedIdentity,
43
+ });
259
44
  const transport = new StdioServerTransport();
45
+ if (process.stdin.isTTY === true) {
46
+ console.error('ℹ️ Interactive terminal detected: running MCP stdio JSON-RPC server (waiting on stdin). For CLI setup or diagnostics, run: npx @rohan-protocol/mcp status');
47
+ }
260
48
  await server.connect(transport);
261
- console.error('🛡️ Rohan Protocol MCP Server running via stdio (v0.8.1)...');
49
+ console.error(`🛡️ Rohan Protocol MCP Server running via stdio (v${ROHAN_MCP_VERSION}, network=${NETWORK})...`);
50
+ }
51
+ async function main() {
52
+ const cliArgs = process.argv.slice(2);
53
+ if (cliArgs.length > 0 && cliArgs[0] !== '--stdio') {
54
+ const exitCode = await runCli(cliArgs);
55
+ process.exit(exitCode);
56
+ return;
57
+ }
58
+ await runStdioServer();
262
59
  }
263
- run().catch((error) => {
60
+ main().catch((error) => {
264
61
  console.error('Fatal MCP server error:', error);
265
62
  process.exit(1);
266
63
  });
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAGA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,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,gBAAgB,EAAE,gBAAgB,EAAoB,MAAM,qBAAqB,CAAC;AACxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,CAAC;AAEvC,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,kEAAkE,CAAC;AAClI,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,oDAAoD,CAAC;AAC1G,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC;AAChD,MAAM,cAAc,GAAG,MAAM,oBAAoB,EAAE,CAAC;AACpD,MAAM,gBAAgB,GAAgB,cAAc,CAAC,MAAM,CAAC;AAC5D,OAAO,CAAC,KAAK,CAAC,yCAAy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AM,GAAG,oBAAoB,CAAC;QAClC,eAAe,EAAE,gBAAgB;QACjC,UAAU,EAAE,WAAW;QACvB,OAAO,EAAE,OAAO;QAChB,WAAW;QACX,gBAAgB;QAChB,cAAc;KACf,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,CAAC,KAAK,CACX,2JAA2J,CAC5J,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,qDAAqD,iBAAiB,aAAa,OAAO,MAAM,CAAC,CAAC;AAClH,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QACnD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO;IACT,CAAC;IACD,MAAM,cAAc,EAAE,CAAC;AACzB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,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,8 +1,17 @@
1
1
  {
2
2
  "name": "@rohan-protocol/mcp",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "mcpName": "io.github.rohan-protocol/mcp",
5
5
  "description": "Model Context Protocol (MCP) Gateway for Rohan Protocol ZK-Handshakes",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/rohan-protocol/sdk.git",
9
+ "directory": "packages/mcp"
10
+ },
11
+ "homepage": "https://rohanprotocol.network",
12
+ "bugs": {
13
+ "url": "https://github.com/rohan-protocol/sdk/issues"
14
+ },
6
15
  "main": "dist/index.js",
7
16
  "types": "dist/index.d.ts",
8
17
  "type": "module",
@@ -23,14 +32,18 @@
23
32
  },
24
33
  "dependencies": {
25
34
  "@modelcontextprotocol/sdk": "^1.32.2",
26
- "@rohan-protocol/sdk": "^0.8.1"
35
+ "@rohan-protocol/sdk": "^0.8.3"
27
36
  },
37
+ "files": [
38
+ "dist",
39
+ "README.md"
40
+ ],
28
41
  "devDependencies": {
29
42
  "@types/node": "^22.0.0",
30
43
  "typescript": "^5.5.0"
31
44
  },
32
45
  "bin": {
33
46
  "rohan-shield": "./dist/server.js",
34
- "mcp": "./dist/server.js"
47
+ "rohan-mcp": "./dist/server.js"
35
48
  }
36
49
  }
package/server.json DELETED
@@ -1,46 +0,0 @@
1
- {
2
- "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
- "name": "io.github.rohan-protocol/mcp",
4
- "title": "Rohan Protocol MCP",
5
- "description": "Stateless zero-knowledge trust gateway and WebMCP shield for AI agents on Midnight.",
6
- "version": "0.8.1",
7
- "websiteUrl": "https://rohanprotocol.network",
8
- "repository": {
9
- "url": "https://github.com/rohan-protocol/sdk",
10
- "source": "github",
11
- "subfolder": "packages/mcp"
12
- },
13
- "packages": [
14
- {
15
- "registryType": "npm",
16
- "identifier": "@rohan-protocol/mcp",
17
- "version": "0.8.1",
18
- "transport": {
19
- "type": "stdio"
20
- },
21
- "environmentVariables": [
22
- {
23
- "name": "ROHAN_AGENT_PRIVATE_KEY",
24
- "description": "Optional 32-byte Ed25519 seed as 64 hex characters to override the auto-provisioned local identity. Keep it in a secret store; never provide it as a tool argument.",
25
- "default": "",
26
- "isRequired": false,
27
- "format": "string"
28
- },
29
- {
30
- "name": "ROHAN_CONTRACT_ADDRESS",
31
- "description": "Midnight Preprod Contract Address for Rohan Trust Gateway",
32
- "default": "585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e",
33
- "isRequired": false,
34
- "format": "string"
35
- },
36
- {
37
- "name": "ROHAN_RELAYER_URL",
38
- "description": "Rohan Relayer API URL",
39
- "default": "https://api.rohanprotocol.network/api/v1/handshake",
40
- "isRequired": false,
41
- "format": "string"
42
- }
43
- ]
44
- }
45
- ]
46
- }
package/smithery.yaml DELETED
@@ -1,23 +0,0 @@
1
- # Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml
2
- startCommand:
3
- type: stdio
4
- configSchema:
5
- type: object
6
- properties:
7
- rohanApiKey:
8
- type: string
9
- description: "Optional Rohan Relayer API key for production throughput (defaults to free 10 tx/day sandbox)"
10
- commandFunction:
11
- |-
12
- (config) => ({
13
- command: 'npx',
14
- args: ['-y', '@rohan-protocol/mcp@latest'],
15
- env: {
16
- ROHAN_FIREWALL_LEVEL: 'V-01_STRICT',
17
- ROHAN_CONTRACT_ADDRESS: '585ac0c4448257507d8ffa2a89e2aa00abd86ec9e94bdb6f553bc83e05f4dd0e',
18
- ROHAN_RELAYER_URL: 'https://api.rohanprotocol.network/api/v1/handshake/stream',
19
- ...(config.rohanApiKey ? { ROHAN_API_KEY: config.rohanApiKey } : {})
20
- }
21
- })
22
- exampleConfig:
23
- rohanApiKey: "rohan_live_alpha_..."
package/src/firewall.ts DELETED
@@ -1,37 +0,0 @@
1
- export interface HandshakeIntent {
2
- agentId: string;
3
- action: string;
4
- payload: Record<string, unknown>;
5
- }
6
-
7
- export class SemanticFirewall {
8
- private static readonly INJECTION_REGEX =
9
- /(?:ignore\s+(all\s+)?previous\s+instructions|system\s*:\s*override|you\s+are\s+now\s+a|assistant\s*:|\[INST\]|<\|im_start\|>|jailbreak|reveal\s+(your|the)\s+secret)/i;
10
-
11
- static validate(intent: HandshakeIntent): boolean {
12
- if (!intent.agentId || typeof intent.agentId !== 'string' || intent.agentId.length > 128) {
13
- return false;
14
- }
15
- if (!intent.action || (
16
- intent.action !== 'rohan_zk_handshake' &&
17
- intent.action !== 'rohan_execute_handshake' &&
18
- intent.action !== 'verify_batched_handshakes'
19
- )) {
20
- return false;
21
- }
22
- if (!intent.payload || typeof intent.payload !== 'object') {
23
- return false;
24
- }
25
-
26
- const serialized = JSON.stringify(intent.payload);
27
- if (serialized.length > 8192) {
28
- return false; // Denial-of-Service Protection (Payload size cap)
29
- }
30
-
31
- if (this.INJECTION_REGEX.test(serialized)) {
32
- return false; // Semantic Prompt Injection detected
33
- }
34
-
35
- return true;
36
- }
37
- }