@crush-protocol/mcp-client 0.4.18 → 0.4.20

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/INSTRUCTIONS.md CHANGED
@@ -45,26 +45,42 @@ After login, credentials are cached locally and reused across supported hosts.
45
45
 
46
46
  ### šŸ“ˆ Market Data (ClickHouse)
47
47
 
48
- | Tool | Purpose |
49
- | ----------------------- | ---------------------------------------------------------------------------- |
50
- | `list_tables` | List all ClickHouse tables with descriptions. |
51
- | `list_tokens` | List available trading pairs in the data warehouse. |
52
- | `list_indicators` | List pre-computed indicators with categories. |
53
- | `list_timeframes` | List available data timeframes. |
54
- | `get_data_range` | Get earliest/latest date for a token + timeframe. |
55
- | `check_query_size` | Estimate row count before fetching. **Call this before large queries.** |
56
- | `fetch_ohlcv` | Fetch OHLCV candlestick data (row cap: 5000). |
57
- | `fetch_indicator` | Fetch pre-computed indicator values (row cap: 5000). |
58
- | `get_connection_config` | Get read-only ClickHouse credentials for local processing of large datasets. |
59
-
60
- ### 🧮 Custom Indicators
61
-
62
- | Tool | Purpose |
63
- | ------------------------- | ------------------------------------- |
64
- | `save_custom_indicator` | Save a custom indicator formula. |
65
- | `list_custom_indicators` | List user's saved indicator formulas. |
66
- | `get_custom_indicator` | Retrieve a formula by name. |
67
- | `delete_custom_indicator` | Delete a formula by name. |
48
+ | Tool | Purpose |
49
+ | ----------------------------------- | -------------------------------------------------------------------- |
50
+ | `crush_ch_list_tables` | List all available tables with descriptions and row counts. |
51
+ | `crush_ch_describe_table` | Get column definitions, types, and comments for a table. |
52
+ | `crush_ch_data_freshness` | Check data freshness for all tables. |
53
+ | `crush_ch_list_indicators` | List pre-computed indicators with categories. |
54
+ | `crush_ch_find_data` | Search data catalog by concept (e.g. "funding rate", "BTC price"). |
55
+ | `crush_ch_query_market_ohlcv` | Query OHLCV, OI, funding, liquidation data (row cap: 5000). |
56
+ | `crush_ch_query_derivatives` | Query derivatives data with interval filter. |
57
+ | `crush_ch_query_global_metrics` | Query global market metrics or per-coin derivatives metrics. |
58
+ | `crush_ch_query_token_market_info` | Query market snapshot data (32 coins, hourly). |
59
+ | `crush_ch_query_hyperliquid_ws` | Query real-time 1m candles (229 perps). |
60
+ | `crush_ch_query_exchange_data` | Query unified exchange data (futures + spot). |
61
+ | `crush_ch_query_sentiment` | Query sentiment consensus data. |
62
+ | `crush_ch_search_twitter` | Search collected tweets by keyword, author, engagement. |
63
+ | `crush_ch_search_news_feeds` | Search aggregated news with sentiment and token filters. |
64
+ | `crush_ch_query_token_list` | Query token snapshots (price, market cap, supply, unlock info). |
65
+ | `crush_ch_query_unlock_events` | Query token unlock schedules. |
66
+ | `crush_ch_run_query` | Run custom read-only SQL (SELECT only, row cap: 5000). |
67
+
68
+ ### šŸ“‰ Liquidation & Risk
69
+
70
+ | Tool | Purpose |
71
+ | -------------------------------------- | ------------------------------------------------------------- |
72
+ | `crush_ch_query_liq_coin_summary` | Per-coin liquidation volume/count by time window. |
73
+ | `crush_ch_query_liq_maxpain` | Max Pain risk scores and critical liquidation price levels. |
74
+ | `crush_ch_query_liq_exchange` | Liquidation distribution across exchanges. |
75
+ | `crush_ch_query_liq_history` | Historical liquidation volume time series. |
76
+ | `crush_ch_query_liq_heatmap_snapshot` | Liquidation heatmap aggregated by price level. |
77
+ | `crush_ch_query_liq_whale_positions` | Whale positions with liquidation prices. |
78
+ | `crush_ext_fear_greed_index` | Fear & Greed Index with BTC price history. |
79
+ | `crush_ext_bitcoin_active_addresses` | Bitcoin daily active address count. |
80
+ | `crush_ext_liq_heatmap` | Real-time liquidation heatmap. |
81
+ | `crush_ext_liq_maxpain` | Real-time Max Pain risk scores for all coins. |
82
+ | `crush_ext_liq_coin_snapshot` | Real-time per-coin liquidation snapshot. |
83
+ | `crush_ext_liq_whale_positions` | Real-time whale positions on-chain. |
68
84
 
