Spaces:
Sleeping
Sleeping
feat: add MCP server for Claude Code / Codex / MCP-compatible agents
Browse files- README.md +25 -4
- mcp-server.js +120 -0
- package-lock.json +252 -1
- package.json +8 -1
README.md
CHANGED
|
@@ -163,7 +163,28 @@ Example transaction: [`5c898eb4...`](https://stellar.expert/explorer/testnet/tx/
|
|
| 163 |
|
| 164 |
## Using the Service
|
| 165 |
|
| 166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
|
| 168 |
```javascript
|
| 169 |
import { wrapFetchWithPayment } from "@x402/fetch";
|
|
@@ -176,14 +197,14 @@ const data = await response.json();
|
|
| 176 |
// { title: "Stellar (@StellarOrg) / X", content: "9,913 posts...", ... }
|
| 177 |
```
|
| 178 |
|
| 179 |
-
|
| 180 |
- `@x402/fetch` + `@x402/stellar` (npm packages)
|
| 181 |
- A Stellar wallet with USDC
|
| 182 |
- Our URL
|
| 183 |
|
| 184 |
-
## Try It
|
| 185 |
|
| 186 |
-
`demo-client.js` is included to test the service end-to-end
|
| 187 |
|
| 188 |
```bash
|
| 189 |
npm install
|
|
|
|
| 163 |
|
| 164 |
## Using the Service
|
| 165 |
|
| 166 |
+
### Option 1: MCP Tool (Claude Code, Codex, any MCP-compatible agent)
|
| 167 |
+
|
| 168 |
+
Add to your MCP config (`.mcp.json` or Claude Code settings):
|
| 169 |
+
|
| 170 |
+
```json
|
| 171 |
+
{
|
| 172 |
+
"mcpServers": {
|
| 173 |
+
"rendergate": {
|
| 174 |
+
"command": "node",
|
| 175 |
+
"args": ["/path/to/rendergate/mcp-server.js"],
|
| 176 |
+
"env": {
|
| 177 |
+
"STELLAR_PRIVATE_KEY": "S...your_testnet_secret_key...",
|
| 178 |
+
"RENDERGATE_URL": "https://tantk-rendergate.hf.space"
|
| 179 |
+
}
|
| 180 |
+
}
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
Then the agent can simply call `render_page("https://x.com/stellarorg")` — payment happens transparently.
|
| 186 |
+
|
| 187 |
+
### Option 2: x402 Fetch (any Node.js agent)
|
| 188 |
|
| 189 |
```javascript
|
| 190 |
import { wrapFetchWithPayment } from "@x402/fetch";
|
|
|
|
| 197 |
// { title: "Stellar (@StellarOrg) / X", content: "9,913 posts...", ... }
|
| 198 |
```
|
| 199 |
|
| 200 |
+
The agent just needs:
|
| 201 |
- `@x402/fetch` + `@x402/stellar` (npm packages)
|
| 202 |
- A Stellar wallet with USDC
|
| 203 |
- Our URL
|
| 204 |
|
| 205 |
+
### Try It
|
| 206 |
|
| 207 |
+
`demo-client.js` is included to test the service end-to-end:
|
| 208 |
|
| 209 |
```bash
|
| 210 |
npm install
|
mcp-server.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
import "dotenv/config";
|
| 3 |
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
| 4 |
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
| 5 |
+
import { z } from "zod";
|
| 6 |
+
import { Transaction, TransactionBuilder } from "@stellar/stellar-sdk";
|
| 7 |
+
import { x402Client, x402HTTPClient } from "@x402/fetch";
|
| 8 |
+
import { createEd25519Signer, getNetworkPassphrase } from "@x402/stellar";
|
| 9 |
+
import { ExactStellarScheme } from "@x402/stellar/exact/client";
|
| 10 |
+
|
| 11 |
+
const STELLAR_PRIVATE_KEY = process.env.STELLAR_PRIVATE_KEY;
|
| 12 |
+
const SERVER_URL = process.env.RENDERGATE_URL || "https://tantk-rendergate.hf.space";
|
| 13 |
+
const NETWORK = "stellar:testnet";
|
| 14 |
+
const STELLAR_RPC_URL = "https://soroban-testnet.stellar.org";
|
| 15 |
+
|
| 16 |
+
// Setup x402 payment client
|
| 17 |
+
let httpClient = null;
|
| 18 |
+
let client = null;
|
| 19 |
+
|
| 20 |
+
function getPaymentClient() {
|
| 21 |
+
if (!client && STELLAR_PRIVATE_KEY) {
|
| 22 |
+
const signer = createEd25519Signer(STELLAR_PRIVATE_KEY, NETWORK);
|
| 23 |
+
client = new x402Client().register(
|
| 24 |
+
"stellar:*",
|
| 25 |
+
new ExactStellarScheme(signer, { url: STELLAR_RPC_URL }),
|
| 26 |
+
);
|
| 27 |
+
httpClient = new x402HTTPClient(client);
|
| 28 |
+
}
|
| 29 |
+
return { client, httpClient };
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
async function paidRender(url) {
|
| 33 |
+
const { client, httpClient } = getPaymentClient();
|
| 34 |
+
if (!client) {
|
| 35 |
+
throw new Error("STELLAR_PRIVATE_KEY not set — cannot make x402 payments");
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
const renderEndpoint = `${SERVER_URL}/render?url=${encodeURIComponent(url)}`;
|
| 39 |
+
|
| 40 |
+
// Step 1: Get 402 response
|
| 41 |
+
const firstTry = await fetch(renderEndpoint);
|
| 42 |
+
if (firstTry.status !== 402) {
|
| 43 |
+
return await firstTry.json();
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
// Step 2: Create payment
|
| 47 |
+
const paymentRequired = httpClient.getPaymentRequiredResponse((name) =>
|
| 48 |
+
firstTry.headers.get(name),
|
| 49 |
+
);
|
| 50 |
+
|
| 51 |
+
let paymentPayload = await client.createPaymentPayload(paymentRequired);
|
| 52 |
+
const networkPassphrase = getNetworkPassphrase(NETWORK);
|
| 53 |
+
const tx = new Transaction(
|
| 54 |
+
paymentPayload.payload.transaction,
|
| 55 |
+
networkPassphrase,
|
| 56 |
+
);
|
| 57 |
+
const sorobanData = tx.toEnvelope().v1()?.tx()?.ext()?.sorobanData();
|
| 58 |
+
if (sorobanData) {
|
| 59 |
+
paymentPayload = {
|
| 60 |
+
...paymentPayload,
|
| 61 |
+
payload: {
|
| 62 |
+
...paymentPayload.payload,
|
| 63 |
+
transaction: TransactionBuilder.cloneFrom(tx, {
|
| 64 |
+
fee: "1",
|
| 65 |
+
sorobanData,
|
| 66 |
+
networkPassphrase,
|
| 67 |
+
})
|
| 68 |
+
.build()
|
| 69 |
+
.toXDR(),
|
| 70 |
+
},
|
| 71 |
+
};
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
// Step 3: Send paid request
|
| 75 |
+
const headers = httpClient.encodePaymentSignatureHeader(paymentPayload);
|
| 76 |
+
const resp = await fetch(renderEndpoint, { method: "GET", headers });
|
| 77 |
+
|
| 78 |
+
if (!resp.ok) {
|
| 79 |
+
const text = await resp.text();
|
| 80 |
+
throw new Error(`Render failed (${resp.status}): ${text}`);
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
return await resp.json();
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
// Create MCP server
|
| 87 |
+
const server = new McpServer({
|
| 88 |
+
name: "rendergate",
|
| 89 |
+
version: "1.0.0",
|
| 90 |
+
});
|
| 91 |
+
|
| 92 |
+
server.tool(
|
| 93 |
+
"render_page",
|
| 94 |
+
"Render a JavaScript-heavy webpage using a headless browser. Pays $0.001 USDC on Stellar per request via x402. Use this when standard HTTP fetch returns empty content from SPAs, Twitter/X, LinkedIn, DeFi apps, or Cloudflare-protected sites.",
|
| 95 |
+
{
|
| 96 |
+
url: z.string().url().describe("The URL to render (must be public http/https)"),
|
| 97 |
+
},
|
| 98 |
+
async ({ url }) => {
|
| 99 |
+
try {
|
| 100 |
+
const result = await paidRender(url);
|
| 101 |
+
return {
|
| 102 |
+
content: [
|
| 103 |
+
{
|
| 104 |
+
type: "text",
|
| 105 |
+
text: `# ${result.title}\n\nURL: ${result.url}\nRendered: ${result.renderedAt}\nRender time: ${result.renderTimeMs}ms\nPayment: ${result.payment?.price} on ${result.payment?.network}\n\n${result.content}`,
|
| 106 |
+
},
|
| 107 |
+
],
|
| 108 |
+
};
|
| 109 |
+
} catch (err) {
|
| 110 |
+
return {
|
| 111 |
+
content: [{ type: "text", text: `Error: ${err.message}` }],
|
| 112 |
+
isError: true,
|
| 113 |
+
};
|
| 114 |
+
}
|
| 115 |
+
},
|
| 116 |
+
);
|
| 117 |
+
|
| 118 |
+
// Start
|
| 119 |
+
const transport = new StdioServerTransport();
|
| 120 |
+
await server.connect(transport);
|
package-lock.json
CHANGED
|
@@ -7,8 +7,9 @@
|
|
| 7 |
"": {
|
| 8 |
"name": "rendergate",
|
| 9 |
"version": "1.0.0",
|
| 10 |
-
"license": "
|
| 11 |
"dependencies": {
|
|
|
|
| 12 |
"@stellar/stellar-sdk": "^15.0.1",
|
| 13 |
"@x402/core": "^2.9.0",
|
| 14 |
"@x402/express": "^2.9.0",
|
|
@@ -26,6 +27,79 @@
|
|
| 26 |
"license": "MIT",
|
| 27 |
"peer": true
|
| 28 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
"node_modules/@noble/ciphers": {
|
| 30 |
"version": "1.3.0",
|
| 31 |
"resolved": "https://registry.npmmirror.com/@noble/ciphers/-/ciphers-1.3.0.tgz",
|
|
@@ -375,6 +449,23 @@
|
|
| 375 |
"url": "https://github.com/sponsors/epoberezkin"
|
| 376 |
}
|
| 377 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 378 |
"node_modules/apg-js": {
|
| 379 |
"version": "4.4.0",
|
| 380 |
"resolved": "https://registry.npmmirror.com/apg-js/-/apg-js-4.4.0.tgz",
|
|
@@ -616,6 +707,37 @@
|
|
| 616 |
"node": ">=6.6.0"
|
| 617 |
}
|
| 618 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 619 |
"node_modules/debug": {
|
| 620 |
"version": "4.4.3",
|
| 621 |
"resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz",
|
|
@@ -839,6 +961,15 @@
|
|
| 839 |
"node": ">=12.0.0"
|
| 840 |
}
|
| 841 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 842 |
"node_modules/express": {
|
| 843 |
"version": "5.2.1",
|
| 844 |
"resolved": "https://registry.npmmirror.com/express/-/express-5.2.1.tgz",
|
|
@@ -882,6 +1013,24 @@
|
|
| 882 |
"url": "https://opencollective.com/express"
|
| 883 |
}
|
| 884 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 885 |
"node_modules/fast-deep-equal": {
|
| 886 |
"version": "3.1.3",
|
| 887 |
"resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
|
@@ -1147,6 +1296,15 @@
|
|
| 1147 |
"node": ">= 0.4"
|
| 1148 |
}
|
| 1149 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1150 |
"node_modules/http-errors": {
|
| 1151 |
"version": "2.0.1",
|
| 1152 |
"resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.1.tgz",
|
|
@@ -1209,6 +1367,15 @@
|
|
| 1209 |
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
| 1210 |
"license": "ISC"
|
| 1211 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1212 |
"node_modules/ipaddr.js": {
|
| 1213 |
"version": "1.9.1",
|
| 1214 |
"resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
|
@@ -1269,6 +1436,12 @@
|
|
| 1269 |
"integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
|
| 1270 |
"license": "MIT"
|
| 1271 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1272 |
"node_modules/isows": {
|
| 1273 |
"version": "1.0.7",
|
| 1274 |
"resolved": "https://registry.npmmirror.com/isows/-/isows-1.0.7.tgz",
|
|
@@ -1299,6 +1472,12 @@
|
|
| 1299 |
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
| 1300 |
"license": "MIT"
|
| 1301 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1302 |
"node_modules/math-intrinsics": {
|
| 1303 |
"version": "1.1.0",
|
| 1304 |
"resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
|
@@ -1369,6 +1548,15 @@
|
|
| 1369 |
"node": ">= 0.6"
|
| 1370 |
}
|
| 1371 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1372 |
"node_modules/object-inspect": {
|
| 1373 |
"version": "1.13.4",
|
| 1374 |
"resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz",
|
|
@@ -1462,6 +1650,15 @@
|
|
| 1462 |
"node": ">= 0.8"
|
| 1463 |
}
|
| 1464 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1465 |
"node_modules/path-to-regexp": {
|
| 1466 |
"version": "8.4.2",
|
| 1467 |
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
|
|
@@ -1472,6 +1669,15 @@
|
|
| 1472 |
"url": "https://opencollective.com/express"
|
| 1473 |
}
|
| 1474 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1475 |
"node_modules/playwright": {
|
| 1476 |
"version": "1.59.1",
|
| 1477 |
"resolved": "https://registry.npmmirror.com/playwright/-/playwright-1.59.1.tgz",
|
|
@@ -1729,6 +1935,27 @@
|
|
| 1729 |
"url": "https://github.com/sponsors/ljharb"
|
| 1730 |
}
|
| 1731 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1732 |
"node_modules/side-channel": {
|
| 1733 |
"version": "1.1.0",
|
| 1734 |
"resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz",
|
|
@@ -2006,6 +2233,21 @@
|
|
| 2006 |
}
|
| 2007 |
}
|
| 2008 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2009 |
"node_modules/which-typed-array": {
|
| 2010 |
"version": "1.1.20",
|
| 2011 |
"resolved": "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.20.tgz",
|
|
@@ -2063,6 +2305,15 @@
|
|
| 2063 |
"funding": {
|
| 2064 |
"url": "https://github.com/sponsors/colinhacks"
|
| 2065 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2066 |
}
|
| 2067 |
}
|
| 2068 |
}
|
|
|
|
| 7 |
"": {
|
| 8 |
"name": "rendergate",
|
| 9 |
"version": "1.0.0",
|
| 10 |
+
"license": "MIT",
|
| 11 |
"dependencies": {
|
| 12 |
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
| 13 |
"@stellar/stellar-sdk": "^15.0.1",
|
| 14 |
"@x402/core": "^2.9.0",
|
| 15 |
"@x402/express": "^2.9.0",
|
|
|
|
| 27 |
"license": "MIT",
|
| 28 |
"peer": true
|
| 29 |
},
|
| 30 |
+
"node_modules/@hono/node-server": {
|
| 31 |
+
"version": "1.19.14",
|
| 32 |
+
"resolved": "https://registry.npmmirror.com/@hono/node-server/-/node-server-1.19.14.tgz",
|
| 33 |
+
"integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==",
|
| 34 |
+
"license": "MIT",
|
| 35 |
+
"engines": {
|
| 36 |
+
"node": ">=18.14.1"
|
| 37 |
+
},
|
| 38 |
+
"peerDependencies": {
|
| 39 |
+
"hono": "^4"
|
| 40 |
+
}
|
| 41 |
+
},
|
| 42 |
+
"node_modules/@modelcontextprotocol/sdk": {
|
| 43 |
+
"version": "1.29.0",
|
| 44 |
+
"resolved": "https://registry.npmmirror.com/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz",
|
| 45 |
+
"integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==",
|
| 46 |
+
"license": "MIT",
|
| 47 |
+
"dependencies": {
|
| 48 |
+
"@hono/node-server": "^1.19.9",
|
| 49 |
+
"ajv": "^8.17.1",
|
| 50 |
+
"ajv-formats": "^3.0.1",
|
| 51 |
+
"content-type": "^1.0.5",
|
| 52 |
+
"cors": "^2.8.5",
|
| 53 |
+
"cross-spawn": "^7.0.5",
|
| 54 |
+
"eventsource": "^3.0.2",
|
| 55 |
+
"eventsource-parser": "^3.0.0",
|
| 56 |
+
"express": "^5.2.1",
|
| 57 |
+
"express-rate-limit": "^8.2.1",
|
| 58 |
+
"hono": "^4.11.4",
|
| 59 |
+
"jose": "^6.1.3",
|
| 60 |
+
"json-schema-typed": "^8.0.2",
|
| 61 |
+
"pkce-challenge": "^5.0.0",
|
| 62 |
+
"raw-body": "^3.0.0",
|
| 63 |
+
"zod": "^3.25 || ^4.0",
|
| 64 |
+
"zod-to-json-schema": "^3.25.1"
|
| 65 |
+
},
|
| 66 |
+
"engines": {
|
| 67 |
+
"node": ">=18"
|
| 68 |
+
},
|
| 69 |
+
"peerDependencies": {
|
| 70 |
+
"@cfworker/json-schema": "^4.1.1",
|
| 71 |
+
"zod": "^3.25 || ^4.0"
|
| 72 |
+
},
|
| 73 |
+
"peerDependenciesMeta": {
|
| 74 |
+
"@cfworker/json-schema": {
|
| 75 |
+
"optional": true
|
| 76 |
+
},
|
| 77 |
+
"zod": {
|
| 78 |
+
"optional": false
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
},
|
| 82 |
+
"node_modules/@modelcontextprotocol/sdk/node_modules/eventsource": {
|
| 83 |
+
"version": "3.0.7",
|
| 84 |
+
"resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-3.0.7.tgz",
|
| 85 |
+
"integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==",
|
| 86 |
+
"license": "MIT",
|
| 87 |
+
"dependencies": {
|
| 88 |
+
"eventsource-parser": "^3.0.1"
|
| 89 |
+
},
|
| 90 |
+
"engines": {
|
| 91 |
+
"node": ">=18.0.0"
|
| 92 |
+
}
|
| 93 |
+
},
|
| 94 |
+
"node_modules/@modelcontextprotocol/sdk/node_modules/jose": {
|
| 95 |
+
"version": "6.2.2",
|
| 96 |
+
"resolved": "https://registry.npmmirror.com/jose/-/jose-6.2.2.tgz",
|
| 97 |
+
"integrity": "sha512-d7kPDd34KO/YnzaDOlikGpOurfF0ByC2sEV4cANCtdqLlTfBlw2p14O/5d/zv40gJPbIQxfES3nSx1/oYNyuZQ==",
|
| 98 |
+
"license": "MIT",
|
| 99 |
+
"funding": {
|
| 100 |
+
"url": "https://github.com/sponsors/panva"
|
| 101 |
+
}
|
| 102 |
+
},
|
| 103 |
"node_modules/@noble/ciphers": {
|
| 104 |
"version": "1.3.0",
|
| 105 |
"resolved": "https://registry.npmmirror.com/@noble/ciphers/-/ciphers-1.3.0.tgz",
|
|
|
|
| 449 |
"url": "https://github.com/sponsors/epoberezkin"
|
| 450 |
}
|
| 451 |
},
|
| 452 |
+
"node_modules/ajv-formats": {
|
| 453 |
+
"version": "3.0.1",
|
| 454 |
+
"resolved": "https://registry.npmmirror.com/ajv-formats/-/ajv-formats-3.0.1.tgz",
|
| 455 |
+
"integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
|
| 456 |
+
"license": "MIT",
|
| 457 |
+
"dependencies": {
|
| 458 |
+
"ajv": "^8.0.0"
|
| 459 |
+
},
|
| 460 |
+
"peerDependencies": {
|
| 461 |
+
"ajv": "^8.0.0"
|
| 462 |
+
},
|
| 463 |
+
"peerDependenciesMeta": {
|
| 464 |
+
"ajv": {
|
| 465 |
+
"optional": true
|
| 466 |
+
}
|
| 467 |
+
}
|
| 468 |
+
},
|
| 469 |
"node_modules/apg-js": {
|
| 470 |
"version": "4.4.0",
|
| 471 |
"resolved": "https://registry.npmmirror.com/apg-js/-/apg-js-4.4.0.tgz",
|
|
|
|
| 707 |
"node": ">=6.6.0"
|
| 708 |
}
|
| 709 |
},
|
| 710 |
+
"node_modules/cors": {
|
| 711 |
+
"version": "2.8.6",
|
| 712 |
+
"resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.6.tgz",
|
| 713 |
+
"integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
|
| 714 |
+
"license": "MIT",
|
| 715 |
+
"dependencies": {
|
| 716 |
+
"object-assign": "^4",
|
| 717 |
+
"vary": "^1"
|
| 718 |
+
},
|
| 719 |
+
"engines": {
|
| 720 |
+
"node": ">= 0.10"
|
| 721 |
+
},
|
| 722 |
+
"funding": {
|
| 723 |
+
"type": "opencollective",
|
| 724 |
+
"url": "https://opencollective.com/express"
|
| 725 |
+
}
|
| 726 |
+
},
|
| 727 |
+
"node_modules/cross-spawn": {
|
| 728 |
+
"version": "7.0.6",
|
| 729 |
+
"resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
| 730 |
+
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
| 731 |
+
"license": "MIT",
|
| 732 |
+
"dependencies": {
|
| 733 |
+
"path-key": "^3.1.0",
|
| 734 |
+
"shebang-command": "^2.0.0",
|
| 735 |
+
"which": "^2.0.1"
|
| 736 |
+
},
|
| 737 |
+
"engines": {
|
| 738 |
+
"node": ">= 8"
|
| 739 |
+
}
|
| 740 |
+
},
|
| 741 |
"node_modules/debug": {
|
| 742 |
"version": "4.4.3",
|
| 743 |
"resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz",
|
|
|
|
| 961 |
"node": ">=12.0.0"
|
| 962 |
}
|
| 963 |
},
|
| 964 |
+
"node_modules/eventsource-parser": {
|
| 965 |
+
"version": "3.0.6",
|
| 966 |
+
"resolved": "https://registry.npmmirror.com/eventsource-parser/-/eventsource-parser-3.0.6.tgz",
|
| 967 |
+
"integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==",
|
| 968 |
+
"license": "MIT",
|
| 969 |
+
"engines": {
|
| 970 |
+
"node": ">=18.0.0"
|
| 971 |
+
}
|
| 972 |
+
},
|
| 973 |
"node_modules/express": {
|
| 974 |
"version": "5.2.1",
|
| 975 |
"resolved": "https://registry.npmmirror.com/express/-/express-5.2.1.tgz",
|
|
|
|
| 1013 |
"url": "https://opencollective.com/express"
|
| 1014 |
}
|
| 1015 |
},
|
| 1016 |
+
"node_modules/express-rate-limit": {
|
| 1017 |
+
"version": "8.3.2",
|
| 1018 |
+
"resolved": "https://registry.npmmirror.com/express-rate-limit/-/express-rate-limit-8.3.2.tgz",
|
| 1019 |
+
"integrity": "sha512-77VmFeJkO0/rvimEDuUC5H30oqUC4EyOhyGccfqoLebB0oiEYfM7nwPrsDsBL1gsTpwfzX8SFy2MT3TDyRq+bg==",
|
| 1020 |
+
"license": "MIT",
|
| 1021 |
+
"dependencies": {
|
| 1022 |
+
"ip-address": "10.1.0"
|
| 1023 |
+
},
|
| 1024 |
+
"engines": {
|
| 1025 |
+
"node": ">= 16"
|
| 1026 |
+
},
|
| 1027 |
+
"funding": {
|
| 1028 |
+
"url": "https://github.com/sponsors/express-rate-limit"
|
| 1029 |
+
},
|
| 1030 |
+
"peerDependencies": {
|
| 1031 |
+
"express": ">= 4.11"
|
| 1032 |
+
}
|
| 1033 |
+
},
|
| 1034 |
"node_modules/fast-deep-equal": {
|
| 1035 |
"version": "3.1.3",
|
| 1036 |
"resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
|
|
|
| 1296 |
"node": ">= 0.4"
|
| 1297 |
}
|
| 1298 |
},
|
| 1299 |
+
"node_modules/hono": {
|
| 1300 |
+
"version": "4.12.12",
|
| 1301 |
+
"resolved": "https://registry.npmmirror.com/hono/-/hono-4.12.12.tgz",
|
| 1302 |
+
"integrity": "sha512-p1JfQMKaceuCbpJKAPKVqyqviZdS0eUxH9v82oWo1kb9xjQ5wA6iP3FNVAPDFlz5/p7d45lO+BpSk1tuSZMF4Q==",
|
| 1303 |
+
"license": "MIT",
|
| 1304 |
+
"engines": {
|
| 1305 |
+
"node": ">=16.9.0"
|
| 1306 |
+
}
|
| 1307 |
+
},
|
| 1308 |
"node_modules/http-errors": {
|
| 1309 |
"version": "2.0.1",
|
| 1310 |
"resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.1.tgz",
|
|
|
|
| 1367 |
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
| 1368 |
"license": "ISC"
|
| 1369 |
},
|
| 1370 |
+
"node_modules/ip-address": {
|
| 1371 |
+
"version": "10.1.0",
|
| 1372 |
+
"resolved": "https://registry.npmmirror.com/ip-address/-/ip-address-10.1.0.tgz",
|
| 1373 |
+
"integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==",
|
| 1374 |
+
"license": "MIT",
|
| 1375 |
+
"engines": {
|
| 1376 |
+
"node": ">= 12"
|
| 1377 |
+
}
|
| 1378 |
+
},
|
| 1379 |
"node_modules/ipaddr.js": {
|
| 1380 |
"version": "1.9.1",
|
| 1381 |
"resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
|
|
|
| 1436 |
"integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
|
| 1437 |
"license": "MIT"
|
| 1438 |
},
|
| 1439 |
+
"node_modules/isexe": {
|
| 1440 |
+
"version": "2.0.0",
|
| 1441 |
+
"resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz",
|
| 1442 |
+
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
| 1443 |
+
"license": "ISC"
|
| 1444 |
+
},
|
| 1445 |
"node_modules/isows": {
|
| 1446 |
"version": "1.0.7",
|
| 1447 |
"resolved": "https://registry.npmmirror.com/isows/-/isows-1.0.7.tgz",
|
|
|
|
| 1472 |
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
| 1473 |
"license": "MIT"
|
| 1474 |
},
|
| 1475 |
+
"node_modules/json-schema-typed": {
|
| 1476 |
+
"version": "8.0.2",
|
| 1477 |
+
"resolved": "https://registry.npmmirror.com/json-schema-typed/-/json-schema-typed-8.0.2.tgz",
|
| 1478 |
+
"integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==",
|
| 1479 |
+
"license": "BSD-2-Clause"
|
| 1480 |
+
},
|
| 1481 |
"node_modules/math-intrinsics": {
|
| 1482 |
"version": "1.1.0",
|
| 1483 |
"resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
|
|
|
| 1548 |
"node": ">= 0.6"
|
| 1549 |
}
|
| 1550 |
},
|
| 1551 |
+
"node_modules/object-assign": {
|
| 1552 |
+
"version": "4.1.1",
|
| 1553 |
+
"resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz",
|
| 1554 |
+
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
| 1555 |
+
"license": "MIT",
|
| 1556 |
+
"engines": {
|
| 1557 |
+
"node": ">=0.10.0"
|
| 1558 |
+
}
|
| 1559 |
+
},
|
| 1560 |
"node_modules/object-inspect": {
|
| 1561 |
"version": "1.13.4",
|
| 1562 |
"resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz",
|
|
|
|
| 1650 |
"node": ">= 0.8"
|
| 1651 |
}
|
| 1652 |
},
|
| 1653 |
+
"node_modules/path-key": {
|
| 1654 |
+
"version": "3.1.1",
|
| 1655 |
+
"resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
|
| 1656 |
+
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
| 1657 |
+
"license": "MIT",
|
| 1658 |
+
"engines": {
|
| 1659 |
+
"node": ">=8"
|
| 1660 |
+
}
|
| 1661 |
+
},
|
| 1662 |
"node_modules/path-to-regexp": {
|
| 1663 |
"version": "8.4.2",
|
| 1664 |
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
|
|
|
|
| 1669 |
"url": "https://opencollective.com/express"
|
| 1670 |
}
|
| 1671 |
},
|
| 1672 |
+
"node_modules/pkce-challenge": {
|
| 1673 |
+
"version": "5.0.1",
|
| 1674 |
+
"resolved": "https://registry.npmmirror.com/pkce-challenge/-/pkce-challenge-5.0.1.tgz",
|
| 1675 |
+
"integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==",
|
| 1676 |
+
"license": "MIT",
|
| 1677 |
+
"engines": {
|
| 1678 |
+
"node": ">=16.20.0"
|
| 1679 |
+
}
|
| 1680 |
+
},
|
| 1681 |
"node_modules/playwright": {
|
| 1682 |
"version": "1.59.1",
|
| 1683 |
"resolved": "https://registry.npmmirror.com/playwright/-/playwright-1.59.1.tgz",
|
|
|
|
| 1935 |
"url": "https://github.com/sponsors/ljharb"
|
| 1936 |
}
|
| 1937 |
},
|
| 1938 |
+
"node_modules/shebang-command": {
|
| 1939 |
+
"version": "2.0.0",
|
| 1940 |
+
"resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz",
|
| 1941 |
+
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
| 1942 |
+
"license": "MIT",
|
| 1943 |
+
"dependencies": {
|
| 1944 |
+
"shebang-regex": "^3.0.0"
|
| 1945 |
+
},
|
| 1946 |
+
"engines": {
|
| 1947 |
+
"node": ">=8"
|
| 1948 |
+
}
|
| 1949 |
+
},
|
| 1950 |
+
"node_modules/shebang-regex": {
|
| 1951 |
+
"version": "3.0.0",
|
| 1952 |
+
"resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
| 1953 |
+
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
| 1954 |
+
"license": "MIT",
|
| 1955 |
+
"engines": {
|
| 1956 |
+
"node": ">=8"
|
| 1957 |
+
}
|
| 1958 |
+
},
|
| 1959 |
"node_modules/side-channel": {
|
| 1960 |
"version": "1.1.0",
|
| 1961 |
"resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz",
|
|
|
|
| 2233 |
}
|
| 2234 |
}
|
| 2235 |
},
|
| 2236 |
+
"node_modules/which": {
|
| 2237 |
+
"version": "2.0.2",
|
| 2238 |
+
"resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz",
|
| 2239 |
+
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
| 2240 |
+
"license": "ISC",
|
| 2241 |
+
"dependencies": {
|
| 2242 |
+
"isexe": "^2.0.0"
|
| 2243 |
+
},
|
| 2244 |
+
"bin": {
|
| 2245 |
+
"node-which": "bin/node-which"
|
| 2246 |
+
},
|
| 2247 |
+
"engines": {
|
| 2248 |
+
"node": ">= 8"
|
| 2249 |
+
}
|
| 2250 |
+
},
|
| 2251 |
"node_modules/which-typed-array": {
|
| 2252 |
"version": "1.1.20",
|
| 2253 |
"resolved": "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.20.tgz",
|
|
|
|
| 2305 |
"funding": {
|
| 2306 |
"url": "https://github.com/sponsors/colinhacks"
|
| 2307 |
}
|
| 2308 |
+
},
|
| 2309 |
+
"node_modules/zod-to-json-schema": {
|
| 2310 |
+
"version": "3.25.2",
|
| 2311 |
+
"resolved": "https://registry.npmmirror.com/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz",
|
| 2312 |
+
"integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==",
|
| 2313 |
+
"license": "ISC",
|
| 2314 |
+
"peerDependencies": {
|
| 2315 |
+
"zod": "^3.25.28 || ^4"
|
| 2316 |
+
}
|
| 2317 |
}
|
| 2318 |
}
|
| 2319 |
}
|
package.json
CHANGED
|
@@ -7,11 +7,18 @@
|
|
| 7 |
"start": "node server.js",
|
| 8 |
"demo": "node demo-client.js"
|
| 9 |
},
|
| 10 |
-
"keywords": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
"author": "tantk",
|
| 12 |
"license": "MIT",
|
| 13 |
"type": "module",
|
| 14 |
"dependencies": {
|
|
|
|
| 15 |
"@stellar/stellar-sdk": "^15.0.1",
|
| 16 |
"@x402/core": "^2.9.0",
|
| 17 |
"@x402/express": "^2.9.0",
|
|
|
|
| 7 |
"start": "node server.js",
|
| 8 |
"demo": "node demo-client.js"
|
| 9 |
},
|
| 10 |
+
"keywords": [
|
| 11 |
+
"x402",
|
| 12 |
+
"stellar",
|
| 13 |
+
"render",
|
| 14 |
+
"headless-browser",
|
| 15 |
+
"micropayments"
|
| 16 |
+
],
|
| 17 |
"author": "tantk",
|
| 18 |
"license": "MIT",
|
| 19 |
"type": "module",
|
| 20 |
"dependencies": {
|
| 21 |
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
| 22 |
"@stellar/stellar-sdk": "^15.0.1",
|
| 23 |
"@x402/core": "^2.9.0",
|
| 24 |
"@x402/express": "^2.9.0",
|