phoenix-mcp-server 1.0.0 → 1.1.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.
- package/README.md +53 -53
- package/dist/index.js +44 -3
- package/package.json +51 -50
- package/server.json +26 -18
package/README.md
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
# Phoenix Zero MCP Server
|
|
2
|
-
|
|
3
|
-
Model Context Protocol server exposing L2 network health telemetry to AI agents.
|
|
4
|
-
|
|
5
|
-
## Tool: `preflight_network_health`
|
|
6
|
-
|
|
7
|
-
Determine whether an L2 network is currently suitable for transaction execution using kernel-level network telemetry.
|
|
8
|
-
|
|
9
|
-
**Parameters:**
|
|
10
|
-
- `chain` (optional) — one of: base, arbitrum, optimism, zksync, scroll, mantle, linea, blast, mode, taiko, polygon_zkevm, casper
|
|
11
|
-
- `metric` — `health_check` (free) | `rtt_ns` (x402 $0.01) | `revert_ratio` (x402 $0.01)
|
|
12
|
-
|
|
13
|
-
**Returns:** `PASS`, `DEGRADED`, or `FAIL` with evidence (uptime, staleness, sampling interval).
|
|
14
|
-
|
|
15
|
-
## Setup
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install
|
|
19
|
-
npm run build
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Claude Desktop
|
|
23
|
-
|
|
24
|
-
Add to `claude_desktop_config.json`:
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
"mcpServers": {
|
|
29
|
-
"phoenix-zero": {
|
|
30
|
-
"command": "node",
|
|
31
|
-
"args": ["/absolute/path/to/mcp-server/dist/index.js"]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Test with Inspector
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npx @modelcontextprotocol/inspector node dist/index.js
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Data Source
|
|
44
|
-
|
|
45
|
-
Live production oracle at `rtt.phoenix-ai.work`:
|
|
46
|
-
- 12 L2 chains monitored every 2 seconds
|
|
47
|
-
- eBPF XDP kernel-level probes
|
|
48
|
-
- BLAKE3 + Ed25519 integrity on every measurement
|
|
49
|
-
- x402 micropayment for premium data ($0.01/query)
|
|
50
|
-
|
|
51
|
-
## License
|
|
52
|
-
|
|
53
|
-
MIT
|
|
1
|
+
# Phoenix Zero MCP Server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol server exposing L2 network health telemetry to AI agents.
|
|
4
|
+
|
|
5
|
+
## Tool: `preflight_network_health`
|
|
6
|
+
|
|
7
|
+
Determine whether an L2 network is currently suitable for transaction execution using kernel-level network telemetry.
|
|
8
|
+
|
|
9
|
+
**Parameters:**
|
|
10
|
+
- `chain` (optional) — one of: base, arbitrum, optimism, zksync, scroll, mantle, linea, blast, mode, taiko, polygon_zkevm, casper
|
|
11
|
+
- `metric` — `health_check` (free) | `rtt_ns` (x402 $0.01) | `revert_ratio` (x402 $0.01)
|
|
12
|
+
|
|
13
|
+
**Returns:** `PASS`, `DEGRADED`, or `FAIL` with evidence (uptime, staleness, sampling interval).
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Claude Desktop
|
|
23
|
+
|
|
24
|
+
Add to `claude_desktop_config.json`:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"phoenix-zero": {
|
|
30
|
+
"command": "node",
|
|
31
|
+
"args": ["/absolute/path/to/mcp-server/dist/index.js"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Test with Inspector
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Data Source
|
|
44
|
+
|
|
45
|
+
Live production oracle at `rtt.phoenix-ai.work`:
|
|
46
|
+
- 12 L2 chains monitored every 2 seconds
|
|
47
|
+
- eBPF XDP kernel-level probes
|
|
48
|
+
- BLAKE3 + Ed25519 integrity on every measurement
|
|
49
|
+
- x402 micropayment for premium data ($0.01/query)
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,16 @@ async function fetchHealth() {
|
|
|
27
27
|
}
|
|
28
28
|
return res.json();
|
|
29
29
|
}
|
|
30
|
+
async function fetchDemoSafe(chain) {
|
|
31
|
+
const url = chain
|
|
32
|
+
? `${PHOENIX_BASE}/api/v1/demo/safe?chain=${chain}`
|
|
33
|
+
: `${PHOENIX_BASE}/api/v1/demo/safe`;
|
|
34
|
+
const res = await fetch(url);
|
|
35
|
+
if (!res.ok) {
|
|
36
|
+
throw new Error(`Demo endpoint returned ${res.status}`);
|
|
37
|
+
}
|
|
38
|
+
return res.json();
|
|
39
|
+
}
|
|
30
40
|
async function fetchChainHealth(chain) {
|
|
31
41
|
const res = await fetch(`${PHOENIX_BASE}/api/v1/chains/${chain}`);
|
|
32
42
|
if (res.status === 402)
|
|
@@ -37,7 +47,37 @@ async function fetchChainHealth(chain) {
|
|
|
37
47
|
}
|
|
38
48
|
const server = new McpServer({
|
|
39
49
|
name: "phoenix-zero",
|
|
40
|
-
version: "1.
|
|
50
|
+
version: "1.1.0",
|
|
51
|
+
});
|
|
52
|
+
server.tool("check_safety_free", `FREE safety check for L2 networks — no payment required (100 calls/IP/day). Returns safe/unsafe verdict with reason code. Use this first to sample data before committing to paid x402 endpoints. Prevents $5-$15 gas loss on failed transactions during sequencer stalls.`, {
|
|
53
|
+
chain: z
|
|
54
|
+
.enum(CHAINS)
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("L2 chain to check. Defaults to Base if omitted."),
|
|
57
|
+
}, async ({ chain }) => {
|
|
58
|
+
try {
|
|
59
|
+
const data = await fetchDemoSafe(chain);
|
|
60
|
+
return {
|
|
61
|
+
content: [
|
|
62
|
+
{
|
|
63
|
+
type: "text",
|
|
64
|
+
text: JSON.stringify(data, null, 2),
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: "text",
|
|
75
|
+
text: JSON.stringify({ error: message, source: PHOENIX_BASE }, null, 2),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
isError: true,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
41
81
|
});
|
|
42
82
|
server.tool("preflight_network_health", `Determine whether an L2 network is currently suitable for transaction execution using kernel-level network telemetry. Returns PASS, DEGRADED, or FAIL with RTT, packet-loss and timestamp evidence. Covers 12 L2 chains (Base, Arbitrum, Optimism, zkSync, Scroll, Mantle, Linea, Blast, Mode, Taiko, Polygon zkEVM, Casper). Data sourced from eBPF XDP probes with 2-second sampling interval, signed with BLAKE3+Ed25519.`, {
|
|
43
83
|
chain: z
|
|
@@ -97,12 +137,13 @@ server.tool("preflight_network_health", `Determine whether an L2 network is curr
|
|
|
97
137
|
price: "$0.01 USDC",
|
|
98
138
|
payment_protocol: "x402 (HTTP 402 micropayment)",
|
|
99
139
|
endpoint: premiumEndpoint,
|
|
140
|
+
preflight_endpoint: `${PHOENIX_BASE}/api/v1/preflight`,
|
|
141
|
+
preflight_note: "POST /api/v1/preflight with {chain} body returns deterministic PASS/DEGRADED/FAIL with evidence_id proving exact network state at decision time.",
|
|
100
142
|
payment_rails: [
|
|
101
143
|
{ network: "Base mainnet (eip155:8453)", asset: "USDC" },
|
|
102
144
|
{ network: "Hedera testnet", asset: "native HBAR" },
|
|
103
145
|
],
|
|
104
|
-
how_to_pay: "Send
|
|
105
|
-
discovery: `${PHOENIX_BASE}/.well-known/x402`,
|
|
146
|
+
how_to_pay: "Send request to the endpoint. Server returns 402 with payment-required header containing x402 challenge. Complete payment flow to receive data.",
|
|
106
147
|
}, null, 2),
|
|
107
148
|
},
|
|
108
149
|
],
|
package/package.json
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "phoenix-mcp-server",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"mcp
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "phoenix-mcp-server",
|
|
3
|
+
"mcpName": "io.github.kant19801201behax5/phoenix-mcp-server",
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"description": "MCP server for Phoenix Zero L2 health oracle — kernel-level network telemetry for AI agents",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"phoenix-mcp-server": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"server.json"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"start": "node dist/index.js",
|
|
17
|
+
"dev": "tsx src/index.ts",
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"mcp",
|
|
23
|
+
"mcp-server",
|
|
24
|
+
"l2",
|
|
25
|
+
"sequencer",
|
|
26
|
+
"health",
|
|
27
|
+
"oracle",
|
|
28
|
+
"ebpf",
|
|
29
|
+
"x402",
|
|
30
|
+
"phoenix-zero",
|
|
31
|
+
"preflight",
|
|
32
|
+
"defi",
|
|
33
|
+
"agent"
|
|
34
|
+
],
|
|
35
|
+
"author": "Kent <aleksandrkent64@gmail.com>",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/kant19801201behax5/x402-health-oracle"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@modelcontextprotocol/sdk": "^1.11.0",
|
|
43
|
+
"zod": "^3.23.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^22.14.0",
|
|
47
|
+
"tsx": "^4.23.1",
|
|
48
|
+
"typescript": "~5.8.2",
|
|
49
|
+
"vitest": "^4.1.10"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/server.json
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.kant19801201behax5/phoenix-mcp-server",
|
|
4
|
+
"title": "Phoenix Zero — L2 Health Oracle",
|
|
5
|
+
"description": "Pre-flight L2 health check using kernel-level eBPF telemetry. PASS/DEGRADED/FAIL verdict.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"url": "https://github.com/kant19801201behax5/x402-health-oracle",
|
|
8
|
+
"source": "github"
|
|
9
|
+
},
|
|
10
|
+
"version": "1.0.1",
|
|
11
|
+
"packages": [
|
|
12
|
+
{
|
|
13
|
+
"registryType": "npm",
|
|
14
|
+
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
|
+
"identifier": "phoenix-mcp-server",
|
|
16
|
+
"version": "1.0.1",
|
|
17
|
+
"transport": { "type": "stdio" }
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"tools": [
|
|
21
|
+
{
|
|
22
|
+
"name": "preflight_network_health",
|
|
23
|
+
"description": "Determine whether an L2 network is suitable for transaction execution using kernel-level telemetry."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|