pulsefeed-x402-mcp 1.0.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/README.md +37 -0
  2. package/dist/index.js +57 -0
  3. package/package.json +22 -0
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # pulsefeed-x402-mcp
2
+
3
+ MCP server for the **x402 agent-payment ecosystem**. Gives AI agents (Claude Desktop, Cursor, Cline, Windsurf, VS Code) tools to navigate x402:
4
+
5
+ - **`x402_working_services`** — list x402 services that are actually alive (≈85% are dead/invalid).
6
+ - **`check_x402_endpoint`** — verify an endpoint returns a valid x402 challenge before paying it.
7
+ - **`pulsefeed_products`** — PulseFeed's paid on-chain intelligence products (Base token pulse, whale alerts, smart-money flow, momentum, trust oracle).
8
+
9
+ Backed by [PulseFeed](https://pulsefeed.dev/status).
10
+
11
+ ## Use in Claude Desktop / Cursor / Cline
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "pulsefeed-x402": {
17
+ "command": "npx",
18
+ "args": ["-y", "pulsefeed-x402-mcp"]
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ ## Local run
25
+ ```bash
26
+ npm install
27
+ npm run start # tsx dev run
28
+ # or build + run:
29
+ npm run build && node dist/index.js
30
+ ```
31
+
32
+ Config: `PULSEFEED_URL` env overrides the backend base URL.
33
+
34
+ ## Publish (maintainer)
35
+ ```bash
36
+ npm run build && npm publish --access public
37
+ ```
package/dist/index.js ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ // PulseFeed MCP server — самодостаточный, зовёт публичные эндпоинты PulseFeed.
3
+ // Даёт агентам в Claude Desktop / Cursor / Cline инструменты для навигации по x402-экосистеме.
4
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
+ import { z } from "zod";
7
+ const BASE = process.env.PULSEFEED_URL || "https://pulsefeed.dev";
8
+ const server = new McpServer({ name: "pulsefeed-x402", version: "1.0.0" });
9
+ server.registerTool("x402_working_services", {
10
+ description: "List x402 agent-payment services that are currently ALIVE and return a valid x402 challenge, ranked by trust score. About 85% of x402 endpoints are dead or invalid — use this to avoid paying broken or scam endpoints. Free.",
11
+ inputSchema: {},
12
+ }, async () => {
13
+ const r = await fetch(`${BASE}/status.json`);
14
+ const j = await r.json();
15
+ return { content: [{ type: "text", text: JSON.stringify(j, null, 2) }] };
16
+ });
17
+ server.registerTool("check_x402_endpoint", {
18
+ description: "Before paying an unknown x402 endpoint, check whether it is live and returns a valid x402 payment challenge. Returns liveness, price, network and a pay/avoid verdict. For full uptime + reputation, use PulseFeed's paid /trust API.",
19
+ inputSchema: { url: z.string().describe("The x402 endpoint URL to verify") },
20
+ }, async ({ url }) => {
21
+ const out = { url, reachable: false, valid: false };
22
+ try {
23
+ const ctrl = new AbortController();
24
+ const t = setTimeout(() => ctrl.abort(), 12000);
25
+ const res = await fetch(url, { signal: ctrl.signal, headers: { accept: "application/json" } });
26
+ clearTimeout(t);
27
+ out.reachable = true;
28
+ out.status = res.status;
29
+ if (res.status === 402) {
30
+ const b = await res.json().catch(() => null);
31
+ const a = b?.accepts?.[0];
32
+ out.valid = !!a;
33
+ if (a) {
34
+ out.price = a.maxAmountRequired;
35
+ out.network = a.network;
36
+ out.asset = a.asset;
37
+ out.payTo = a.payTo;
38
+ }
39
+ }
40
+ }
41
+ catch (e) {
42
+ out.error = e?.name === "AbortError" ? "timeout" : e?.message;
43
+ }
44
+ out.verdict = out.valid ? "live — valid x402, safe to consider paying" : "avoid — no valid x402 challenge";
45
+ out.fullReputation = `${BASE}/trust?endpoint=${encodeURIComponent(url)} (paid: adds uptime + reputation history)`;
46
+ return { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] };
47
+ });
48
+ server.registerTool("pulsefeed_products", {
49
+ description: "List PulseFeed's paid x402 products — real-time Base on-chain intelligence for AI agents: token pulse, whale alerts, smart-money accumulation/distribution, momentum, and the x402 trust oracle — and how to pay via x402.",
50
+ inputSchema: {},
51
+ }, async () => {
52
+ const r = await fetch(`${BASE}/`);
53
+ const j = await r.json();
54
+ return { content: [{ type: "text", text: JSON.stringify(j, null, 2) }] };
55
+ });
56
+ await server.connect(new StdioServerTransport());
57
+ console.error("pulsefeed-x402 MCP server running on stdio");
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "pulsefeed-x402-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for the x402 agent-payment ecosystem: find working x402 services, verify endpoints before paying, and access PulseFeed real-time Base on-chain intelligence.",
5
+ "type": "module",
6
+ "bin": { "pulsefeed-x402-mcp": "dist/index.js" },
7
+ "files": ["dist"],
8
+ "keywords": ["mcp", "x402", "agents", "onchain", "base", "crypto", "trust", "model-context-protocol"],
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "prepare": "tsc",
12
+ "start": "node --import tsx index.ts"
13
+ },
14
+ "dependencies": {
15
+ "@modelcontextprotocol/sdk": "^1.29.0",
16
+ "zod": "^4.4.3"
17
+ },
18
+ "devDependencies": {
19
+ "tsx": "^4.20.6",
20
+ "typescript": "^5.9.3"
21
+ }
22
+ }