69
85
  ### āš™ļø Strategy Management
70
86
 
@@ -78,11 +94,11 @@ After login, credentials are cached locally and reused across supported hosts.
78
94
  | `toggle_strategy` | Activate or deactivate live trading. |
79
95
  | `get_strategy_logs` | Get execution logs for a strategy. |
80
96
 
81
- ### šŸ’° Trading (Hyperliquid)
97
+ ### šŸ’° Trading
82
98
 
83
99
  | Tool | Purpose |
84
100
  | ------------------ | -------------------------------------------------------- |
85
- | `place_order` | Place a market or limit order on Hyperliquid perpetuals. |
101
+ | `place_order` | Place a market or limit order on perpetuals. |
86
102
  | `get_positions` | Get current open positions. |
87
103
  | `get_account_info` | Get account balance, margin, and PnL. |
88
104
  | `get_portfolio` | Get all balances across chains. |
@@ -96,7 +112,6 @@ After login, credentials are cached locally and reused across supported hosts.
96
112
  | `get_trending_tokens` | Get trending tokens on a given chain. |
97
113
  | `get_alpha_feed` | Get recent alpha posts from Twitter and communities. |
98
114
  | `get_token_feed` | Get token-specific news and events. |
99
- | `fetch_news` | Fetch news and intel feeds with keyword/token filters. |
100
115
 
101
116
  ---
102
117
 
@@ -119,11 +134,11 @@ After login, credentials are cached locally and reused across supported hosts.
119
134
  ### Market Research
120
135
 
121
136
  ```
122
- 1. list_tokens / search_tokens → Find tokens of interest
123
- 2. get_data_range → Check data availability
124
- 3. check_query_size → Estimate dataset size
125
- 4. fetch_ohlcv / fetch_indicator → Fetch data (≤5000 rows)
126
- └─ If too large: get_connection_config → write Python script for local processing
137
+ 1. crush_ch_list_tables / crush_ch_find_data → Discover available data
138
+ 2. crush_ch_list_indicators → Browse indicator catalog
139
+ 3. crush_ch_query_market_ohlcv → Fetch OHLCV data (≤5000 rows)
140
+ 4. crush_ch_query_global_metrics → Check market-wide metrics
141
+ 5. crush_ch_run_query → Custom SQL for complex analysis
127
142
  ```
128
143
 
129
144
  ### Go Live
@@ -141,8 +156,8 @@ After login, credentials are cached locally and reused across supported hosts.
141
156
  ## Important Rules
142
157
 
143
158
  1. **Backtest is async**: `create_backtest` returns immediately. Refresh with `list_backtests` until status is `COMPLETED` or `FAILED`. Typical wait: 30s–3min.
144
- 2. **Data row caps**: `fetch_ohlcv` and `fetch_indicator` have a 5000 row limit. For larger datasets, use `get_connection_config` and process locally.
159
+ 2. **Data row caps**: All ClickHouse query tools have a 5000 row limit. Use narrower time ranges or filters to stay within the cap.
145
160
  3. **Always validate first**: Call `validate_expression` before using an expression in `create_backtest` to catch errors early.
