@0xinsider/mcp 2.1.0 → 2.4.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 +49 -17
- package/dist/catalog.generated.d.ts +42 -6
- package/dist/catalog.generated.d.ts.map +1 -1
- package/dist/catalog.generated.js +51 -6
- package/dist/catalog.generated.js.map +1 -1
- package/dist/cli-lib.d.ts +8 -0
- package/dist/cli-lib.d.ts.map +1 -1
- package/dist/cli-lib.js +123 -17
- package/dist/cli-lib.js.map +1 -1
- package/dist/client.d.ts +35 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +42 -4
- package/dist/client.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/product-cli/client.d.ts +3 -2
- package/dist/product-cli/client.d.ts.map +1 -1
- package/dist/product-cli/client.js.map +1 -1
- package/dist/product-cli/index.d.ts.map +1 -1
- package/dist/product-cli/index.js +3 -1
- package/dist/product-cli/index.js.map +1 -1
- package/dist/prompts/index.js +2 -2
- package/dist/sdk/client.d.ts +861 -136
- package/dist/sdk/client.d.ts.map +1 -1
- package/dist/sdk/client.js +924 -127
- package/dist/sdk/client.js.map +1 -1
- package/dist/sdk/errors.d.ts +48 -4
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +123 -3
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.d.ts +40 -9
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +6 -4
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/pagination.d.ts +133 -15
- package/dist/sdk/pagination.d.ts.map +1 -1
- package/dist/sdk/pagination.js +132 -34
- package/dist/sdk/pagination.js.map +1 -1
- package/dist/sdk/retry.d.ts +68 -0
- package/dist/sdk/retry.d.ts.map +1 -0
- package/dist/sdk/retry.js +125 -0
- package/dist/sdk/retry.js.map +1 -0
- package/dist/sdk/schema.d.ts +2200 -688
- package/dist/sdk/schema.d.ts.map +1 -1
- package/dist/sdk/stream.d.ts +323 -8
- package/dist/sdk/stream.d.ts.map +1 -1
- package/dist/sdk/stream.js +582 -56
- package/dist/sdk/stream.js.map +1 -1
- package/dist/sdk/webhooks.d.ts +104 -12
- package/dist/sdk/webhooks.d.ts.map +1 -1
- package/dist/sdk/webhooks.js +22 -4
- package/dist/sdk/webhooks.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +13 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/explore-markets.d.ts.map +1 -1
- package/dist/tools/explore-markets.js +2 -5
- package/dist/tools/explore-markets.js.map +1 -1
- package/dist/tools/games.d.ts +5 -0
- package/dist/tools/games.d.ts.map +1 -0
- package/dist/tools/games.js +103 -0
- package/dist/tools/games.js.map +1 -0
- package/dist/tools/get-insider-radar.d.ts.map +1 -1
- package/dist/tools/get-insider-radar.js +11 -40
- package/dist/tools/get-insider-radar.js.map +1 -1
- package/dist/tools/get-large-positions.d.ts.map +1 -1
- package/dist/tools/get-large-positions.js +3 -10
- package/dist/tools/get-large-positions.js.map +1 -1
- package/dist/tools/get-leaderboard.d.ts.map +1 -1
- package/dist/tools/get-leaderboard.js +23 -12
- package/dist/tools/get-leaderboard.js.map +1 -1
- package/dist/tools/get-market-intel.d.ts.map +1 -1
- package/dist/tools/get-market-intel.js +3 -6
- package/dist/tools/get-market-intel.js.map +1 -1
- package/dist/tools/get-position-timeline.d.ts.map +1 -1
- package/dist/tools/get-position-timeline.js +3 -10
- package/dist/tools/get-position-timeline.js.map +1 -1
- package/dist/tools/get-positions.d.ts +2 -0
- package/dist/tools/get-positions.d.ts.map +1 -1
- package/dist/tools/get-positions.js +8 -11
- package/dist/tools/get-positions.js.map +1 -1
- package/dist/tools/get-suspicious-trades.d.ts +26 -0
- package/dist/tools/get-suspicious-trades.d.ts.map +1 -0
- package/dist/tools/get-suspicious-trades.js +91 -0
- package/dist/tools/get-suspicious-trades.js.map +1 -0
- package/dist/tools/get-trader-pnl.d.ts.map +1 -1
- package/dist/tools/get-trader-pnl.js +3 -6
- package/dist/tools/get-trader-pnl.js.map +1 -1
- package/dist/tools/get-trader.d.ts.map +1 -1
- package/dist/tools/get-trader.js +3 -6
- package/dist/tools/get-trader.js.map +1 -1
- package/dist/tools/get-trending-wallets.d.ts.map +1 -1
- package/dist/tools/get-trending-wallets.js +3 -10
- package/dist/tools/get-trending-wallets.js.map +1 -1
- package/dist/tools/get-whale-trades.d.ts +2 -0
- package/dist/tools/get-whale-trades.d.ts.map +1 -1
- package/dist/tools/get-whale-trades.js +21 -16
- package/dist/tools/get-whale-trades.js.map +1 -1
- package/dist/tools/pick-of-the-day.d.ts.map +1 -1
- package/dist/tools/pick-of-the-day.js +5 -21
- package/dist/tools/pick-of-the-day.js.map +1 -1
- package/dist/tools/read-parity.d.ts +8 -0
- package/dist/tools/read-parity.d.ts.map +1 -1
- package/dist/tools/read-parity.js +125 -77
- package/dist/tools/read-parity.js.map +1 -1
- package/dist/tools/result.d.ts +31 -0
- package/dist/tools/result.d.ts.map +1 -0
- package/dist/tools/result.js +70 -0
- package/dist/tools/result.js.map +1 -0
- package/dist/tools/search-markets.d.ts.map +1 -1
- package/dist/tools/search-markets.js +16 -11
- package/dist/tools/search-markets.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Official CLI and MCP server for [0xinsider](https://0xinsider.com) — advanced tools for sports and esports markets, powered by Polymarket, for AI agents and scripts.
|
|
4
4
|
|
|
5
|
-
Gives your AI agent and terminal scripts the same Polymarket data the tools run on: wallet grades on settled P&L, large trades, which side the profitable wallets hold on a market, daily picks on a public record, and
|
|
5
|
+
Gives your AI agent and terminal scripts the same Polymarket data the tools run on: wallet grades on settled P&L, large trades, which side the profitable wallets hold on a market, daily picks on a public record, and suspicious trades.
|
|
6
6
|
|
|
7
7
|
## CLI and MCP entry points
|
|
8
8
|
|
|
@@ -36,35 +36,44 @@ is generated from the same public OpenAPI contract the CLI and MCP tools read.
|
|
|
36
36
|
|
|
37
37
|
## Two ways to connect
|
|
38
38
|
|
|
39
|
-
- **Remote HTTP (no install)** — `POST https://api.0xinsider.com/api/v1/mcp` with `Authorization: Bearer oxi_sk_live_...`. Implements the MCP Streamable HTTP transport (protocolVersion `2025-11-25`). Works with MCP clients that speak HTTP and can send headers. `initialize`, `ping` and `tools/list` need no key, so a client can show the catalog first; `tools/call` without a credential answers HTTP 401 with a `WWW-Authenticate` challenge naming the RFC 9728 document at `/.well-known/oauth-protected-resource/api/v1/mcp`. Clients that implement the MCP authorization spec follow it to the OAuth 2.1 authorization server (PKCE S256, dynamic client registration), sign the user in and send the resulting access token instead of an API key; see https://0xinsider.com/auth.md.
|
|
39
|
+
- **Remote HTTP (no install)** — `POST https://api.0xinsider.com/api/v1/mcp` with `Authorization: Bearer oxi_sk_live_...`. Implements the MCP Streamable HTTP transport (protocolVersion `2025-11-25`). Works with MCP clients that speak HTTP and can send headers. `initialize`, `ping` and `tools/list` need no key, so a client can show the catalog first; `tools/call` without a credential answers HTTP 401 with a `WWW-Authenticate` challenge naming the RFC 9728 document at `/.well-known/oauth-protected-resource/api/v1/mcp`. Clients that implement the MCP authorization spec follow it to the OAuth 2.1 authorization server (PKCE S256, dynamic client registration), sign the user in and send the resulting access token instead of an API key; see https://0xinsider.com/auth.md. A key in a `?token=` query parameter is rejected on every route, `/api/v1/mcp` included, with `401 invalid_api_key` and `error.reason` `api_key_in_query`, because URL secrets leak through shell history, browser history, proxy logs, and crash reports. A client that can only take a URL runs the stdio package with the key in its environment. Remote and stdio use the same read-only public V1 tool catalog, rate limits, and billing.
|
|
40
40
|
- **Documentation server (no install, no key)** — `https://docs.0xinsider.com/mcp` searches and reads the developer documentation over MCP. Add it beside the product server so an agent can look up how an endpoint works before it calls a tool.
|
|
41
41
|
- **Stdio (this npm package)** — run `npx -y @0xinsider/mcp` locally for Claude Code / Cursor / Codex / Gemini CLI. Best when the client can launch a child process and you prefer to keep the API key out of URLs.
|
|
42
42
|
|
|
43
43
|
<!-- generated-mcp-catalog:start -->
|
|
44
|
-
Both remote HTTP and stdio expose
|
|
44
|
+
Both remote HTTP and stdio expose 44 read-only tools from the Rust canonical registry.
|
|
45
45
|
|
|
46
46
|
- `get_leaderboard` — Get Trader Leaderboard (group: traders)
|
|
47
47
|
- `get_trader` — Get Trader Intelligence (group: traders)
|
|
48
48
|
- `batch_get_traders` — Batch Trader Intelligence (group: traders)
|
|
49
|
-
- `
|
|
50
|
-
- `
|
|
51
|
-
- `
|
|
49
|
+
- `get_large_trades` — List large trades (group: large_trades)
|
|
50
|
+
- `get_large_trade` — Get large trade (group: large_trades)
|
|
51
|
+
- `get_large_trades_history` — Replay historical large trades (group: large_trades)
|
|
52
|
+
- `get_whale_trades` — List Whale Trades (group: large_trades)
|
|
53
|
+
- `get_whale_trade` — Get Whale Trade (group: large_trades)
|
|
54
|
+
- `get_whale_trades_history` — Replay Historical Whale Trades (group: large_trades)
|
|
55
|
+
- `get_pre_game_sides` — List pre-game sides (group: markets)
|
|
56
|
+
- `get_pre_game_side_observations` — List pre-game side observations (group: markets)
|
|
52
57
|
- `get_sports_edge_signals` — Get Ranked Sports Edge Signals (group: markets)
|
|
53
58
|
- `get_sports_edge_observations` — Get Sports Edge Observations (group: markets)
|
|
59
|
+
- `list_games` — List covered games (group: games)
|
|
60
|
+
- `get_game` — Get one game (group: games)
|
|
54
61
|
- `get_market_intel` — Get Market Intelligence (group: markets)
|
|
55
62
|
- `batch_get_market_intel` — Batch Market Intelligence (group: markets)
|
|
56
63
|
- `get_smart_money_flows` — List Smart-Money Flows (group: markets)
|
|
57
64
|
- `get_sharp_money_flows` — List Sharp-Money Flows (group: markets)
|
|
58
65
|
- `get_market_snapshot` — Get Market Snapshot (group: markets)
|
|
59
|
-
- `
|
|
60
|
-
- `
|
|
66
|
+
- `get_suspicious_trades` — Get suspicious trades (group: suspicious_trades)
|
|
67
|
+
- `get_suspicious_trade` — Get suspicious trade (group: suspicious_trades)
|
|
68
|
+
- `get_insider_radar` — Get Insider Radar Flags (group: suspicious_trades)
|
|
69
|
+
- `get_insider_radar_flag` — Get Insider Radar Flag (group: suspicious_trades)
|
|
61
70
|
- `get_positions` — List Current Positions (group: traders)
|
|
62
71
|
- `get_position_timeline` — Get Position Timeline (group: traders)
|
|
63
72
|
- `get_position_timeline_by_id` — Get Position Timeline By Trader ID (group: traders)
|
|
64
73
|
- `search_markets` — Search Markets (group: markets)
|
|
65
74
|
- `search_content` — Search Editorial Content (group: content)
|
|
66
75
|
- `explore_markets` — Explore Markets (group: markets)
|
|
67
|
-
- `get_event_replay_since` — Replay Public Events (group:
|
|
76
|
+
- `get_event_replay_since` — Replay Public Events (group: large_trades)
|
|
68
77
|
- `list_webhooks` — List Webhook Endpoints (group: webhooks)
|
|
69
78
|
- `get_webhook` — Get Webhook Endpoint (group: webhooks)
|
|
70
79
|
- `get_daily_report_snapshot` — Get Daily Report Snapshot (group: reports)
|
|
@@ -80,6 +89,8 @@ Both remote HTTP and stdio expose 35 read-only tools from the Rust canonical reg
|
|
|
80
89
|
- `get_pick_of_the_day_archive` — Get Pick of the Day Archive (group: picks)
|
|
81
90
|
<!-- generated-mcp-catalog:end -->
|
|
82
91
|
|
|
92
|
+
The canonical suspicious-trade tools are `get_suspicious_trades` and `get_suspicious_trade`; the older `get_insider_radar` and `get_insider_radar_flag` stay live as deprecated aliases on the deprecated `/api/v1/insider-radar` paths, and `get_smart_money_flows` stays live as a deprecated alias of `get_sharp_money_flows`.
|
|
93
|
+
|
|
83
94
|
## Quick Start
|
|
84
95
|
|
|
85
96
|
### Claude Code
|
|
@@ -90,7 +101,9 @@ npx -y @0xinsider/mcp init
|
|
|
90
101
|
|
|
91
102
|
`init` reads the key without echoing it. For non-interactive setup, set `OXINSIDER_API_KEY` in the process environment or pipe the key on stdin. Do not pass the key as a command-line argument.
|
|
92
103
|
|
|
93
|
-
|
|
104
|
+
`init` adds the server to `~/.claude.json`, where Claude Code keeps user-scoped MCP servers, and moves an entry an earlier version left in `~/.claude/settings.json`, which Claude Code does not read for MCP servers. Open a new Claude Code session, then run `claude mcp list` to confirm.
|
|
105
|
+
|
|
106
|
+
Or add it by hand to the top-level `mcpServers` object in `~/.claude.json`:
|
|
94
107
|
|
|
95
108
|
```json
|
|
96
109
|
{
|
|
@@ -177,6 +190,22 @@ npx -y @0xinsider/mcp --help
|
|
|
177
190
|
|
|
178
191
|
Get your API key at [0xinsider.com/developers](https://0xinsider.com/developers). Requires a Pro subscription.
|
|
179
192
|
|
|
193
|
+
## Check access after a lapse
|
|
194
|
+
|
|
195
|
+
The CLI keeps account diagnostics available when paid data access lapses:
|
|
196
|
+
|
|
197
|
+
```sh
|
|
198
|
+
0xinsider whoami --json
|
|
199
|
+
0xinsider usage --json
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
`whoami` calls `GET /api/v1/me` and reports `credential_status` plus
|
|
203
|
+
`entitlement.paid_data_access` and `entitlement.recovery_action`. A lapsed
|
|
204
|
+
credential reports `paid_data_access: "lapsed"` and
|
|
205
|
+
`recovery_action: "renew_subscription"`; `usage` still reports the caller's
|
|
206
|
+
rate-limit, daily-usage and monthly-quota state. Use those fields to choose
|
|
207
|
+
subscription renewal or credential recovery before retrying a paid data call.
|
|
208
|
+
|
|
180
209
|
## Security
|
|
181
210
|
|
|
182
211
|
`init` never prints the API key. If an older version wrote the key to recorded terminal output, rotate the key before you use the new configuration.
|
|
@@ -197,7 +226,7 @@ hand. Markers are not used here because an HTML comment inside a table breaks it
|
|
|
197
226
|
| `get_whale_trade` | Read one whale trade by wt_ ID or raw whale_alerts.id, including persisted suspicion facts |
|
|
198
227
|
| `get_whale_trades_history` | Replay historical whale trades with cursor, market, trader, category, grade, suspicious_only, platform, and time filters |
|
|
199
228
|
| `get_leaderboard` | Top-ranked traders (S/A/B grades) with optional category/strategy filters |
|
|
200
|
-
| `search_markets` | Search prediction markets by keyword |
|
|
229
|
+
| `search_markets` | Search prediction markets by keyword, with cursor pagination (`cursor`, `has_more`, `next_cursor`) |
|
|
201
230
|
| `explore_markets` | Browse whale-active markets with facets and grouped discovery entries |
|
|
202
231
|
| `get_market_intel` | Smart money flow analysis for a specific market |
|
|
203
232
|
| `batch_get_market_intel` | Fetch market intelligence for 1-25 condition IDs in one call |
|
|
@@ -207,8 +236,10 @@ hand. Markers are not used here because an HTML comment inside a table breaks it
|
|
|
207
236
|
| `get_positions` | Current positions with trader, market, value, side, P&L, and freshness context |
|
|
208
237
|
| `get_position_timeline` | Per-market trader fills with running amount and average entry price |
|
|
209
238
|
| `get_position_timeline_by_id` | Per-market trader fills using an internal trader ID alias |
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
239
|
+
| `get_suspicious_trades` | Stored trades whose recorded suspicion score meets the live flag threshold (`severity=watch` returns none: no live watch policy exists) |
|
|
240
|
+
| `get_suspicious_trade` | Read one suspicious trade by rf_ ID or raw numeric `whale_alerts.id` |
|
|
241
|
+
| `get_insider_radar` | Deprecated alias of `get_suspicious_trades`, kept live on the deprecated `/api/v1/insider-radar` path |
|
|
242
|
+
| `get_insider_radar_flag` | Deprecated alias of `get_suspicious_trade`, kept live on the deprecated `/api/v1/insider-radar/{id}` path |
|
|
212
243
|
| `get_event_replay_since` | Durable public event replay after an opaque cursor |
|
|
213
244
|
| `list_webhooks` | Read webhook endpoints owned by the authenticated API-key user |
|
|
214
245
|
| `get_webhook` | Read one webhook endpoint by ID |
|
|
@@ -216,7 +247,7 @@ hand. Markers are not used here because an HTML comment inside a table breaks it
|
|
|
216
247
|
| `get_weekly_report_snapshot` | Read a weekly whale-activity report snapshot by week token or date range |
|
|
217
248
|
| `get_monthly_report_snapshot` | Read a monthly whale-activity report snapshot |
|
|
218
249
|
| `get_trader_export_snapshot` | Read trader export metadata without starting an export job |
|
|
219
|
-
| `get_platforms` | Provider capability matrix: which platforms support grade, P&L, strategy, timeline, whale signal,
|
|
250
|
+
| `get_platforms` | Provider capability matrix: which platforms support grade, P&L, strategy, timeline, whale signal, suspicious trades (and the deprecated `insider_radar` spelling), and market snapshot |
|
|
220
251
|
|
|
221
252
|
## Resources
|
|
222
253
|
|
|
@@ -255,7 +286,7 @@ Once configured, ask your AI agent:
|
|
|
255
286
|
|
|
256
287
|
## Rate Limits
|
|
257
288
|
|
|
258
|
-
100 requests per minute per user. The server returns actionable error messages when limits are hit
|
|
289
|
+
100 requests per minute per user, and 250,000 requests a calendar month (UTC) included with Pro; over that, pay as you go at USD 0.20 per 1,000 when it is turned on at https://0xinsider.com/developers, otherwise `429` with `error.reason` `monthly_quota_exceeded` until the month resets (from October 1, 2026). The server returns actionable error messages when limits are hit, and every authenticated response carries `X-Monthly-Quota-Remaining` and `X-Monthly-Quota-Reset`.
|
|
259
290
|
|
|
260
291
|
## Timeouts
|
|
261
292
|
|
|
@@ -337,8 +368,9 @@ webhook administration, exports, streams and Markdown routes are excluded.
|
|
|
337
368
|
Stored-session reads obtain current credentials for each page. A 401 permits
|
|
338
369
|
one refresh/reload and one retry of that same page; earlier pages are preserved.
|
|
339
370
|
A rotated token from another process is reused without replaying its consumed
|
|
340
|
-
refresh token. Environment keys are not refreshed. Revocation
|
|
341
|
-
lapse
|
|
371
|
+
refresh token. Environment keys are not refreshed. Revocation and insufficient
|
|
372
|
+
scope remain failures. A subscription lapse still fails paid data reads, while
|
|
373
|
+
`whoami` and `usage` remain available so the CLI can show the recovery state.
|
|
342
374
|
|
|
343
375
|
`--timeout-ms` bounds each request including lock waits, refresh and SDK retries (default 30000,
|
|
344
376
|
maximum 300000). `--retries` is 0–3 (default 2); the SDK honors Retry-After within
|
|
@@ -10,18 +10,38 @@ export declare const MCP_TOOL_CATALOG: readonly [{
|
|
|
10
10
|
readonly name: "batch_get_traders";
|
|
11
11
|
readonly title: "Batch Trader Intelligence";
|
|
12
12
|
readonly docsGroup: "traders";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "get_large_trades";
|
|
15
|
+
readonly title: "List large trades";
|
|
16
|
+
readonly docsGroup: "large_trades";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "get_large_trade";
|
|
19
|
+
readonly title: "Get large trade";
|
|
20
|
+
readonly docsGroup: "large_trades";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "get_large_trades_history";
|
|
23
|
+
readonly title: "Replay historical large trades";
|
|
24
|
+
readonly docsGroup: "large_trades";
|
|
13
25
|
}, {
|
|
14
26
|
readonly name: "get_whale_trades";
|
|
15
27
|
readonly title: "List Whale Trades";
|
|
16
|
-
readonly docsGroup: "
|
|
28
|
+
readonly docsGroup: "large_trades";
|
|
17
29
|
}, {
|
|
18
30
|
readonly name: "get_whale_trade";
|
|
19
31
|
readonly title: "Get Whale Trade";
|
|
20
|
-
readonly docsGroup: "
|
|
32
|
+
readonly docsGroup: "large_trades";
|
|
21
33
|
}, {
|
|
22
34
|
readonly name: "get_whale_trades_history";
|
|
23
35
|
readonly title: "Replay Historical Whale Trades";
|
|
24
|
-
readonly docsGroup: "
|
|
36
|
+
readonly docsGroup: "large_trades";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "get_pre_game_sides";
|
|
39
|
+
readonly title: "List pre-game sides";
|
|
40
|
+
readonly docsGroup: "markets";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "get_pre_game_side_observations";
|
|
43
|
+
readonly title: "List pre-game side observations";
|
|
44
|
+
readonly docsGroup: "markets";
|
|
25
45
|
}, {
|
|
26
46
|
readonly name: "get_sports_edge_signals";
|
|
27
47
|
readonly title: "Get Ranked Sports Edge Signals";
|
|
@@ -30,6 +50,14 @@ export declare const MCP_TOOL_CATALOG: readonly [{
|
|
|
30
50
|
readonly name: "get_sports_edge_observations";
|
|
31
51
|
readonly title: "Get Sports Edge Observations";
|
|
32
52
|
readonly docsGroup: "markets";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "list_games";
|
|
55
|
+
readonly title: "List covered games";
|
|
56
|
+
readonly docsGroup: "games";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "get_game";
|
|
59
|
+
readonly title: "Get one game";
|
|
60
|
+
readonly docsGroup: "games";
|
|
33
61
|
}, {
|
|
34
62
|
readonly name: "get_market_intel";
|
|
35
63
|
readonly title: "Get Market Intelligence";
|
|
@@ -50,14 +78,22 @@ export declare const MCP_TOOL_CATALOG: readonly [{
|
|
|
50
78
|
readonly name: "get_market_snapshot";
|
|
51
79
|
readonly title: "Get Market Snapshot";
|
|
52
80
|
readonly docsGroup: "markets";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "get_suspicious_trades";
|
|
83
|
+
readonly title: "Get suspicious trades";
|
|
84
|
+
readonly docsGroup: "suspicious_trades";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "get_suspicious_trade";
|
|
87
|
+
readonly title: "Get suspicious trade";
|
|
88
|
+
readonly docsGroup: "suspicious_trades";
|
|
53
89
|
}, {
|
|
54
90
|
readonly name: "get_insider_radar";
|
|
55
91
|
readonly title: "Get Insider Radar Flags";
|
|
56
|
-
readonly docsGroup: "
|
|
92
|
+
readonly docsGroup: "suspicious_trades";
|
|
57
93
|
}, {
|
|
58
94
|
readonly name: "get_insider_radar_flag";
|
|
59
95
|
readonly title: "Get Insider Radar Flag";
|
|
60
|
-
readonly docsGroup: "
|
|
96
|
+
readonly docsGroup: "suspicious_trades";
|
|
61
97
|
}, {
|
|
62
98
|
readonly name: "get_positions";
|
|
63
99
|
readonly title: "List Current Positions";
|
|
@@ -85,7 +121,7 @@ export declare const MCP_TOOL_CATALOG: readonly [{
|
|
|
85
121
|
}, {
|
|
86
122
|
readonly name: "get_event_replay_since";
|
|
87
123
|
readonly title: "Replay Public Events";
|
|
88
|
-
readonly docsGroup: "
|
|
124
|
+
readonly docsGroup: "large_trades";
|
|
89
125
|
}, {
|
|
90
126
|
readonly name: "list_webhooks";
|
|
91
127
|
readonly title: "List Webhook Endpoints";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.generated.d.ts","sourceRoot":"","sources":["../src/catalog.generated.ts"],"names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AO,EAAE,uBAAuB;aAChC,SAAW,EAAE,SAAS;;aAGtB,IAAM,EAAE,gBAAgB;aACxB,KAAO,EAAE,4BAA4B;aACrC,SAAW,EAAE,SAAS;;aAGtB,IAAM,EAAE,qBAAqB;aAC7B,KAAO,EAAE,qBAAqB;aAC9B,SAAW,EAAE,OAAO;;aAGpB,IAAM,EAAE,6BAA6B;aACrC,KAAO,EAAE,6BAA6B;aACtC,SAAW,EAAE,OAAO;EAEd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAEpD,CAAC"}
|
|
@@ -16,20 +16,45 @@ export const MCP_TOOL_CATALOG = [
|
|
|
16
16
|
"title": "Batch Trader Intelligence",
|
|
17
17
|
"docsGroup": "traders"
|
|
18
18
|
},
|
|
19
|
+
{
|
|
20
|
+
"name": "get_large_trades",
|
|
21
|
+
"title": "List large trades",
|
|
22
|
+
"docsGroup": "large_trades"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "get_large_trade",
|
|
26
|
+
"title": "Get large trade",
|
|
27
|
+
"docsGroup": "large_trades"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "get_large_trades_history",
|
|
31
|
+
"title": "Replay historical large trades",
|
|
32
|
+
"docsGroup": "large_trades"
|
|
33
|
+
},
|
|
19
34
|
{
|
|
20
35
|
"name": "get_whale_trades",
|
|
21
36
|
"title": "List Whale Trades",
|
|
22
|
-
"docsGroup": "
|
|
37
|
+
"docsGroup": "large_trades"
|
|
23
38
|
},
|
|
24
39
|
{
|
|
25
40
|
"name": "get_whale_trade",
|
|
26
41
|
"title": "Get Whale Trade",
|
|
27
|
-
"docsGroup": "
|
|
42
|
+
"docsGroup": "large_trades"
|
|
28
43
|
},
|
|
29
44
|
{
|
|
30
45
|
"name": "get_whale_trades_history",
|
|
31
46
|
"title": "Replay Historical Whale Trades",
|
|
32
|
-
"docsGroup": "
|
|
47
|
+
"docsGroup": "large_trades"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "get_pre_game_sides",
|
|
51
|
+
"title": "List pre-game sides",
|
|
52
|
+
"docsGroup": "markets"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "get_pre_game_side_observations",
|
|
56
|
+
"title": "List pre-game side observations",
|
|
57
|
+
"docsGroup": "markets"
|
|
33
58
|
},
|
|
34
59
|
{
|
|
35
60
|
"name": "get_sports_edge_signals",
|
|
@@ -41,6 +66,16 @@ export const MCP_TOOL_CATALOG = [
|
|
|
41
66
|
"title": "Get Sports Edge Observations",
|
|
42
67
|
"docsGroup": "markets"
|
|
43
68
|
},
|
|
69
|
+
{
|
|
70
|
+
"name": "list_games",
|
|
71
|
+
"title": "List covered games",
|
|
72
|
+
"docsGroup": "games"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "get_game",
|
|
76
|
+
"title": "Get one game",
|
|
77
|
+
"docsGroup": "games"
|
|
78
|
+
},
|
|
44
79
|
{
|
|
45
80
|
"name": "get_market_intel",
|
|
46
81
|
"title": "Get Market Intelligence",
|
|
@@ -66,15 +101,25 @@ export const MCP_TOOL_CATALOG = [
|
|
|
66
101
|
"title": "Get Market Snapshot",
|
|
67
102
|
"docsGroup": "markets"
|
|
68
103
|
},
|
|
104
|
+
{
|
|
105
|
+
"name": "get_suspicious_trades",
|
|
106
|
+
"title": "Get suspicious trades",
|
|
107
|
+
"docsGroup": "suspicious_trades"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "get_suspicious_trade",
|
|
111
|
+
"title": "Get suspicious trade",
|
|
112
|
+
"docsGroup": "suspicious_trades"
|
|
113
|
+
},
|
|
69
114
|
{
|
|
70
115
|
"name": "get_insider_radar",
|
|
71
116
|
"title": "Get Insider Radar Flags",
|
|
72
|
-
"docsGroup": "
|
|
117
|
+
"docsGroup": "suspicious_trades"
|
|
73
118
|
},
|
|
74
119
|
{
|
|
75
120
|
"name": "get_insider_radar_flag",
|
|
76
121
|
"title": "Get Insider Radar Flag",
|
|
77
|
-
"docsGroup": "
|
|
122
|
+
"docsGroup": "suspicious_trades"
|
|
78
123
|
},
|
|
79
124
|
{
|
|
80
125
|
"name": "get_positions",
|
|
@@ -109,7 +154,7 @@ export const MCP_TOOL_CATALOG = [
|
|
|
109
154
|
{
|
|
110
155
|
"name": "get_event_replay_since",
|
|
111
156
|
"title": "Replay Public Events",
|
|
112
|
-
"docsGroup": "
|
|
157
|
+
"docsGroup": "large_trades"
|
|
113
158
|
},
|
|
114
159
|
{
|
|
115
160
|
"name": "list_webhooks",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.generated.js","sourceRoot":"","sources":["../src/catalog.generated.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,wFAAwF;AAExF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;QACE,MAAM,EAAE,iBAAiB;QACzB,OAAO,EAAE,wBAAwB;QACjC,WAAW,EAAE,SAAS;KACvB;IACD;QACE,MAAM,EAAE,YAAY;QACpB,OAAO,EAAE,yBAAyB;QAClC,WAAW,EAAE,SAAS;KACvB;IACD;QACE,MAAM,EAAE,mBAAmB;QAC3B,OAAO,EAAE,2BAA2B;QACpC,WAAW,EAAE,SAAS;KACvB;IACD;QACE,MAAM,EAAE,kBAAkB;QAC1B,OAAO,EAAE,mBAAmB;QAC5B,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"catalog.generated.js","sourceRoot":"","sources":["../src/catalog.generated.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,wFAAwF;AAExF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;QACE,MAAM,EAAE,iBAAiB;QACzB,OAAO,EAAE,wBAAwB;QACjC,WAAW,EAAE,SAAS;KACvB;IACD;QACE,MAAM,EAAE,YAAY;QACp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;QACtC,WAAW,EAAE,OAAO;KACrB;CACO,CAAC;AAIX,MAAM,CAAC,MAAM,kBAAkB,GAA2B,gBAAgB,CAAC,GAAG,CAC5E,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CACpB,CAAC"}
|
package/dist/cli-lib.d.ts
CHANGED
|
@@ -20,7 +20,15 @@ export declare function resolveCliCommand(args: readonly string[]): CliCommand;
|
|
|
20
20
|
export declare function detectEnvironments(home?: string): Environment[];
|
|
21
21
|
export declare function readJsonFile(path: string): Record<string, JsonValue>;
|
|
22
22
|
export declare function writeJsonFile(path: string, data: Record<string, JsonValue>): void;
|
|
23
|
+
/**
|
|
24
|
+
* Read-modify-write of a JSON config that another program may be saving at
|
|
25
|
+
* the same time (#16686). Each attempt edits the file as it is now and only
|
|
26
|
+
* replaces it if it is still that version, so a field Claude Code wrote in
|
|
27
|
+
* between is merged rather than lost.
|
|
28
|
+
*/
|
|
29
|
+
export declare function updateJsonFile(path: string, mutate: (config: Record<string, JsonValue>) => void): void;
|
|
23
30
|
export declare function addJsonMcpServer(configPath: string, apiKey: string): void;
|
|
31
|
+
export declare function removeStaleClaudeSettingsServer(home: string): void;
|
|
24
32
|
export declare function addCodexMcpServer(configPath: string, apiKey: string): void;
|
|
25
33
|
export declare function runCli(args: readonly string[]): Promise<void>;
|
|
26
34
|
export {};
|
package/dist/cli-lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-lib.d.ts","sourceRoot":"","sources":["../src/cli-lib.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-lib.d.ts","sourceRoot":"","sources":["../src/cli-lib.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAEhF,MAAM,MAAM,WAAW,GAAG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IAAI,EAAE,MAAM,GAAG,IAAI,CA0BlE;AAwCD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAM1E;AAmDD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBnE"}
|
package/dist/cli-lib.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
2
|
+
import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readlinkSync, renameSync, unlinkSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
import { createInterface } from "node:readline";
|
|
5
5
|
import { API_KEY_ENV_VAR, DEVELOPERS_URL, MCP_NPX_ARGS, MCP_NPX_COMMAND, PACKAGE_NAME, SERVER_NAME, } from "./constants.js";
|
|
6
6
|
import { runServer } from "./server.js";
|
|
@@ -222,9 +222,12 @@ function validateApiKey(apiKey) {
|
|
|
222
222
|
}
|
|
223
223
|
export function detectEnvironments(home = process.env.HOME ?? process.env.USERPROFILE ?? "") {
|
|
224
224
|
const environments = [];
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
// Claude Code keeps user-scoped MCP servers in ~/.claude.json, never in
|
|
226
|
+
// ~/.claude/settings.json: a server written there is not listed by
|
|
227
|
+
// `claude mcp list` and never starts (#16587).
|
|
228
|
+
const claudeConfigPath = join(home, ".claude.json");
|
|
229
|
+
if (existsSync(claudeConfigPath) || existsSync(join(home, ".claude"))) {
|
|
230
|
+
environments.push({ type: "claude-code", configPath: claudeConfigPath });
|
|
228
231
|
}
|
|
229
232
|
const cursorDir = join(home, ".cursor");
|
|
230
233
|
if (existsSync(cursorDir)) {
|
|
@@ -273,8 +276,11 @@ function isJsonRecord(value) {
|
|
|
273
276
|
export function readJsonFile(path) {
|
|
274
277
|
if (!existsSync(path))
|
|
275
278
|
return {};
|
|
279
|
+
return parseJsonConfig(path, readFileSync(path, "utf-8"));
|
|
280
|
+
}
|
|
281
|
+
function parseJsonConfig(path, text) {
|
|
276
282
|
try {
|
|
277
|
-
const parsed = JSON.parse(
|
|
283
|
+
const parsed = JSON.parse(text);
|
|
278
284
|
if (!isJsonRecord(parsed)) {
|
|
279
285
|
throw new Error(`${path} does not contain a JSON object`);
|
|
280
286
|
}
|
|
@@ -285,28 +291,124 @@ export function readJsonFile(path) {
|
|
|
285
291
|
throw new Error(`Refusing to update malformed MCP config ${path}: ${message}`);
|
|
286
292
|
}
|
|
287
293
|
}
|
|
288
|
-
|
|
289
|
-
|
|
294
|
+
// The file a write to `path` must replace: `path` itself, or the end of its
|
|
295
|
+
// symlink chain. Followed with lstat/readlink rather than realpath, so a
|
|
296
|
+
// DANGLING link (a dotfiles repo whose target is not created yet) is written
|
|
297
|
+
// at its target and stays a link, instead of being replaced by a regular file
|
|
298
|
+
// (#16686).
|
|
299
|
+
function resolveWriteTarget(path) {
|
|
300
|
+
let current = path;
|
|
301
|
+
for (let hops = 0; hops < 40; hops += 1) {
|
|
302
|
+
let isLink;
|
|
303
|
+
try {
|
|
304
|
+
isLink = lstatSync(current).isSymbolicLink();
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
if (error.code === "ENOENT")
|
|
308
|
+
return current;
|
|
309
|
+
throw error;
|
|
310
|
+
}
|
|
311
|
+
if (!isLink)
|
|
312
|
+
return current;
|
|
313
|
+
current = resolve(dirname(current), readlinkSync(current));
|
|
314
|
+
}
|
|
315
|
+
throw new Error(`${path}: too many levels of symbolic links`);
|
|
316
|
+
}
|
|
317
|
+
function readTextOrNull(path) {
|
|
318
|
+
try {
|
|
319
|
+
return readFileSync(path, "utf-8");
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
if (error.code === "ENOENT")
|
|
323
|
+
return null;
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// Writes through a temporary file and a rename, so a crash or a concurrent
|
|
328
|
+
// reader never sees a half-written config: ~/.claude.json holds all of Claude
|
|
329
|
+
// Code's state, not only MCP servers. A symlinked config (a dotfiles repo) is
|
|
330
|
+
// resolved first and replaced at its target, so the link survives. `expected`
|
|
331
|
+
// is the text the caller's edit was based on: when the file changed since
|
|
332
|
+
// (Claude Code saved state meanwhile), nothing is replaced and the caller is
|
|
333
|
+
// told to merge again (#16686).
|
|
334
|
+
function writeTextFileRestricted(path, data, expected) {
|
|
335
|
+
const target = resolveWriteTarget(path);
|
|
336
|
+
const dir = dirname(target);
|
|
290
337
|
if (!existsSync(dir)) {
|
|
291
338
|
mkdirSync(dir, { recursive: true });
|
|
292
339
|
}
|
|
293
|
-
|
|
294
|
-
|
|
340
|
+
const temporary = `${target}.${process.pid}.tmp`;
|
|
341
|
+
writeFileSync(temporary, data, { mode: 0o600 });
|
|
342
|
+
chmodSync(temporary, 0o600);
|
|
343
|
+
if (expected !== undefined && readTextOrNull(target) !== expected) {
|
|
344
|
+
unlinkSync(temporary);
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
renameSync(temporary, target);
|
|
348
|
+
return true;
|
|
295
349
|
}
|
|
296
350
|
export function writeJsonFile(path, data) {
|
|
297
351
|
writeTextFileRestricted(path, JSON.stringify(data, null, 2) + "\n");
|
|
298
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Read-modify-write of a JSON config that another program may be saving at
|
|
355
|
+
* the same time (#16686). Each attempt edits the file as it is now and only
|
|
356
|
+
* replaces it if it is still that version, so a field Claude Code wrote in
|
|
357
|
+
* between is merged rather than lost.
|
|
358
|
+
*/
|
|
359
|
+
export function updateJsonFile(path, mutate) {
|
|
360
|
+
const target = resolveWriteTarget(path);
|
|
361
|
+
for (let attempt = 0; attempt < 5; attempt += 1) {
|
|
362
|
+
const before = readTextOrNull(target);
|
|
363
|
+
const config = before === null ? {} : parseJsonConfig(path, before);
|
|
364
|
+
mutate(config);
|
|
365
|
+
if (writeTextFileRestricted(path, JSON.stringify(config, null, 2) + "\n", before)) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
throw new Error(`${path} kept changing while it was being updated; close the program writing it and run init again.`);
|
|
370
|
+
}
|
|
299
371
|
export function addJsonMcpServer(configPath, apiKey) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
372
|
+
updateJsonFile(configPath, (config) => {
|
|
373
|
+
const existing = config.mcpServers;
|
|
374
|
+
const mcpServers = isJsonRecord(existing) ? existing : {};
|
|
375
|
+
mcpServers[SERVER_NAME] = buildMcpConfig(apiKey);
|
|
376
|
+
config.mcpServers = mcpServers;
|
|
377
|
+
});
|
|
306
378
|
console.log(`\nAdded ${SERVER_NAME} MCP server to ${configPath}`);
|
|
307
379
|
}
|
|
380
|
+
// Moves a server an earlier `init` wrote to ~/.claude/settings.json, where
|
|
381
|
+
// Claude Code never reads it, so the key does not sit in a second file. A
|
|
382
|
+
// settings file this cannot parse is reported and left untouched.
|
|
383
|
+
export function removeStaleClaudeSettingsServer(home) {
|
|
384
|
+
const settingsPath = join(home, ".claude", "settings.json");
|
|
385
|
+
if (!existsSync(settingsPath))
|
|
386
|
+
return;
|
|
387
|
+
let settings;
|
|
388
|
+
try {
|
|
389
|
+
settings = readJsonFile(settingsPath);
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
393
|
+
console.error(`\nCould not check ${settingsPath} for an old ${SERVER_NAME} entry (${message}). If it has one, remove it by hand.`);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const servers = settings.mcpServers;
|
|
397
|
+
if (!isJsonRecord(servers) || !(SERVER_NAME in servers))
|
|
398
|
+
return;
|
|
399
|
+
updateJsonFile(settingsPath, (current) => {
|
|
400
|
+
const currentServers = current.mcpServers;
|
|
401
|
+
if (!isJsonRecord(currentServers))
|
|
402
|
+
return;
|
|
403
|
+
delete currentServers[SERVER_NAME];
|
|
404
|
+
if (Object.keys(currentServers).length === 0) {
|
|
405
|
+
delete current.mcpServers;
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
console.log(`Removed the old ${SERVER_NAME} entry from ${settingsPath}; Claude Code does not read MCP servers from that file.`);
|
|
409
|
+
}
|
|
308
410
|
function printManualInstructions() {
|
|
309
|
-
console.log("\nClaude Code
|
|
411
|
+
console.log("\nClaude Code (top-level mcpServers in ~/.claude.json), Cursor (~/.cursor/mcp.json), or Gemini CLI (~/.gemini/settings.json) JSON:\n");
|
|
310
412
|
console.log(JSON.stringify({ mcpServers: { [SERVER_NAME]: buildMcpConfigTemplate() } }, null, 2));
|
|
311
413
|
console.log("\nCodex TOML (~/.codex/config.toml):\n");
|
|
312
414
|
console.log(formatCodexTomlTemplate());
|
|
@@ -369,6 +471,10 @@ async function runSetup() {
|
|
|
369
471
|
return;
|
|
370
472
|
}
|
|
371
473
|
addJsonMcpServer(env.configPath, apiKey);
|
|
474
|
+
if (env.type === "claude-code") {
|
|
475
|
+
removeStaleClaudeSettingsServer(dirname(env.configPath));
|
|
476
|
+
console.log("Claude Code loads MCP servers when a session starts: open a new session, then run `claude mcp list` to confirm.");
|
|
477
|
+
}
|
|
372
478
|
}
|
|
373
479
|
export async function runCli(args) {
|
|
374
480
|
if (isProductCommand(args[0])) {
|