wickedapi-mcp 0.4.0 → 0.6.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 CHANGED
@@ -1,127 +1,11 @@
1
- # WickedAPI MCP Server
2
-
3
- MCP server for the whole [Wicked](https://wickedapi.com) suite — trading data, DeFi protocol health, token safety, brokerage sync, agent identity, reputation, a tool-reliability registry, hallucination checks, persistent agent memory, and x402 paywalls, in one server.
4
-
5
- **70 tools** across 10 live services. The first four are generated automatically from each service's own live `openapi.json`, so the list always matches what's deployed; the rest are hand-written because they use wallet signatures and non-`/v1` routes:
6
-
7
- | Service | Tools | Auth |
8
- | --- | --- | --- |
9
- | [Trading Data API](https://api.wickedapi.com) | 22 (unprefixed: `price`, `ohlcv`, `fvg`, `momentum_score`, `sentiment`, `macro_calendar`, …) | API key or x402, 5 free |
10
- | [Protocol Health Oracle](https://protocol-health-oracle.wickedapi.com) | 6 (`protocol_health_*`) | API key or x402, scoreboard free |
11
- | [Token Risk Oracle](https://token-risk-oracle.wickedapi.com) | 1 (`token_risk`) | 100% free, no key |
12
- | [Broker Sync API](https://broker-sync-api.wickedapi.com) | 6 (`broker_sync_*`) | API key or x402 |
13
- | [Wicked Reputation](https://stake.wickedapi.com) | 5 (`reputation_*`) | free, no key |
14
- | [Wicked Registry](https://registry.wickedapi.com) | 6 (`registry_*`) | search/detail: key or x402; featured/badge/report free; register needs your signature |
15
- | [Wicked Identity](https://verify.wickedapi.com) | 6 (`identity_*`) | status: key or x402; the rest need your wallet signature over a nonce |
16
- | [Wicked Sanity](https://sanity.wickedapi.com) | 2 (`sanity_check`, `sanity_check_batch`) | key or x402 |
17
- | [Wicked Memory](https://memory.wickedapi.com) | 8 (`memory_prepare`, `memory_store`, `memory_search`, …) | wallet signature on every call; only search is metered |
18
- | [x402 Paywall](https://paywall.wickedapi.com) | 8 (`paywall_*`) | `paywall_signup` is open; the rest need the tenant key |
19
-
20
- Plus **6 resources** (the platform directory, `llms.txt`, and each service's live endpoint catalog) and **7 prompts** (`rug_check`, `vet_dependency`, `morning_briefing`, `fact_check`, `verify_agent`, `find_reliable_tool`, `agent_memory_guide`) that chain tools together the way the [cookbook](../cookbooks/wickedapi-cookbook.md) does.
21
-
22
- These tools never sign anything or hold a key. Identity, Registry registration and Memory take a signature you produce with your own wallet (`identity_get_nonce` / `memory_prepare` return the exact message to sign). Calls that need x402 payment return the real `402` challenge (decoded under `payment_required` for x402 v2) rather than auto-paying — `WICKEDAPI_PAYER_PRIVATE_KEY` auto-pay applies to the Trading, Protocol Health, Token Risk and Broker Sync tools.
23
-
24
- ## Remote endpoint (no install)
25
-
26
- The same 70 tools are served over streamable HTTP at **`https://mcp.wickedapi.com/mcp`** (stateless, rate-limited per IP; the public deployment carries no personal keys, so paid calls return the x402 challenge). Point any streamable-HTTP MCP client at it. To self-host, build the `Dockerfile` (or `npm run build && npm run start:http`); see `.env.example` for `RATE_LIMIT_PER_MINUTE`, `ALLOWED_HOSTS` and `TRUSTED_CLIENT_IP_HEADER`.
27
-
28
- ## No signup required
29
-
30
- Every tool hits a real endpoint gated by [x402](https://x402.org) (HTTP-native pay-per-call, USDC on Base) with an API-key fallback — and the Token Risk Oracle tool is free no matter what:
31
-
32
- - **Zero config** — calls without credentials still work; paid endpoints return the real `402` payment challenge (price, network, `payTo`) as the tool result.
33
- - **Autonomous pay-per-call** — set `WICKEDAPI_PAYER_PRIVATE_KEY` to a funded Base-mainnet wallet's private key, and every call auto-pays ~$0.001 in USDC and returns real data. No account, no subscription.
34
- - **Partner API key** — set `WICKEDAPI_API_KEY` for free, rate-limited access across all four services (same key works everywhere).
35
-
36
- ## Install
37
-
38
- ```json
39
- {
40
- "mcpServers": {
41
- "wickedapi": {
42
- "command": "npx",
43
- "args": ["-y", "wickedapi-mcp"],
44
- "env": {
45
- "WICKEDAPI_API_KEY": "your-key-here"
46
- }
47
- }
48
- }
49
- }
50
- ```
51
-
52
- Or for autonomous pay-per-call instead of a key:
53
-
54
- ```json
55
- {
56
- "mcpServers": {
57
- "wickedapi": {
58
- "command": "npx",
59
- "args": ["-y", "wickedapi-mcp"],
60
- "env": {
61
- "WICKEDAPI_PAYER_PRIVATE_KEY": "0xyour-base-wallet-private-key"
62
- }
63
- }
64
- }
65
- }
66
- ```
67
-
68
- Nothing configured? The Token Risk Oracle tool and the 5 free Trading Data API endpoints (`sentiment`, `macro_calendar`, `market_overview`, `gas`, `kalshi_probability`) still work with zero setup.
69
-
70
- ## Resources
71
-
72
- Read without calling a tool — useful for a client that surfaces resources in its UI:
73
-
74
- - `wickedapi://platform/services` — the full service directory (JSON)
75
- - `wickedapi://platform/llms` — the platform's `llms.txt`
76
- - `wickedapi://trading/status`, `wickedapi://protocol_health/status`, `wickedapi://token_risk/status`, `wickedapi://broker_sync/status` — each service's live endpoint catalog
77
-
78
- ## Quick start
79
-
80
- ```bash
81
- claude mcp add --transport http wicked https://mcp.wickedapi.com/mcp # Claude Code, no install
82
- npx -y wickedapi-mcp # local stdio
83
- ```
84
-
85
- Claude Desktop / Cursor / VS Code config and per-framework starters: see the [cookbooks](https://github.com/choaticpixels/api_services/tree/main/cookbooks). The remote also serves a landing page at `/`, `/llms.txt`, an MCP server card at `/.well-known/mcp/server-card.json`, and aggregate per-tool call counts at `/stats` (counts only; no arguments or IPs).
86
-
87
- ## Prompts
88
-
89
- One-click workflows that chain real tool calls (Claude Desktop and other prompt-aware clients surface these directly):
90
-
91
- - **`rug_check`** (`address`, `chain`, optional `symbol`) — token risk check + market sentiment + optional momentum read, before buying.
92
- - **`vet_dependency`** (`slug`, optional `token_address`, `chain`) — protocol health + optional contract-level risk check, before building on a DeFi protocol.
93
- - **`morning_briefing`** (optional `symbol`) — macro calendar + earnings calendar + sentiment + momentum verdict, as one digest.
94
- - **`fact_check`** (`output`, optional `source`) — split an answer into claims and verify each with Wicked Sanity.
95
- - **`verify_agent`** (`wallet`) — Identity assertion + Reputation stake/tier before you transact with an agent.
96
- - **`find_reliable_tool`** (`need`, optional `category`, `min_score`) — Registry search by real uptime/latency/schema scores.
97
- - **`agent_memory_guide`** (`wallet`, `task`) — the two-step signed Memory flow, explained to the model.
98
-
99
- ## Environment variables
100
-
101
- | Var | Required | Notes |
102
- | --- | --- | --- |
103
- | `WICKEDAPI_API_KEY` | no | Free, rate-limited access across all four services (same key works everywhere). |
104
- | `WICKEDAPI_PAYER_PRIVATE_KEY` | no | Base-mainnet wallet private key. If set, every call auto-pays the x402 challenge in USDC — no key needed. |
105
- | `WICKEDAPI_BASE_URL` | no | Override the Trading Data API base (default `https://api.wickedapi.com`). |
106
- | `WICKEDAPI_PROTOCOL_HEALTH_URL` | no | Override the Protocol Health Oracle base (default `https://protocol-health-oracle.wickedapi.com`). |
107
- | `WICKEDAPI_TOKEN_RISK_URL` | no | Override the Token Risk Oracle base (default `https://token-risk-oracle.wickedapi.com`). |
108
- | `WICKEDAPI_BROKER_SYNC_URL` | no | Override the Broker Sync API base (default `https://broker-sync-api.wickedapi.com`). |
109
- | `REGISTRY_API_KEY` / `IDENTITY_API_KEY` / `SANITY_API_KEY` / `MEMORY_API_KEY` | no | Free-tier keys for the paid calls of Registry, Identity, Sanity and Memory search. Omit to get the x402 challenge instead. |
110
- | `PAYWALL_API_KEY` | for `paywall_*` | Tenant Bearer key returned once by `paywall_signup`. |
111
- | `REPUTATION_BASE_URL` / `REGISTRY_BASE_URL` / `IDENTITY_BASE_URL` / `SANITY_BASE_URL` / `MEMORY_BASE_URL` / `PAYWALL_BASE_URL` | no | Override the matching service base (defaults are the `*.wickedapi.com` hosts). |
112
- | `WICKEDAPI_SHOWCASE_URL` | no | Override the platform directory base used by resources (default `https://wickedapi.com`). |
113
-
114
- If neither `WICKEDAPI_API_KEY` nor `WICKEDAPI_PAYER_PRIVATE_KEY` is set, paid calls still succeed at the protocol level — you'll get the real `402` challenge back as the tool result instead of data. If one service's spec fails to load (network hiccup, that service is down), its tools are simply skipped for the session — the rest still register normally.
115
-
116
- ## Local development
117
-
118
- ```bash
119
- npm install
120
- npm test # builds, then unit + end-to-end tests (e2e needs network)
121
- node dist/index.js # stdio
122
- node dist/http.js # streamable HTTP on $PORT (default 8080)
123
- ```
124
-
125
- ## What this is not
126
-
127
- This server doesn't reimplement any data logic — it's a thin bridge from MCP tool calls to the live Wicked HTTP endpoints across all ten services. All the actual market data, indicators, scoring, and risk signals live in the APIs themselves.
1
+ # wickedapi-mcp (moved)
2
+
3
+ This package is now **[@wickedlabs/wicked-mcp](https://www.npmjs.com/package/@wickedlabs/wicked-mcp)**.
4
+
5
+ This release only forwards to it, so existing setups keep working. Please update your MCP client config:
6
+
7
+ ```json
8
+ { "command": "npx", "args": ["-y", "@wickedlabs/wicked-mcp"] }
9
+ ```
10
+
11
+ Hosted (no install): `https://mcp.wickedapi.com/mcp` · Source: https://github.com/choaticpixels/wicked-mcp
package/bin.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ // `wickedapi-mcp` moved to `@wickedlabs/wicked-mcp`. This forwards to it so
3
+ // existing `npx -y wickedapi-mcp` configs keep working. stderr only: stdout is
4
+ // the MCP protocol stream.
5
+ console.error("[wickedapi-mcp] This package has moved to @wickedlabs/wicked-mcp. Update your config to `npx -y @wickedlabs/wicked-mcp`.");
6
+ await import("@wickedlabs/wicked-mcp/dist/index.js");
package/package.json CHANGED
@@ -1,62 +1,29 @@
1
- {
2
- "name": "wickedapi-mcp",
3
- "version": "0.4.0",
4
- "description": "MCP server for the whole Wicked suite — trading data, DeFi protocol health, token safety, brokerage sync, agent identity, reputation, tool registry, hallucination checks, persistent memory, and x402 paywalls. 70 tools, 6 resources, 3 prompts. No signup required: pay per call in USDC via x402, or use a partner API key.",
5
- "type": "module",
6
- "bin": {
7
- "wickedapi-mcp": "dist/index.js"
8
- },
9
- "main": "dist/index.js",
10
- "files": [
11
- "dist"
12
- ],
13
- "engines": {
14
- "node": ">=20"
15
- },
16
- "license": "MIT",
17
- "homepage": "https://mcp.wickedapi.com",
18
- "bugs": {
19
- "url": "https://api.wickedapi.com"
20
- },
21
- "author": "WickedAPI",
22
- "scripts": {
23
- "build": "tsc -p tsconfig.json",
24
- "start": "node dist/index.js",
25
- "prepublishOnly": "npm run build",
26
- "start:http": "node dist/http.js",
27
- "test": "npm run build && node --test \"test/*.test.mjs\""
28
- },
29
- "keywords": [
30
- "mcp",
31
- "model-context-protocol",
32
- "trading",
33
- "crypto",
34
- "stocks",
35
- "market-data",
36
- "defi",
37
- "brokerage",
38
- "x402",
39
- "agent",
40
- "identity",
41
- "reputation",
42
- "registry",
43
- "memory",
44
- "sanity",
45
- "paywall"
46
- ],
47
- "dependencies": {
48
- "@modelcontextprotocol/sdk": "^1.29.0",
49
- "viem": "^2.55.2",
50
- "x402-fetch": "^1.2.0",
51
- "zod": "^4.4.3"
52
- },
53
- "devDependencies": {
54
- "@types/node": "^22.20.1",
55
- "typescript": "^5.9.3"
56
- },
57
- "repository": {
58
- "type": "git",
59
- "url": "git+https://github.com/choaticpixels/wicked-mcp.git"
60
- },
61
- "mcpName": "io.github.choaticpixels/wicked-mcp"
62
- }
1
+ {
2
+ "name": "wickedapi-mcp",
3
+ "version": "0.6.0",
4
+ "description": "MOVED: this package is now @wickedlabs/wicked-mcp. This release forwards to it, so existing `npx wickedapi-mcp` setups keep working.",
5
+ "type": "module",
6
+ "bin": {
7
+ "wickedapi-mcp": "bin.js"
8
+ },
9
+ "files": [
10
+ "bin.js",
11
+ "README.md"
12
+ ],
13
+ "dependencies": {
14
+ "@wickedlabs/wicked-mcp": "^0.6.0"
15
+ },
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "license": "MIT",
20
+ "author": "WickedLabs",
21
+ "homepage": "https://mcp.wickedapi.com",
22
+ "mcpName": "io.github.choaticpixels/wicked-mcp",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/choaticpixels/wicked-mcp.git",
26
+ "directory": "shim"
27
+ },
28
+ "keywords": ["mcp", "model-context-protocol", "wicked", "x402"]
29
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 choaticpixels
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/dist/clientIp.js DELETED
@@ -1,67 +0,0 @@
1
- // Who is calling, for rate limiting. Ported from the Python http_app.py so
2
- // behaviour is unchanged after the cutover.
3
- //
4
- // Behind Railway's edge proxy the TCP peer is always an internal address, so
5
- // the limiter keys on the proxy-set X-Real-IP header instead. That is only
6
- // safe because the proxy sets the header itself; set TRUSTED_CLIENT_IP_HEADER
7
- // to empty to fall back to the TCP peer when running without a proxy, or to
8
- // cf-connecting-ip if the domain is ever proxied through Cloudflare.
9
- import { isIP } from "node:net";
10
- const TRUSTED_HEADER = (process.env.TRUSTED_CLIENT_IP_HEADER ?? "x-real-ip").trim().toLowerCase();
11
- function expandIPv6(ip) {
12
- let s = ip.split("%")[0];
13
- let tail = [];
14
- const v4 = s.match(/(\d+\.\d+\.\d+\.\d+)$/);
15
- if (v4) {
16
- const o = v4[1].split(".").map(Number);
17
- tail = [(o[0] << 8) | o[1], (o[2] << 8) | o[3]];
18
- s = s.slice(0, -v4[1].length) + "0:0";
19
- }
20
- const halves = s.split("::");
21
- if (halves.length > 2)
22
- return null;
23
- const head = halves[0] ? halves[0].split(":") : [];
24
- const rest = halves.length === 2 && halves[1] ? halves[1].split(":") : [];
25
- const fill = 8 - head.length - rest.length;
26
- if ((halves.length === 1 && fill !== 0) || fill < 0)
27
- return null;
28
- const groups = [...head, ...Array(halves.length === 2 ? fill : 0).fill("0"), ...rest].map((g) => parseInt(g, 16));
29
- if (groups.length !== 8 || groups.some((g) => Number.isNaN(g)))
30
- return null;
31
- if (tail.length) {
32
- groups[6] = tail[0];
33
- groups[7] = tail[1];
34
- }
35
- return groups;
36
- }
37
- /** Canonical rate-limit key, or null if `raw` isn't an IP. IPv4-mapped IPv6
38
- * collapses to the IPv4 address; IPv6 is grouped by /64 so rotating addresses
39
- * inside one prefix can't dodge the limit. */
40
- export function normalizeIp(raw) {
41
- const s = raw.trim();
42
- const kind = isIP(s);
43
- if (kind === 4)
44
- return s;
45
- if (kind !== 6)
46
- return null;
47
- const g = expandIPv6(s);
48
- if (!g)
49
- return null;
50
- if (g.slice(0, 5).every((x) => x === 0) && g[5] === 0xffff) {
51
- return `${g[6] >> 8}.${g[6] & 255}.${g[7] >> 8}.${g[7] & 255}`;
52
- }
53
- return `${g.slice(0, 4).map((x) => x.toString(16)).join(":")}::/64`;
54
- }
55
- export function clientKey(req) {
56
- if (TRUSTED_HEADER) {
57
- const raw = req.headers[TRUSTED_HEADER];
58
- const value = Array.isArray(raw) ? raw[0] : raw;
59
- if (value) {
60
- const key = normalizeIp(value);
61
- if (key)
62
- return key;
63
- }
64
- }
65
- const peer = req.socket.remoteAddress ?? "unknown";
66
- return normalizeIp(peer) ?? peer;
67
- }
package/dist/http.js DELETED
@@ -1,100 +0,0 @@
1
- // Streamable-HTTP entry point for the public remote at https://mcp.wickedapi.com/mcp.
2
- // Stateless: every request gets its own McpServer + transport (specs are
3
- // loaded once at boot), so it scales and restarts without session loss.
4
- // Public-endpoint additions over the stdio build: a per-IP rate limit and a
5
- // Host allowlist (DNS-rebinding protection). Tools and upstream calls are
6
- // identical.
7
- import { createServer } from "node:http";
8
- import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
9
- import { clientKey } from "./clientIp.js";
10
- import { rateLimited } from "./rateLimit.js";
11
- import { landingHtml, llmsTxt, serverCard } from "./landing.js";
12
- import { knownTools, usageHooks, usageSnapshot } from "./usage.js";
13
- import { buildServer, loadWorld, SERVER_VERSION } from "./server.js";
14
- const PORT = Number(process.env.PORT || 8080);
15
- const RATE_LIMIT_PER_MINUTE = Number(process.env.RATE_LIMIT_PER_MINUTE || 30);
16
- const MAX_BODY_BYTES = 1_000_000;
17
- const ALLOWED_HOSTS = (process.env.ALLOWED_HOSTS || "mcp.wickedapi.com,wicked-mcp-production.up.railway.app,localhost:8080,127.0.0.1:8080")
18
- .split(",")
19
- .map((h) => h.trim().toLowerCase())
20
- .filter(Boolean);
21
- function send(res, status, body, headers = {}) {
22
- res.writeHead(status, { "content-type": "application/json", ...headers });
23
- res.end(JSON.stringify(body));
24
- }
25
- function sendText(res, contentType, body) {
26
- res.writeHead(200, { "content-type": `${contentType}; charset=utf-8`, "cache-control": "public, max-age=300" });
27
- res.end(body);
28
- }
29
- async function readJson(req) {
30
- const chunks = [];
31
- let size = 0;
32
- for await (const chunk of req) {
33
- size += chunk.length;
34
- if (size > MAX_BODY_BYTES)
35
- throw Object.assign(new Error("payload too large"), { status: 413 });
36
- chunks.push(chunk);
37
- }
38
- if (!chunks.length)
39
- return undefined;
40
- try {
41
- return JSON.parse(Buffer.concat(chunks).toString("utf8"));
42
- }
43
- catch {
44
- throw Object.assign(new Error("invalid JSON"), { status: 400 });
45
- }
46
- }
47
- async function main() {
48
- const world = await loadWorld();
49
- const { summary } = buildServer(world, { onRegister: usageHooks.onRegister });
50
- const tools = [...knownTools];
51
- const http = createServer(async (req, res) => {
52
- const url = new URL(req.url || "/", "http://x");
53
- if (url.pathname === "/health")
54
- return send(res, 200, { status: "ok", version: SERVER_VERSION });
55
- const host = (req.headers.host || "").toLowerCase();
56
- if (!ALLOWED_HOSTS.includes(host))
57
- return send(res, 421, { error: "Invalid Host header" });
58
- if (req.method === "GET" || req.method === "HEAD") {
59
- if (url.pathname === "/")
60
- return sendText(res, "text/html", landingHtml(tools, SERVER_VERSION));
61
- if (url.pathname === "/llms.txt")
62
- return sendText(res, "text/plain", llmsTxt(tools, SERVER_VERSION));
63
- if (url.pathname === "/.well-known/mcp/server-card.json" || url.pathname === "/.well-known/mcp.json") {
64
- return send(res, 200, serverCard(tools, SERVER_VERSION), { "cache-control": "public, max-age=300" });
65
- }
66
- if (url.pathname === "/stats")
67
- return send(res, 200, usageSnapshot());
68
- }
69
- if (url.pathname !== "/mcp")
70
- return send(res, 404, { error: "Not found. The MCP endpoint is /mcp." });
71
- if (req.method !== "POST") {
72
- return send(res, 405, { jsonrpc: "2.0", error: { code: -32000, message: "Method not allowed (stateless server: POST only)." }, id: null }, { allow: "POST" });
73
- }
74
- if (rateLimited(clientKey(req), RATE_LIMIT_PER_MINUTE)) {
75
- return send(res, 429, { error: `Rate limit exceeded: ${RATE_LIMIT_PER_MINUTE} requests/minute per IP. Run this server locally (npx wickedapi-mcp) for unlimited use.` }, { "retry-after": "60" });
76
- }
77
- try {
78
- const body = await readJson(req);
79
- const { server } = buildServer(world, usageHooks);
80
- const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
81
- res.on("close", () => {
82
- void transport.close();
83
- void server.close();
84
- });
85
- await server.connect(transport);
86
- await transport.handleRequest(req, res, body);
87
- }
88
- catch (err) {
89
- const status = err.status ?? 500;
90
- if (!res.headersSent) {
91
- send(res, status, { jsonrpc: "2.0", error: { code: -32603, message: err.message }, id: null });
92
- }
93
- }
94
- });
95
- http.listen(PORT, "0.0.0.0", () => console.error(`[wickedapi-mcp] http on :${PORT}/mcp - ${summary}.`));
96
- }
97
- main().catch((err) => {
98
- console.error("[wickedapi-mcp] fatal:", err);
99
- process.exit(1);
100
- });
package/dist/index.js DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- // stdio entry point: `npx wickedapi-mcp` for Claude Desktop, Cursor, .mcpb, etc.
3
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
- import { buildServer, loadWorld } from "./server.js";
5
- async function main() {
6
- const { server, summary } = buildServer(await loadWorld());
7
- await server.connect(new StdioServerTransport());
8
- console.error(`[wickedapi-mcp] ready - ${summary}.`);
9
- }
10
- main().catch((err) => {
11
- console.error("[wickedapi-mcp] fatal:", err);
12
- process.exit(1);
13
- });
package/dist/landing.js DELETED
@@ -1,96 +0,0 @@
1
- // Discovery surfaces served by the HTTP deployment: a human landing page,
2
- // /llms.txt for crawlers and agents, and an MCP server card. All three are
3
- // generated from the tools actually registered, so they cannot drift from
4
- // what the server exposes.
5
- const SITE = "https://mcp.wickedapi.com";
6
- const GROUPS = [
7
- { id: "protocol_health", label: "Protocol Health Oracle", prefix: "protocol_health_", blurb: "Score any DeFi protocol before you integrate it." },
8
- { id: "token_risk", label: "Token Risk Oracle", prefix: "token_risk", blurb: "Free rug / honeypot check for EVM and Solana tokens." },
9
- { id: "broker_sync", label: "Broker Sync", prefix: "broker_sync_", blurb: "Positions and balances across 30+ brokerages." },
10
- { id: "reputation", label: "Wicked Reputation", prefix: "reputation_", blurb: "On-chain agent stake, tiers and slashing history. Free." },
11
- { id: "registry", label: "Wicked Registry", prefix: "registry_", blurb: "Real uptime, latency and schema scores for x402/MCP tools." },
12
- { id: "identity", label: "Wicked Identity", prefix: "identity_", blurb: "Know-Your-Agent verification with signed assertions." },
13
- { id: "sanity", label: "Wicked Sanity", prefix: "sanity_", blurb: "Hallucination check against your source or live web evidence." },
14
- { id: "memory", label: "Wicked Memory", prefix: "memory_", blurb: "Persistent, wallet-scoped agent memory with semantic search." },
15
- { id: "paywall", label: "x402 Paywall", prefix: "paywall_", blurb: "Put any endpoint behind pay-per-call USDC." },
16
- ];
17
- export const PROMPT_NAMES = ["rug_check", "vet_dependency", "morning_briefing", "fact_check", "verify_agent", "find_reliable_tool", "agent_memory_guide"];
18
- function grouped(tools) {
19
- const claimed = new Set();
20
- const out = GROUPS.map((g) => {
21
- const names = tools.filter((t) => t.startsWith(g.prefix));
22
- names.forEach((n) => claimed.add(n));
23
- return { ...g, tools: names };
24
- });
25
- const trading = tools.filter((t) => !claimed.has(t));
26
- return [{ id: "trading", label: "Trading Data API", blurb: "Prices, OHLCV, indicators, funding/OI, macro, prediction markets, momentum score.", tools: trading }, ...out];
27
- }
28
- export function llmsTxt(tools, version) {
29
- const g = grouped(tools);
30
- return [
31
- "# Wicked MCP",
32
- "",
33
- `> One MCP server for the whole Wicked suite: ${tools.length} tools across ${g.length} services - market data, DeFi and token risk, brokerage sync, agent identity, reputation, tool registry, hallucination checks, persistent memory and x402 paywalls. Version ${version}.`,
34
- "",
35
- "## Connect",
36
- `- Remote (streamable HTTP, no install): ${SITE}/mcp`,
37
- "- Local (stdio): `npx -y wickedapi-mcp`",
38
- "- Claude Code: `claude mcp add --transport http wicked " + SITE + "/mcp`",
39
- "- No signup needed. Priced calls return a real x402 payment challenge (USDC on Base); set WICKEDAPI_API_KEY or a payer wallet locally for free-tier / auto-pay.",
40
- "- The public remote is rate limited per IP; run it locally with `npx` for unlimited use.",
41
- "",
42
- "## Services and tools",
43
- ...g.map((s) => `- ${s.label} (${s.tools.length}): ${s.blurb} Tools: ${s.tools.join(", ")}`),
44
- "",
45
- "## Workflow prompts",
46
- ...PROMPT_NAMES.map((p) => `- ${p}`),
47
- "",
48
- "## Links",
49
- "- Platform: https://wickedapi.com (service directory at https://wickedapi.com/services.json)",
50
- "- Source: https://github.com/choaticpixels/wicked-mcp",
51
- "- npm: https://www.npmjs.com/package/wickedapi-mcp",
52
- "- Registry: io.github.choaticpixels/wicked-mcp on https://registry.modelcontextprotocol.io",
53
- "- Server card: " + SITE + "/.well-known/mcp/server-card.json",
54
- "",
55
- "Wallet-signed tools (identity, memory, registry registration) never sign for you: you supply the signature from your own wallet.",
56
- "",
57
- ].join("\n");
58
- }
59
- export function serverCard(tools, version) {
60
- return {
61
- $schema: "https://static.modelcontextprotocol.io/schemas/mcp-server-card/v1.json",
62
- version: "1.0",
63
- protocolVersion: "2025-06-18",
64
- serverInfo: { name: "io.github.choaticpixels/wicked-mcp", title: "Wicked MCP", version },
65
- description: `The whole Wicked suite for agents: ${tools.length} tools across market data, DeFi/token risk, identity, reputation, registry, sanity checks, memory and paywalls. x402-native.`,
66
- documentationUrl: "https://github.com/choaticpixels/wicked-mcp",
67
- transport: { type: "streamable-http", endpoint: "/mcp" },
68
- capabilities: { tools: { listChanged: false }, resources: {}, prompts: {} },
69
- authentication: { required: false, note: "Optional keys unlock free tiers; otherwise paid calls return an x402 challenge." },
70
- packages: [{ registry: "npm", name: "wickedapi-mcp", transport: "stdio" }],
71
- tools: tools.map((name) => ({ name })),
72
- };
73
- }
74
- const esc = (s) => s.replace(/[&<>]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[c]);
75
- export function landingHtml(tools, version) {
76
- const g = grouped(tools);
77
- const rows = g
78
- .map((s) => `<details><summary><b>${esc(s.label)}</b> <span>${s.tools.length} tools</span><em>${esc(s.blurb)}</em></summary><code>${s.tools.map(esc).join(" &middot; ")}</code></details>`)
79
- .join("\n");
80
- return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
81
- <title>Wicked MCP</title><meta name="description" content="One MCP server for the whole Wicked suite: ${tools.length} tools for agents.">
82
- <style>:root{color-scheme:light dark;--bg:#fff;--fg:#14171f;--mut:#5b6472;--card:#f4f6fa;--acc:#6d28d9}@media(prefers-color-scheme:dark){:root{--bg:#0e1117;--fg:#e8ebf2;--mut:#98a2b3;--card:#181d27;--acc:#a78bfa}}
83
- body{margin:0;background:var(--bg);color:var(--fg);font:16px/1.55 system-ui,sans-serif}main{max-width:760px;margin:0 auto;padding:32px 16px}h1{margin:0 0 4px}p.l{color:var(--mut);margin-top:0}
84
- pre{background:var(--card);padding:12px 14px;border-radius:8px;overflow:auto;font-size:14px}details{background:var(--card);border-radius:8px;padding:10px 14px;margin:8px 0}summary{cursor:pointer}summary span{color:var(--acc);margin:0 8px;font-size:14px}summary em{display:block;color:var(--mut);font-style:normal;font-size:14px}
85
- code{display:block;margin-top:8px;font-size:13px;color:var(--mut);word-break:break-word}a{color:var(--acc)}footer{color:var(--mut);font-size:14px;margin-top:24px}</style></head><body><main>
86
- <h1>Wicked MCP</h1><p class="l">${tools.length} tools. ${g.length} services. One server for agents. v${esc(version)}</p>
87
- <h3>Connect in one line</h3>
88
- <pre>claude mcp add --transport http wicked ${SITE}/mcp</pre>
89
- <pre>{ "mcpServers": { "wicked": { "url": "${SITE}/mcp" } } }</pre>
90
- <pre>npx -y wickedapi-mcp # local, stdio - unlimited, supports your API key or payer wallet</pre>
91
- <p>No signup. Priced calls return a real x402 payment challenge (USDC on Base). The public endpoint is rate limited per IP.</p>
92
- <h3>What's inside</h3>
93
- ${rows}
94
- <footer><a href="https://wickedapi.com">wickedapi.com</a> &middot; <a href="https://github.com/choaticpixels/wicked-mcp">GitHub</a> &middot; <a href="https://www.npmjs.com/package/wickedapi-mcp">npm</a> &middot; <a href="/llms.txt">llms.txt</a> &middot; <a href="/.well-known/mcp/server-card.json">server card</a> &middot; <a href="/stats">usage</a></footer>
95
- </main></body></html>`;
96
- }
package/dist/prompts.js DELETED
@@ -1,85 +0,0 @@
1
- import { z } from "zod";
2
- const text = (t) => ({ role: "user", content: { type: "text", text: t } });
3
- export function registerSuitePrompts(server) {
4
- server.registerPrompt("fact_check", {
5
- title: "Fact-check before acting",
6
- description: "Split an answer into claims and verify each against your source text (or live web evidence) with Wicked Sanity before you rely on it.",
7
- argsSchema: {
8
- output: z.string().describe("The text to check - an AI answer, summary or report."),
9
- source: z.string().optional().describe("The source text the output must be faithful to. Omit to check against live web evidence instead."),
10
- },
11
- }, ({ output, source }) => ({
12
- description: "Fact-check workflow",
13
- messages: [
14
- text(`Verify the following output before I act on it. Don't judge it yourself - use the tools.\n\n` +
15
- `1. Split it into individual factual claims (one sentence each).\n` +
16
- `2. Call \`sanity_check_batch\` once with all claims, ` +
17
- (source
18
- ? `mode="grounded" and context set to the source text below.\n`
19
- : `mode="open" (no source supplied, so check against live web evidence).\n`) +
20
- `3. Report every claim with its exact verdict (supported / contradicted / unsupported / insufficient_evidence) ` +
21
- `and the evidence returned. Treat unsupported and insufficient_evidence as UNVERIFIED, and contradicted as wrong.\n` +
22
- `4. If the response has http_status 402, 429 or another error, say so plainly - do not guess verdicts.\n\n` +
23
- `OUTPUT TO CHECK:\n${output}\n` +
24
- (source ? `\nSOURCE:\n${source}\n` : "")),
25
- ],
26
- }));
27
- server.registerPrompt("verify_agent", {
28
- title: "Check an agent's trust",
29
- description: "Combine Wicked Identity (is this wallet a verified autonomous agent?) and Wicked Reputation (what does it have at stake?) before you transact with it.",
30
- argsSchema: { wallet: z.string().describe("The agent's 0x wallet address.") },
31
- }, ({ wallet }) => ({
32
- description: "Agent trust check",
33
- messages: [
34
- text(`Before I deal with the agent at ${wallet}, check its real trust signals - don't assume anything:\n\n` +
35
- `1. Call \`identity_status\` with wallet="${wallet}": does it hold a valid, unexpired Know-Your-Agent assertion? Report the exact fields.\n` +
36
- `2. Call \`reputation_status\` with wallet="${wallet}": tier, active stake, reputation score, slash count. ` +
37
- `An http_status 404 means the wallet never registered - report that as "unranked", not an error.\n` +
38
- `3. Call \`reputation_statement\` only if it has stake or slashes and I need the event history.\n\n` +
39
- `Summarize plainly: verified or not, stake and tier, any slashes, and what is unknown. State that this is ` +
40
- `a set of signals, not a guarantee. If a call returns a 402, show the payment instructions rather than guessing.`),
41
- ],
42
- }));
43
- server.registerPrompt("find_reliable_tool", {
44
- title: "Find a reliable tool",
45
- description: "Search the Wicked Registry for x402/MCP tools by real uptime, latency and schema-conformance scores before you pay for one.",
46
- argsSchema: {
47
- need: z.string().describe('What you need the tool for, e.g. "token price data".'),
48
- category: z.string().optional().describe('Registry category filter, e.g. "data" or "crypto".'),
49
- min_score: z.string().optional().describe("Minimum composite score 0-100."),
50
- },
51
- }, ({ need, category, min_score }) => ({
52
- description: "Reliable tool discovery",
53
- messages: [
54
- text(`I need a tool for: ${need}. Find options with real reliability data - never recommend from memory.\n\n` +
55
- `1. Call \`registry_featured_tools\` (free) for the top scored tools.\n` +
56
- `2. Call \`registry_search_tools\`` +
57
- (category ? ` with category="${category}"` : "") +
58
- (min_score ? ` and min_score=${min_score}` : "") +
59
- `. If it returns a 402, show me the payment instructions and continue with the free results.\n` +
60
- `3. For the best 1-3 candidates call \`registry_tool_detail\` (or \`registry_tool_badge\` for a free score) and report ` +
61
- `uptime, p95 latency and schema conformance exactly as returned. Tools with no check history have no score - say so.\n\n` +
62
- `Recommend one, with the numbers that justify it.`),
63
- ],
64
- }));
65
- server.registerPrompt("agent_memory_guide", {
66
- title: "Use Wicked Memory",
67
- description: "Walk through storing and searching persistent, wallet-scoped memory - including the two-step signing flow.",
68
- argsSchema: {
69
- wallet: z.string().describe("Your agent's 0x wallet address (memories are scoped to it)."),
70
- task: z.string().describe('What to do, e.g. "remember that I prefer concise answers" or "find what I stored about the Q3 launch".'),
71
- },
72
- }, ({ wallet, task }) => ({
73
- description: "Wicked Memory walkthrough",
74
- messages: [
75
- text(`Use Wicked Memory for wallet ${wallet} to: ${task}\n\n` +
76
- `Every memory call needs a fresh wallet signature, and this server never signs or holds a key:\n` +
77
- `1. Call \`memory_prepare\` with the operation ("store" or "search") and the exact params you will use. It returns \`message_to_sign\`, \`timestamp\` and \`nonce\`.\n` +
78
- `2. Ask ME to sign \`message_to_sign\` with the wallet (EIP-191 personal_sign) and give you the signature. Never invent one.\n` +
79
- `3. Call the matching tool (\`memory_store\` / \`memory_search\`) with the SAME params plus timestamp, nonce and signature.\n` +
80
- `4. A nonce is single-use and the timestamp must be within 5 minutes - prepare again for every call. ` +
81
- `\`memory_search\` is metered: if it returns http_status 402, show me the payment instructions; the same signed request can be retried with a payment_signature.\n\n` +
82
- `Report exactly what the tools returned.`),
83
- ],
84
- }));
85
- }