146
161
  4. **Signal discovery order**: Always call `get_signal_metadata` → `get_signals_by_category` before building expressions. Don't guess signal IDs.
147
162
  5. **Strategy lifecycle**: Backtest → Create Strategy → Toggle Active. A strategy must be deactivated before deletion.
148
- 6. **Trading is real**: `place_order` executes real trades on Hyperliquid. Always confirm with the user before placing orders.
163
+ 6. **Trading is real**: `place_order` executes real trades. Always confirm with the user before placing orders.
package/README.md CHANGED
@@ -217,7 +217,7 @@ npx -y @crush-protocol/mcp-client setup --windsurf
217
217
  npx -y @crush-protocol/mcp-client setup --claude-desktop
218
218
  ```
219
219
 
220
- **Manual config:** Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
220
+ **Manual config:** Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
221
221
 
222
222
  ```json
223
223
  {
@@ -271,7 +271,7 @@ npx -y @crush-protocol/mcp-client setup --opencode
271
271
  npx -y @crush-protocol/mcp-client setup --warp
272
272
  ```
273
273
 
274
- **Manual config:** Go to `Warp Drive` → `MCP Servers` → `+ Add`, then paste:
274
+ **Manual config:** Add via Warp Drive → MCP Servers → `+ Add`:
275
275
 
276
276
  ```json
277
277
  {
@@ -312,7 +312,7 @@ Add to `~/.kiro/settings/mcp.json` (global) or `.kiro/settings/mcp.json` (worksp
312
312
  <details>
313
313
  <summary><strong>Roo Code</strong></summary>
314
314
 
315
- Open Roo Code settings → `Edit Global MCP`. Or add to `.roo/mcp.json` (project):
315
+ Add to `.roo/mcp.json` (project) or open Roo Code settings → Edit Global MCP:
316
316
 
317
317
  ```json
318
318
  {
@@ -332,7 +332,7 @@ Open Roo Code settings → `Edit Global MCP`. Or add to `.roo/mcp.json` (project
332
332
  <details>
333
333
  <summary><strong>Cline</strong></summary>
334
334
 
335
- Open Cline panel → MCP Servers → `Configure MCP Servers` to edit `cline_mcp_settings.json`:
335
+ Add to `cline_mcp_settings.json` (open via Cline panel → MCP Servers → Configure MCP Servers):
336
336
 
337
337
  ```json
338
338
  {
@@ -352,7 +352,7 @@ Open Cline panel → MCP Servers → `Configure MCP Servers` to edit `cline_mcp_
352
352
  <details>
353
353
  <summary><strong>Trae</strong></summary>
354
354
 
355
- Trae → Settings → MCP → `Add MCP Server`:
355
+ Add via Trae → Settings → MCP → Add MCP Server:
356
356
 
357
357
  ```json
358
358
  {
@@ -372,7 +372,7 @@ Trae → Settings → MCP → `Add MCP Server`:
372
372
  <details>
373
373
  <summary><strong>Augment Code</strong></summary>
374
374
 
375
- Hamburger menu → Settings → Tools → `+ Add MCP` → Command: `npx -y @crush-protocol/mcp-client`
375
+ Add via Settings → Tools → `+ Add MCP` → Command: `npx -y @crush-protocol/mcp-client`
376
376
 
377
377
  ```json
378
378
  "augment.advanced": {
@@ -487,7 +487,7 @@ Add to `~/.config/zed/settings.json`:
487
487
  <details>
488
488
  <summary><strong>JetBrains AI Assistant</strong></summary>
489
489
 
490
- Settings → Tools → AI Assistant → Model Context Protocol (MCP) → `+ Add`
490
+ Add via Settings → Tools → AI Assistant → Model Context Protocol (MCP) → `+ Add`:
491
491
 
492
492
  ```json
493
493
  {
@@ -527,7 +527,7 @@ Settings → Tools → AI Assistant → Model Context Protocol (MCP) → `+ Add`
527
527
  <details>
528
528
  <summary><strong>LM Studio</strong></summary>
529
529
 
530
- Program → Install → Edit `mcp.json`:
530
+ Add to `mcp.json` (open via Program → Install → Edit mcp.json):
531
531
 
532
532
  ```json
533
533
  {
@@ -588,7 +588,7 @@ Add to `.mcp/mcp.json` in your solution directory:
588
588
  <details>
589
589
  <summary><strong>Perplexity Desktop</strong></summary>
590
590
 
591
- Perplexity → Settings → Connectors → Add Connector → Advanced → Server Name: `crush-protocol`
591
+ Add via Perplexity → Settings → Connectors → Add Connector → Advanced. Server Name: `crush-protocol`
592
592
 
593
593
  ```json
594
594
  {
@@ -623,7 +623,7 @@ Perplexity → Settings → Connectors → Add Connector → Advanced → Server
623
623
  <details>
624
624
  <summary><strong>Zencoder</strong></summary>
625
625
 
626
- Zencoder menu → Agent tools → Add custom MCP:
626
+ Add via Zencoder menu → Agent tools → Add custom MCP:
627
627
 
628
628
  ```json
629
629
  {
package/dist/mcp/proxy.js CHANGED
@@ -13,35 +13,26 @@
13
13
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
14
14
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
15
15
  import { CallToolRequestSchema, ListToolsRequestSchema, PingRequestSchema } from "@modelcontextprotocol/sdk/types.js";
16
- import { getPreflightStatusMessage } from "./authPreflight.js";
17
16
  import { OAuthRemoteMcpClient } from "./oauthRemoteClient.js";
18
17
  import { getCachedAuthStatus } from "./oauthStorage.js";
19
18
  import { CLIENT_NAME, CLIENT_VERSION } from "./version.js";
20
19
  export async function runProxy(serverUrl) {
21
- const authStatus = await getCachedAuthStatus(serverUrl);
22
- if (authStatus.status === "not_authenticated") {
23
- const message = getPreflightStatusMessage({
24
- authStatus,
25
- requiresManualLogin: true,
26
- canAutoRefreshLogin: false,
27
- });
28
- process.stderr.write(`${message ?? "Crush needs sign-in on this machine."}\n`);
29
- process.exit(1);
30
- }
31
- const preflightMessage = getPreflightStatusMessage({
32
- authStatus,
33
- requiresManualLogin: false,
34
- canAutoRefreshLogin: true,
35
- });
36
- if (preflightMessage) {
37
- process.stderr.write(`${preflightMessage}\n\n`);
38
- }
39
20
  const remoteClient = new OAuthRemoteMcpClient({
40
21
  serverUrl,
41
22
  oauth: {
42
23
  authorizationOutput: "stderr",
43
24
  },
44
25
  });
26
+ const authStatus = await getCachedAuthStatus(serverUrl);
27
+ if (authStatus.status === "not_authenticated") {
28
+ process.stderr.write("[crush] Sign-in required. Opening browser...\n");
29
+ process.stderr.write("[crush] If the browser does not open, use the URL printed below.\n");
30
+ await remoteClient.ensureAuthorized();
31
+ process.stderr.write("[crush] Sign-in complete.\n\n");
32
+ }
33
+ else if (authStatus.status === "registered") {
34
+ process.stderr.write("[crush] Refreshing credentials...\n");
35
+ }
45
36
  await remoteClient.connect();
46
37
  const remoteTools = await remoteClient.listTools();
47
38
  const localServer = new Server({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crush-protocol/mcp-client",
3
- "version": "0.4.18",
3
+ "version": "0.4.20",
4
4
  "description": "Official Crush MCP client for hosted market data, backtests, and trading workflows",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "@modelcontextprotocol/sdk": "^1.26.0",
48
48
  "dotenv": "^17.2.1",
49
49
  "zod": "^3.25.76",
50
- "@crush-protocol/mcp-contracts": "0.1.2"
50
+ "@crush-protocol/mcp-contracts": "0.1.3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^24.3.0",