auditor-mcp 0.1.1 → 0.1.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/index.js +14 -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
|
|
310
|
+
stellarTxUrl,
|
|
300
311
|
model: report?.model,
|
|
301
312
|
summary: summary || "No vulnerabilities found",
|
|
302
313
|
findings
|
|
@@ -395,6 +406,7 @@ ${rawBody}` }],
|
|
|
395
406
|
file: file_path,
|
|
396
407
|
protocol: "Stripe MPP / Stellar Testnet",
|
|
397
408
|
walletAddress: signer.address,
|
|
409
|
+
stellarTxUrl: report?.stellarTxUrl ?? null,
|
|
398
410
|
model: report?.model,
|
|
399
411
|
summary: summary || "No vulnerabilities found",
|
|
400
412
|
findings
|