@dexmond/mcp-server 2.1.0 → 2.3.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.
Files changed (3) hide show
  1. package/index.mjs +269 -17
  2. package/package.json +2 -2
  3. package/server.json +2 -2
package/index.mjs CHANGED
@@ -1,11 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Official Dexmond Technologies MCP Server v2.0 (Zero-Dependency stdio JSON-RPC 2.0)
4
- * Exposes the Full Dexmond Commercial API Suite (22 tools) to Claude, Cursor, Antigravity & AI Agents.
3
+ * Official Dexmond Technologies MCP Server v2.3 (Zero-Dependency stdio JSON-RPC 2.0)
4
+ * Exposes the Full Dexmond Commercial API Suite + Local Loopback Edge Bridges (24 tools)
5
+ * to Claude, Cursor, Antigravity & AI Agents.
5
6
  *
6
7
  * Environment variables:
7
- * DEXMOND_API_KEY (required: dx_live_... key from https://dexmond.com/dashboard.html#developer)
8
- * DEXMOND_API_URL (optional: defaults to https://dexmond.com/api/v1/commerce.php)
8
+ * DEXMOND_API_KEY (required for metered cloud tools: dx_live_... from https://dexmond.com/dashboard.html#developer)
9
+ * DEXMOND_API_URL (optional: defaults to https://dexmond.com/api/v1/commerce.php)
10
+ * PROLAB_BRIDGE_URL (optional loopback-only: defaults to http://127.0.0.1:18765)
11
+ * PROLAB_BRIDGE_TOKEN (required for authenticated Android ProLab Local Agent Bridge calls)
12
+ * SENTINEL_BRIDGE_URL (optional loopback-only: defaults to http://127.0.0.1:18766)
13
+ * SENTINEL_BRIDGE_TOKEN (required for authenticated Sentinel 2.0 Edge Agent Bridge calls)
9
14
  */
10
15
 
11
16
  import readline from 'node:readline';
@@ -143,13 +148,6 @@ const TOOLS = [
143
148
  description: 'ANALYSIS ONLY: Read-only quantitative market series analytics (volatility, Sharpe, drawdown, RSI, regime). Zero execution; not financial advice (40 credits).',
144
149
  inputSchema: { type: 'object', required: ['prices'], properties: { symbol: { type: 'string' }, prices: { type: 'array', items: { type: 'number' } }, periods_per_year: { type: 'integer' }, risk_free_rate: { type: 'number' } } },
145
150
  },
146
- {
147
- name: 'dexmond_polyclaw_analyze',
148
- service: 'polyclaw',
149
- operation: 'analyze',
150
- description: 'ANALYSIS ONLY: Read-only prediction-market probability & calibration analytics (overround/vig, fair odds, EV, Kelly math, Brier score). Zero execution (40 credits).',
151
- inputSchema: { type: 'object', required: ['outcomes'], properties: { outcomes: { type: 'array', items: { type: 'object' } }, historical_forecasts: { type: 'array', items: { type: 'object' } } } },
152
- },
153
151
 
154
152
  // --- ORBITAL INTEL, GLOBAL RISK & ZERO-LEAK AI ---
155
153
  {
@@ -177,16 +175,255 @@ const TOOLS = [
177
175
  name: 'dexmond_security_review',
178
176
  service: 'ai',
179
177
  operation: 'security_review',
180
- description: 'Zero-trust static + AI code & config security audit detecting SQLi, XSS, hardcoded secrets, RCE primitives, and weak crypto (100 credits).',
178
+ description: 'Zero-trust 17-CWE static + AI code & config security audit detecting SSRF, Path Traversal, SQLi, XSS, Pickle/YAML deser, shell=True, JWT bypass, LLM01, and hardcoded secrets (100 credits).',
181
179
  inputSchema: { type: 'object', required: ['code'], properties: { code: { type: 'string' }, language: { type: 'string' }, deep_ai_analysis: { type: 'boolean' } } },
182
180
  },
181
+ {
182
+ name: 'dexmond_discover_modules',
183
+ service: 'modules',
184
+ operation: 'discover',
185
+ publicDiscovery: true,
186
+ description: 'Discover all verified Dexmond operational environments (Sentinel, Android ProLab, Shield, MIE, SQL-Alpha, CypherNight, Law, etc.), versions, pricing, and read_only vs. mutating safety classifications (free, no key required).',
187
+ inputSchema: {
188
+ type: 'object',
189
+ properties: {
190
+ module: { type: 'string', description: 'Optional module_id filter (e.g. sentinel, prolab, shield)' },
191
+ category: { type: 'string', description: 'Optional category filter (e.g. cybersecurity, device_operations)' },
192
+ access_class: { type: 'string', description: 'Optional access class filter (read_only, state_mutating, authorized_target_required, async_isolated_sandbox)' },
193
+ },
194
+ },
195
+ },
196
+
197
+ // --- LOCAL LOOPBACK EDGE AGENT BRIDGES (SELF-HOSTED ON 127.0.0.1) ---
198
+ {
199
+ name: 'dexmond_prolab_local_bridge',
200
+ service: 'prolab_bridge',
201
+ operation: 'local_bridge',
202
+ localBridge: 'prolab',
203
+ description: 'Call your local loopback-only Android ProLab Agent Bridge v1.1 (PROLAB_BRIDGE_URL, default http://127.0.0.1:18765) for read-only ADB/fastboot diagnostics or explicitly confirmed state-mutating device actions. Never sends requests to non-loopback hosts.',
204
+ inputSchema: {
205
+ type: 'object',
206
+ required: ['operation'],
207
+ properties: {
208
+ operation: {
209
+ type: 'string',
210
+ enum: [
211
+ 'health',
212
+ 'capabilities',
213
+ 'prolab.devices.list',
214
+ 'prolab.device.info',
215
+ 'prolab.device.battery',
216
+ 'prolab.device.logcat',
217
+ 'prolab.device.packages',
218
+ 'prolab.device.diagnostics',
219
+ 'prolab.device.tcpip',
220
+ 'prolab.device.reboot',
221
+ ],
222
+ description: 'ProLab bridge operation (read_only diagnostics, health/capabilities, or confirmation-gated tcpip/reboot).',
223
+ },
224
+ input: {
225
+ type: 'object',
226
+ description: 'Operation input payload (e.g. { serial, lines, mode }).',
227
+ },
228
+ confirm_action: {
229
+ type: 'boolean',
230
+ default: false,
231
+ description: 'Set true ONLY after explicit human authorization to send X-Dexmond-Confirm-Action: true for state_mutating operations.',
232
+ },
233
+ },
234
+ },
235
+ },
236
+ {
237
+ name: 'dexmond_sentinel_edge_bridge',
238
+ service: 'sentinel_bridge',
239
+ operation: 'edge_bridge',
240
+ localBridge: 'sentinel',
241
+ description: 'Call your local loopback-only Sentinel 2.0 Edge Agent Bridge v1.1 (SENTINEL_BRIDGE_URL, default http://127.0.0.1:18766) for read-only threat/rule/flow inspection or explicitly confirmed dynamic rule, throttle, or IPS rule enforcement. Never sends requests to non-loopback hosts.',
242
+ inputSchema: {
243
+ type: 'object',
244
+ required: ['endpoint'],
245
+ properties: {
246
+ endpoint: {
247
+ type: 'string',
248
+ enum: [
249
+ 'health',
250
+ 'capabilities',
251
+ 'core/status',
252
+ 'core/rules',
253
+ 'core/threats',
254
+ 'evaluate_flow',
255
+ 'enforce/dynamic_rule',
256
+ 'enforce/throttle',
257
+ 'enforce/ips_rule',
258
+ ],
259
+ description: 'Sentinel Edge Bridge v1.1 endpoint (GET for health/capabilities/core/*, POST for evaluate_flow and enforce/*).',
260
+ },
261
+ input: {
262
+ type: 'object',
263
+ description: 'JSON payload for POST endpoints (FlowFeatures or enforcement parameters).',
264
+ },
265
+ confirm_action: {
266
+ type: 'boolean',
267
+ default: false,
268
+ description: 'Set true ONLY after explicit human authorization to send X-Dexmond-Confirm-Action: true for state_mutating enforce/* endpoints.',
269
+ },
270
+ },
271
+ },
272
+ },
183
273
  ];
184
274
 
275
+ const PROLAB_BRIDGE_ALLOWED_OPS = new Set([
276
+ 'health',
277
+ 'capabilities',
278
+ 'prolab.devices.list',
279
+ 'prolab.device.info',
280
+ 'prolab.device.battery',
281
+ 'prolab.device.logcat',
282
+ 'prolab.device.packages',
283
+ 'prolab.device.diagnostics',
284
+ 'prolab.device.tcpip',
285
+ 'prolab.device.reboot',
286
+ ]);
287
+
288
+ const SENTINEL_BRIDGE_GET_ENDPOINTS = new Set([
289
+ 'health',
290
+ 'capabilities',
291
+ 'core/status',
292
+ 'core/rules',
293
+ 'core/threats',
294
+ ]);
295
+
296
+ const SENTINEL_BRIDGE_POST_ENDPOINTS = new Set([
297
+ 'evaluate_flow',
298
+ 'enforce/dynamic_rule',
299
+ 'enforce/throttle',
300
+ 'enforce/ips_rule',
301
+ ]);
302
+
303
+ function validateLoopbackBridgeUrl(rawUrl, envName) {
304
+ let parsed;
305
+ try {
306
+ parsed = new URL(String(rawUrl || '').trim());
307
+ } catch (_) {
308
+ throw new Error(`Invalid ${envName}: must be a valid loopback HTTP(S) URL.`);
309
+ }
310
+ if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
311
+ throw new Error(`Rejected ${envName}: only http:// or https:// loopback URLs are permitted.`);
312
+ }
313
+ if (parsed.username || parsed.password) {
314
+ throw new Error(`Rejected ${envName}: embedded URL credentials are forbidden.`);
315
+ }
316
+ const host = parsed.hostname.toLowerCase();
317
+ const isLoopback = host === '127.0.0.1' || host === 'localhost' || host === '::1' || host === '[::1]';
318
+ if (!isLoopback) {
319
+ throw new Error(
320
+ `SSRF_BLOCKED: ${envName} must target loopback only (127.0.0.1, localhost, or [::1]); got "${parsed.hostname}".`
321
+ );
322
+ }
323
+ return `${parsed.protocol}//${parsed.host}`;
324
+ }
325
+
326
+ async function invokeLocalBridge(bridgeType, args) {
327
+ const isProlab = bridgeType === 'prolab';
328
+ const urlEnvName = isProlab ? 'PROLAB_BRIDGE_URL' : 'SENTINEL_BRIDGE_URL';
329
+ const tokenEnvName = isProlab ? 'PROLAB_BRIDGE_TOKEN' : 'SENTINEL_BRIDGE_TOKEN';
330
+ const defaultUrl = isProlab ? 'http://127.0.0.1:18765' : 'http://127.0.0.1:18766';
331
+
332
+ let baseUrl;
333
+ try {
334
+ baseUrl = validateLoopbackBridgeUrl(process.env[urlEnvName] || defaultUrl, urlEnvName);
335
+ } catch (err) {
336
+ return { isError: true, content: [{ type: 'text', text: String(err.message || err) }] };
337
+ }
338
+
339
+ const token = (process.env[tokenEnvName] || '').trim();
340
+ const confirmAction = args?.confirm_action === true;
341
+ let method = 'GET';
342
+ let path = '';
343
+ let body = undefined;
344
+ let needsAuth = true;
345
+
346
+ if (isProlab) {
347
+ const operation = String(args?.operation || '').trim();
348
+ if (!PROLAB_BRIDGE_ALLOWED_OPS.has(operation)) {
349
+ return { isError: true, content: [{ type: 'text', text: `Unsupported ProLab bridge operation: "${operation}".` }] };
350
+ }
351
+ if (operation === 'health') {
352
+ method = 'GET';
353
+ path = '/v1/health';
354
+ needsAuth = false;
355
+ } else if (operation === 'capabilities') {
356
+ method = 'GET';
357
+ path = '/v1/capabilities';
358
+ } else {
359
+ method = 'POST';
360
+ path = '/v1/execute';
361
+ body = JSON.stringify({ operation, input: args?.input && typeof args.input === 'object' ? args.input : {} });
362
+ }
363
+ } else {
364
+ const endpoint = String(args?.endpoint || '').trim();
365
+ if (SENTINEL_BRIDGE_GET_ENDPOINTS.has(endpoint)) {
366
+ method = 'GET';
367
+ path = `/v1/${endpoint}`;
368
+ needsAuth = endpoint !== 'health';
369
+ } else if (SENTINEL_BRIDGE_POST_ENDPOINTS.has(endpoint)) {
370
+ method = 'POST';
371
+ path = `/v1/${endpoint}`;
372
+ body = JSON.stringify(args?.input && typeof args.input === 'object' ? args.input : {});
373
+ } else {
374
+ return { isError: true, content: [{ type: 'text', text: `Unsupported Sentinel bridge endpoint: "${endpoint}".` }] };
375
+ }
376
+ }
377
+
378
+ if (needsAuth && !token) {
379
+ return {
380
+ isError: true,
381
+ content: [{
382
+ type: 'text',
383
+ text: `${tokenEnvName} is not set. Start your local ${isProlab ? 'Android ProLab' : 'Sentinel 2.0'} bridge and configure ${tokenEnvName} in your MCP server environment.`,
384
+ }],
385
+ };
386
+ }
387
+
388
+ const headers = { Accept: 'application/json' };
389
+ if (needsAuth) headers.Authorization = `Bearer ${token}`;
390
+ if (body !== undefined) headers['Content-Type'] = 'application/json';
391
+ if (confirmAction) headers['X-Dexmond-Confirm-Action'] = 'true';
392
+
393
+ const res = await fetch(`${baseUrl}${path}`, {
394
+ method,
395
+ headers,
396
+ body,
397
+ signal: AbortSignal.timeout(15000),
398
+ });
399
+ const text = await res.text();
400
+ let parsed = null;
401
+ try { parsed = JSON.parse(text); } catch (_) {}
402
+ return {
403
+ isError: !res.ok || (parsed && parsed.ok === false),
404
+ content: [{ type: 'text', text: parsed ? JSON.stringify(parsed, null, 2) : text }],
405
+ };
406
+ }
407
+
185
408
  function send(obj) {
186
409
  process.stdout.write(JSON.stringify(obj) + '\n');
187
410
  }
188
411
 
412
+ const MODULES_URL = API_URL.replace(/\/commerce\.php$/, '/modules.php');
413
+
189
414
  async function invokeDexmond(tool, args) {
415
+ if (tool.localBridge) {
416
+ return invokeLocalBridge(tool.localBridge, args || {});
417
+ }
418
+ if (tool.publicDiscovery) {
419
+ const qs = new URLSearchParams();
420
+ if (args?.module) qs.set('module', String(args.module));
421
+ if (args?.category) qs.set('category', String(args.category));
422
+ if (args?.access_class) qs.set('access_class', String(args.access_class));
423
+ const res = await fetch(`${MODULES_URL}${qs.toString() ? `?${qs}` : ''}`, { headers: { Accept: 'application/json' } });
424
+ const text = await res.text();
425
+ return { isError: !res.ok, content: [{ type: 'text', text }] };
426
+ }
190
427
  if (!API_KEY) {
191
428
  return {
192
429
  isError: true,
@@ -216,7 +453,7 @@ async function invokeDexmond(tool, args) {
216
453
  };
217
454
  }
218
455
 
219
- const SERVER_VERSION = '2.1.0';
456
+ const SERVER_VERSION = '2.3.0';
220
457
 
221
458
  const PROMPTS = [
222
459
  {
@@ -244,14 +481,20 @@ const PROMPTS = [
244
481
  const RESOURCES = [
245
482
  {
246
483
  uri: 'dexmond://catalog/tools',
247
- name: 'Dexmond MCP Tool Catalog (22 Tools)',
248
- description: 'Live JSON catalog of all 22 EU-hosted security, AI firewall, SQL, GDPR/AI Act, malware, and DevSecOps tools.',
484
+ name: 'Dexmond MCP Tool Catalog (24 Tools)',
485
+ description: 'Live JSON catalog of all 24 EU-hosted security, AI firewall, SQL, GDPR/AI Act, malware, DevSecOps, and local loopback bridge tools.',
249
486
  mimeType: 'application/json',
250
487
  },
251
488
  {
252
489
  uri: 'dexmond://security/benchmark',
253
490
  name: 'Dexmond Adversarial Benchmark Metrics',
254
- description: 'Verified CI benchmark metrics (132 assertions, 25/25 Prompt Guard @ 0% FPR, 25/25 DLP @ 0% FPR, 17 CWE rules).',
491
+ description: 'Verified CI benchmark metrics (139 assertions, 25/25 Prompt Guard @ 0% FPR, 25/25 DLP @ 0% FPR, 17 CWE rules + module safety invariants).',
492
+ mimeType: 'application/json',
493
+ },
494
+ {
495
+ uri: 'dexmond://modules/registry',
496
+ name: 'Dexmond Operational Modules Discovery Registry',
497
+ description: 'Live machine-readable registry of Dexmond operational modules, access classes, scopes & pricing (/api/v1/modules.php).',
255
498
  mimeType: 'application/json',
256
499
  },
257
500
  ];
@@ -337,7 +580,7 @@ rl.on('line', async (line) => {
337
580
  uri,
338
581
  mimeType: 'application/json',
339
582
  text: JSON.stringify({
340
- total_assertions: 132,
583
+ total_assertions: 139,
341
584
  prompt_guard_v2: { attacks_caught: '25/25', benign_fpr: '0.0%' },
342
585
  shield_dlp_v2: { detectors: 62, recall: '25/25', benign_fpr: '0.0%' },
343
586
  mie_malware_hashes: 29737,
@@ -348,6 +591,15 @@ rl.on('line', async (line) => {
348
591
  },
349
592
  });
350
593
  }
594
+ if (uri === 'dexmond://modules/registry') {
595
+ try {
596
+ const res = await fetch(MODULES_URL, { headers: { Accept: 'application/json' } });
597
+ const text = await res.text();
598
+ return send({ jsonrpc: '2.0', id, result: { contents: [{ uri, mimeType: 'application/json', text }] } });
599
+ } catch (err) {
600
+ return send({ jsonrpc: '2.0', id, result: { contents: [{ uri, mimeType: 'application/json', text: JSON.stringify({ error: String(err.message || err), fallback_url: MODULES_URL }) }] } });
601
+ }
602
+ }
351
603
  return send({ jsonrpc: '2.0', id, error: { code: -32602, message: `Unknown resource URI: ${uri}` } });
352
604
  }
353
605
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dexmond/mcp-server",
3
- "version": "2.1.0",
4
- "description": "Official zero-dependency Dexmond Technologies MCP Server — exposes 22 EU-hosted security tools, 4 built-in slash prompts & 2 resources to Claude Code, Cursor, Windsurf, and MCP agents.",
3
+ "version": "2.3.0",
4
+ "description": "Official zero-dependency Dexmond Technologies MCP Server — exposes 25 EU-hosted operational security, discovery & loopback edge bridge tools (Sentinel & Android ProLab), 4 slash prompts & 3 resources.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "dexmond-mcp": "./index.mjs"
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "com.dexmond/dexmond-mcp",
4
4
  "title": "Dexmond Commercial API MCP Server (22 Security, Malware, SQL/RLS & Compliance Tools)",
5
5
  "description": "Zero-dependency official MCP server exposing 22 EU-hosted zero-payload-persistence tools: Dexmond Shield DLP v2 (62 detectors + Shannon entropy) & Prompt Guard v2, MIE V1.0 (29,700+ live malware IOCs + static scan), Android ProLab APK Audit, SQL-Alpha RLS Audit, Agent Law EU GDPR/AI Act, CypherNight Crypto/Forensics, Sentinel 2.0 Firewall Compiler, Project Elysium Orbital Decay, Orbital/Global Risk Intel & Zero-Leak AI.",
6
- "version": "2.1.0",
6
+ "version": "2.3.0",
7
7
  "homepage": "https://dexmond.com/integrations.html",
8
8
  "repository": {
9
9
  "url": "https://github.com/Dexmond-Technologies/dexmond-sdk",
@@ -14,7 +14,7 @@
14
14
  {
15
15
  "registryType": "npm",
16
16
  "identifier": "@dexmond/mcp-server",
17
- "version": "2.1.0",
17
+ "version": "2.3.0",
18
18
  "transport": {
19
19
  "type": "stdio"
20
20
  },