@pmaxis/mcp-server 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.
- package/dist/client.js +29 -0
- package/dist/index.js +21530 -0
- package/dist/tools/market.js +74 -0
- package/dist/tools/markets.js +54 -0
- package/dist/tools/platform.js +23 -0
- package/dist/tools/taxonomy.js +40 -0
- package/dist/tools/wallets.js +37 -0
- package/package.json +33 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerMarketDetailTools = registerMarketDetailTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_js_1 = require("../client.js");
|
|
6
|
+
const marketId = zod_1.z.string().describe("Market ID, e.g. '558937'");
|
|
7
|
+
function registerMarketDetailTools(server) {
|
|
8
|
+
server.tool("get_market", "Get full details for a single prediction market including title, description, current price, volume, and resolution date.", { id: marketId }, async ({ id }) => {
|
|
9
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}`);
|
|
10
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
11
|
+
});
|
|
12
|
+
server.tool("get_market_summary", "Get a comprehensive summary of a prediction market — price, volume, sentiment, and key stats in one call.", { id: marketId }, async ({ id }) => {
|
|
13
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/summary`);
|
|
14
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
15
|
+
});
|
|
16
|
+
server.tool("get_market_stats", "Get detailed statistics for a prediction market — trade count, unique traders, volume breakdown.", { id: marketId }, async ({ id }) => {
|
|
17
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/stats`);
|
|
18
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
19
|
+
});
|
|
20
|
+
server.tool("get_market_liquidity", "Get the current order book liquidity for a market — best bid/ask, spread, and order depth from ClickHouse.", { id: marketId }, async ({ id }) => {
|
|
21
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/liquidity`);
|
|
22
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
23
|
+
});
|
|
24
|
+
server.tool("get_market_sentiment", "Get crowd sentiment for a market — bullish/bearish/neutral breakdown and volume trend direction.", { id: marketId }, async ({ id }) => {
|
|
25
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/sentiment`);
|
|
26
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
27
|
+
});
|
|
28
|
+
server.tool("get_market_signals", "Get trading signals and indicators for a market — momentum, volume signals, price alerts.", { id: marketId }, async ({ id }) => {
|
|
29
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/signals`);
|
|
30
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
31
|
+
});
|
|
32
|
+
server.tool("get_market_orderbook", "Get the full order book for a market — all bids and asks with quantities.", { id: marketId }, async ({ id }) => {
|
|
33
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/orderbook`);
|
|
34
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
35
|
+
});
|
|
36
|
+
server.tool("get_market_price", "Get the current price for a market token.", { id: marketId }, async ({ id }) => {
|
|
37
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/price`);
|
|
38
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
39
|
+
});
|
|
40
|
+
server.tool("get_market_price_history", "Get historical price data for a market. Useful for trend analysis.", {
|
|
41
|
+
id: marketId,
|
|
42
|
+
interval: zod_1.z.string().optional().describe("Time interval: '1h', '6h', '1d', '7d' (default '1d')"),
|
|
43
|
+
limit: zod_1.z.number().optional().describe("Number of data points to return"),
|
|
44
|
+
}, async ({ id, interval, limit }) => {
|
|
45
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/price-history`, { interval, limit });
|
|
46
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
47
|
+
});
|
|
48
|
+
server.tool("get_market_trades", "Get recent trades for a prediction market.", {
|
|
49
|
+
id: marketId,
|
|
50
|
+
limit: zod_1.z.number().optional().describe("Max trades to return (default 20)"),
|
|
51
|
+
}, async ({ id, limit }) => {
|
|
52
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/trades`, { limit });
|
|
53
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
54
|
+
});
|
|
55
|
+
server.tool("get_market_candles", "Get OHLCV candlestick data for a market. Useful for charting and technical analysis.", {
|
|
56
|
+
id: marketId,
|
|
57
|
+
resolution: zod_1.z.string().optional().describe("Candle resolution: '1m', '5m', '1h', '1d' (default '1h')"),
|
|
58
|
+
limit: zod_1.z.number().optional().describe("Number of candles to return"),
|
|
59
|
+
}, async ({ id, resolution, limit }) => {
|
|
60
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/candles`, { resolution, limit });
|
|
61
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
62
|
+
});
|
|
63
|
+
server.tool("get_market_positions", "Get current open positions held in a prediction market — who owns what and how much.", {
|
|
64
|
+
id: marketId,
|
|
65
|
+
limit: zod_1.z.number().optional().describe("Max positions to return (default 20)"),
|
|
66
|
+
}, async ({ id, limit }) => {
|
|
67
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/positions`, { limit });
|
|
68
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
69
|
+
});
|
|
70
|
+
server.tool("get_related_markets", "Get markets related to a given market — similar topics, same event, or correlated outcomes.", { id: marketId }, async ({ id }) => {
|
|
71
|
+
const data = await (0, client_js_1.pmaxisGet)(`/markets/${id}/related`);
|
|
72
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerMarketListTools = registerMarketListTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_js_1 = require("../client.js");
|
|
6
|
+
function registerMarketListTools(server) {
|
|
7
|
+
server.tool("search_markets", "Search prediction markets by keyword or topic. Use this to find markets about a specific subject.", {
|
|
8
|
+
q: zod_1.z.string().describe("Search query, e.g. 'election', 'bitcoin', 'world cup'"),
|
|
9
|
+
limit: zod_1.z.number().optional().describe("Max results to return (default 20)"),
|
|
10
|
+
offset: zod_1.z.number().optional().describe("Pagination offset"),
|
|
11
|
+
}, async ({ q, limit, offset }) => {
|
|
12
|
+
const data = await (0, client_js_1.pmaxisGet)("/markets/search", { q, limit, offset });
|
|
13
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
14
|
+
});
|
|
15
|
+
server.tool("get_top_markets", "Get the top prediction markets by trading volume.", {
|
|
16
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
17
|
+
}, async ({ limit }) => {
|
|
18
|
+
const data = await (0, client_js_1.pmaxisGet)("/markets/top", { limit });
|
|
19
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
20
|
+
});
|
|
21
|
+
server.tool("get_trending_markets", "Get currently trending prediction markets — markets with recent price movement and high activity.", {
|
|
22
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
23
|
+
}, async ({ limit }) => {
|
|
24
|
+
const data = await (0, client_js_1.pmaxisGet)("/markets/trending", { limit });
|
|
25
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
26
|
+
});
|
|
27
|
+
server.tool("get_new_markets", "Get recently created prediction markets.", {
|
|
28
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
29
|
+
}, async ({ limit }) => {
|
|
30
|
+
const data = await (0, client_js_1.pmaxisGet)("/markets/new", { limit });
|
|
31
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
32
|
+
});
|
|
33
|
+
server.tool("get_resolving_markets", "Get prediction markets that are close to their resolution date.", {
|
|
34
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
35
|
+
}, async ({ limit }) => {
|
|
36
|
+
const data = await (0, client_js_1.pmaxisGet)("/markets/resolving", { limit });
|
|
37
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
38
|
+
});
|
|
39
|
+
server.tool("compare_markets", "Compare multiple prediction markets side by side. Pass comma-separated market IDs.", {
|
|
40
|
+
ids: zod_1.z.string().describe("Comma-separated market IDs, e.g. '558937,682705,1654958'"),
|
|
41
|
+
}, async ({ ids }) => {
|
|
42
|
+
const data = await (0, client_js_1.pmaxisGet)("/markets/compare", { ids });
|
|
43
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
44
|
+
});
|
|
45
|
+
server.tool("list_markets", "List all prediction markets with optional filters.", {
|
|
46
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
47
|
+
offset: zod_1.z.number().optional().describe("Pagination offset"),
|
|
48
|
+
category: zod_1.z.string().optional().describe("Filter by category slug"),
|
|
49
|
+
active: zod_1.z.boolean().optional().describe("Filter by active status"),
|
|
50
|
+
}, async ({ limit, offset, category, active }) => {
|
|
51
|
+
const data = await (0, client_js_1.pmaxisGet)("/markets", { limit, offset, category, active });
|
|
52
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerPlatformTools = registerPlatformTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_js_1 = require("../client.js");
|
|
6
|
+
function registerPlatformTools(server) {
|
|
7
|
+
server.tool("get_platform_stats", "Get overall PMAxis platform statistics — total markets, total volume, active traders, and aggregate metrics.", {}, async () => {
|
|
8
|
+
const data = await (0, client_js_1.pmaxisGet)("/stats");
|
|
9
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
10
|
+
});
|
|
11
|
+
server.tool("get_recent_trades", "Get the most recent trades across all prediction markets on the platform.", {
|
|
12
|
+
limit: zod_1.z.number().optional().describe("Max trades to return (default 20)"),
|
|
13
|
+
}, async ({ limit }) => {
|
|
14
|
+
const data = await (0, client_js_1.pmaxisGet)("/trades/recent", { limit });
|
|
15
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
16
|
+
});
|
|
17
|
+
server.tool("get_batch_prices", "Get current prices for multiple market tokens in a single call. Pass comma-separated token IDs.", {
|
|
18
|
+
ids: zod_1.z.string().describe("Comma-separated token IDs"),
|
|
19
|
+
}, async ({ ids }) => {
|
|
20
|
+
const data = await (0, client_js_1.pmaxisGet)("/prices", { ids });
|
|
21
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerTaxonomyTools = registerTaxonomyTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_js_1 = require("../client.js");
|
|
6
|
+
function registerTaxonomyTools(server) {
|
|
7
|
+
server.tool("get_events", "List all prediction market events. Events group related markets together (e.g. '2026 World Cup' groups all team markets).", {
|
|
8
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
9
|
+
offset: zod_1.z.number().optional().describe("Pagination offset"),
|
|
10
|
+
}, async ({ limit, offset }) => {
|
|
11
|
+
const data = await (0, client_js_1.pmaxisGet)("/events", { limit, offset });
|
|
12
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
13
|
+
});
|
|
14
|
+
server.tool("get_event_markets", "Get all prediction markets belonging to a specific event.", {
|
|
15
|
+
id: zod_1.z.string().describe("Event ID"),
|
|
16
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
17
|
+
}, async ({ id, limit }) => {
|
|
18
|
+
const data = await (0, client_js_1.pmaxisGet)(`/events/${id}/markets`, { limit });
|
|
19
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
20
|
+
});
|
|
21
|
+
server.tool("get_categories", "List all market categories available on PMAxis (e.g. politics, sports, crypto, economics).", {}, async () => {
|
|
22
|
+
const data = await (0, client_js_1.pmaxisGet)("/categories");
|
|
23
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
24
|
+
});
|
|
25
|
+
server.tool("get_category_markets", "Get all prediction markets in a specific category.", {
|
|
26
|
+
slug: zod_1.z.string().describe("Category slug, e.g. 'politics', 'sports', 'crypto'"),
|
|
27
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
28
|
+
}, async ({ slug, limit }) => {
|
|
29
|
+
const data = await (0, client_js_1.pmaxisGet)(`/categories/${slug}/markets`, { limit });
|
|
30
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
31
|
+
});
|
|
32
|
+
server.tool("get_tags", "List all tags used to label prediction markets.", {}, async () => {
|
|
33
|
+
const data = await (0, client_js_1.pmaxisGet)("/tags");
|
|
34
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
35
|
+
});
|
|
36
|
+
server.tool("get_series", "List all recurring market series on PMAxis (e.g. monthly Fed rate decision markets).", {}, async () => {
|
|
37
|
+
const data = await (0, client_js_1.pmaxisGet)("/series");
|
|
38
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerWalletTools = registerWalletTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const client_js_1 = require("../client.js");
|
|
6
|
+
const address = zod_1.z.string().describe("Wallet address, e.g. '0xabc...def'");
|
|
7
|
+
function registerWalletTools(server) {
|
|
8
|
+
server.tool("get_wallet_summary", "Get a full summary of a wallet's prediction market activity — total volume, PnL, win rate, and active markets.", { address }, async ({ address }) => {
|
|
9
|
+
const data = await (0, client_js_1.pmaxisGet)(`/wallets/${address}/summary`);
|
|
10
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
11
|
+
});
|
|
12
|
+
server.tool("get_wallet_activity", "Get the recent transaction history for a wallet — all trades, buys, and sells.", {
|
|
13
|
+
address,
|
|
14
|
+
limit: zod_1.z.number().optional().describe("Max transactions to return (default 20)"),
|
|
15
|
+
}, async ({ address, limit }) => {
|
|
16
|
+
const data = await (0, client_js_1.pmaxisGet)(`/wallets/${address}/activity`, { limit });
|
|
17
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
18
|
+
});
|
|
19
|
+
server.tool("get_wallet_markets", "Get all prediction markets a wallet has traded in.", {
|
|
20
|
+
address,
|
|
21
|
+
limit: zod_1.z.number().optional().describe("Max results (default 20)"),
|
|
22
|
+
}, async ({ address, limit }) => {
|
|
23
|
+
const data = await (0, client_js_1.pmaxisGet)(`/wallets/${address}/markets`, { limit });
|
|
24
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
25
|
+
});
|
|
26
|
+
server.tool("get_wallet_open_positions", "Get all currently open positions held by a wallet — market, token, size, and estimated value.", {
|
|
27
|
+
address,
|
|
28
|
+
limit: zod_1.z.number().optional().describe("Max positions to return (default 20)"),
|
|
29
|
+
}, async ({ address, limit }) => {
|
|
30
|
+
const data = await (0, client_js_1.pmaxisGet)(`/wallets/${address}/positions/open`, { limit });
|
|
31
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
32
|
+
});
|
|
33
|
+
server.tool("get_wallet_onchain", "Get on-chain data for a wallet — USDC balance, token holdings, and blockchain activity.", { address }, async ({ address }) => {
|
|
34
|
+
const data = await (0, client_js_1.pmaxisGet)(`/wallets/${address}/onchain`);
|
|
35
|
+
return { content: [{ type: "text", text: (0, client_js_1.toText)(data) }] };
|
|
36
|
+
});
|
|
37
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pmaxis/mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for PMAxis — prediction market data tools for AI assistants",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"pmaxis-mcp": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "node node_modules/esbuild/bin/esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js --banner:js=\"#!/usr/bin/env node\"",
|
|
11
|
+
"dev": "node node_modules/esbuild/bin/esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js --watch --banner:js=\"#!/usr/bin/env node\"",
|
|
12
|
+
"typecheck": "node --max-old-space-size=4096 node_modules/typescript/bin/tsc --noEmit",
|
|
13
|
+
"start": "node dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
17
|
+
"zod": "^3.23.8"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"esbuild": "^0.21.5",
|
|
21
|
+
"typescript": "^5.4.5",
|
|
22
|
+
"@types/node": "^20.12.12"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"keywords": ["mcp", "polymarket", "prediction-markets", "pmaxis"],
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18"
|
|
32
|
+
}
|
|
33
|
+
}
|