auditor-mcp 0.1.2 → 0.1.4

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 (2) hide show
  1. package/dist/index.js +26 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
7
7
  import { readFile } from "fs/promises";
8
8
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
10
- import { wrapFetchWithPayment, x402Client, x402HTTPClient } from "@x402/fetch";
10
+ import { wrapFetchWithPayment, x402Client, x402HTTPClient, decodePaymentResponseHeader } from "@x402/fetch";
11
11
  import { Mppx as MppxClient } from "mppx/client";
12
12
  import { stellar as stellarMpp } from "@stellar/mpp/charge/client";
13
13
  import { z } from "zod";
@@ -256,6 +256,17 @@ server.tool(
256
256
  isError: true
257
257
  };
258
258
  }
259
+ let stellarTxUrl = null;
260
+ try {
261
+ const paymentResponseHeader = response.headers.get("PAYMENT-RESPONSE");
262
+ if (paymentResponseHeader) {
263
+ const settlement = decodePaymentResponseHeader(paymentResponseHeader);
264
+ if (settlement && typeof settlement.transaction === "string" && settlement.transaction) {
265
+ stellarTxUrl = `https://stellar.expert/explorer/testnet/tx/${settlement.transaction}`;
266
+ }
267
+ }
268
+ } catch {
269
+ }
259
270
  const rawBody = await response.text();
260
271
  if (!response.ok) {
261
272
  return {
@@ -296,7 +307,7 @@ ${rawBody}` }],
296
307
  file: file_path,
297
308
  protocol: "x402 / Stellar Testnet",
298
309
  walletAddress: signer.address,
299
- stellarTxUrl: report?.stellarTxUrl ?? null,
310
+ stellarTxUrl,
300
311
  model: report?.model,
301
312
  summary: summary || "No vulnerabilities found",
302
313
  findings
@@ -355,6 +366,18 @@ server.tool(
355
366
  isError: true
356
367
  };
357
368
  }
369
+ let mppStellarTxUrl = null;
370
+ try {
371
+ const receiptHeader = response.headers.get("Payment-Receipt");
372
+ if (receiptHeader) {
373
+ const json = Buffer.from(receiptHeader, "base64url").toString("utf8");
374
+ const receipt = JSON.parse(json);
375
+ if (receipt?.reference) {
376
+ mppStellarTxUrl = `https://stellar.expert/explorer/testnet/tx/${receipt.reference}`;
377
+ }
378
+ }
379
+ } catch {
380
+ }
358
381
  const rawBody = await response.text();
359
382
  if (!response.ok) {
360
383
  return {
@@ -395,7 +418,7 @@ ${rawBody}` }],
395
418
  file: file_path,
396
419
  protocol: "Stripe MPP / Stellar Testnet",
397
420
  walletAddress: signer.address,
398
- stellarTxUrl: report?.stellarTxUrl ?? null,
421
+ stellarTxUrl: mppStellarTxUrl,
399
422
  model: report?.model,
400
423
  summary: summary || "No vulnerabilities found",
401
424
  findings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auditor-mcp",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "MCP server that audits Soroban smart contracts via autonomous x402 / Stripe MPP payments on Stellar Testnet",
6
6
  "keywords": [