@crush-protocol/mcp-client 0.1.8 ā 0.1.10
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 +127 -0
- package/README.md +11 -8
- package/package.json +3 -2
package/INSTRUCTIONS.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Crush Protocol MCP ā AI Instructions
|
|
2
|
+
|
|
3
|
+
You have access to **Crush Protocol MCP**, an AI-native quantitative trading platform. Use these tools to help users research markets, build strategies, run backtests, and manage live trading.
|
|
4
|
+
|
|
5
|
+
## Tool Categories
|
|
6
|
+
|
|
7
|
+
### š Signal Discovery
|
|
8
|
+
|
|
9
|
+
| Tool | Purpose |
|
|
10
|
+
| ------------------------- | -------------------------------------------------------------------------------------- |
|
|
11
|
+
| `get_signal_metadata` | Get all categories, operators, timeframes, and expression limits. **Call this first.** |
|
|
12
|
+
| `get_signals_by_category` | Get signals in a category with their params, operators, and operand types. |
|
|
13
|
+
|
|
14
|
+
### š Backtest
|
|
15
|
+
|
|
16
|
+
| Tool | Purpose |
|
|
17
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
18
|
+
| `get_backtest_config_schema` | Get supported platforms, timeframes, directions, exit strategy types. |
|
|
19
|
+
| `get_available_tokens` | List tradable tokens, optionally filter by platform. |
|
|
20
|
+
| `validate_expression` | Validate and compile an AST expression before using it in a backtest. |
|
|
21
|
+
| `create_backtest` | Submit a backtest. Returns immediately with status `PENDING`. |
|
|
22
|
+
| `get_backtest_result` | Poll a backtest by ID. Returns status, summary, portfolio history, and trades. |
|
|
23
|
+
| `list_backtests` | List user's backtests with optional status filter (`PENDING`, `RUNNING`, `COMPLETED`, `FAILED`). |
|
|
24
|
+
|
|
25
|
+
### š Market Data (ClickHouse)
|
|
26
|
+
|
|
27
|
+
| Tool | Purpose |
|
|
28
|
+
| ----------------------- | ---------------------------------------------------------------------------- |
|
|
29
|
+
| `list_tables` | List all ClickHouse tables with descriptions. |
|
|
30
|
+
| `list_tokens` | List available trading pairs in the data warehouse. |
|
|
31
|
+
| `list_indicators` | List pre-computed indicators with categories. |
|
|
32
|
+
| `list_timeframes` | List available data timeframes. |
|
|
33
|
+
| `get_data_range` | Get earliest/latest date for a token + timeframe. |
|
|
34
|
+
| `check_query_size` | Estimate row count before fetching. **Call this before large queries.** |
|
|
35
|
+
| `fetch_ohlcv` | Fetch OHLCV candlestick data (row cap: 5000). |
|
|
36
|
+
| `fetch_indicator` | Fetch pre-computed indicator values (row cap: 5000). |
|
|
37
|
+
| `get_connection_config` | Get read-only ClickHouse credentials for local processing of large datasets. |
|
|
38
|
+
|
|
39
|
+
### š§® Custom Indicators
|
|
40
|
+
|
|
41
|
+
| Tool | Purpose |
|
|
42
|
+
| ------------------------- | ------------------------------------- |
|
|
43
|
+
| `save_custom_indicator` | Save a custom indicator formula. |
|
|
44
|
+
| `list_custom_indicators` | List user's saved indicator formulas. |
|
|
45
|
+
| `get_custom_indicator` | Retrieve a formula by name. |
|
|
46
|
+
| `delete_custom_indicator` | Delete a formula by name. |
|
|
47
|
+
|
|
48
|
+
### āļø Strategy Management
|
|
49
|
+
|
|
50
|
+
| Tool | Purpose |
|
|
51
|
+
| ------------------- | ------------------------------------------------- |
|
|
52
|
+
| `create_strategy` | Create a live strategy from a completed backtest. |
|
|
53
|
+
| `list_strategies` | List user's strategies with pagination. |
|
|
54
|
+
| `get_strategy` | Get strategy details with backtest performance. |
|
|
55
|
+
| `update_strategy` | Update strategy name, description, or note. |
|
|
56
|
+
| `delete_strategy` | Delete a strategy (must be deactivated first). |
|
|
57
|
+
| `toggle_strategy` | Activate or deactivate live trading. |
|
|
58
|
+
| `get_strategy_logs` | Get execution logs for a strategy. |
|
|
59
|
+
|
|
60
|
+
### š° Trading (Hyperliquid)
|
|
61
|
+
|
|
62
|
+
| Tool | Purpose |
|
|
63
|
+
| ------------------ | -------------------------------------------------------- |
|
|
64
|
+
| `place_order` | Place a market or limit order on Hyperliquid perpetuals. |
|
|
65
|
+
| `get_positions` | Get current open positions. |
|
|
66
|
+
| `get_account_info` | Get account balance, margin, and PnL. |
|
|
67
|
+
| `get_portfolio` | Get all balances across chains. |
|
|
68
|
+
|
|
69
|
+
### š Market Intelligence
|
|
70
|
+
|
|
71
|
+
| Tool | Purpose |
|
|
72
|
+
| --------------------- | ------------------------------------------------------ |
|
|
73
|
+
| `search_tokens` | Search tokens by name, symbol, or address. |
|
|
74
|
+
| `get_token_info` | Get token metadata, price, and market cap. |
|
|
75
|
+
| `get_trending_tokens` | Get trending tokens on a given chain. |
|
|
76
|
+
| `get_alpha_feed` | Get recent alpha posts from Twitter and communities. |
|
|
77
|
+
| `get_token_feed` | Get token-specific news and events. |
|
|
78
|
+
| `fetch_news` | Fetch news and intel feeds with keyword/token filters. |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Workflows
|
|
83
|
+
|
|
84
|
+
### Strategy Backtest (Most Common)
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
1. get_signal_metadata ā Understand available signals and operators
|
|
88
|
+
2. get_signals_by_category ā Explore signals in relevant categories (price, technicalIndicator, etc.)
|
|
89
|
+
3. get_backtest_config_schema ā Get platform/timeframe/exit options
|
|
90
|
+
4. get_available_tokens ā Find the token to trade
|
|
91
|
+
5. validate_expression ā Validate the entry/exit expression AST
|
|
92
|
+
6. create_backtest ā Submit the backtest (returns backtestId)
|
|
93
|
+
7. get_backtest_result ā Poll until status is COMPLETED or FAILED
|
|
94
|
+
āā If COMPLETED: present summary (totalReturn, sharpeRatio, maxDrawdown, winRate, tradeCount)
|
|
95
|
+
āā If FAILED: show error, suggest fixes, iterate
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Market Research
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
1. list_tokens / search_tokens ā Find tokens of interest
|
|
102
|
+
2. get_data_range ā Check data availability
|
|
103
|
+
3. check_query_size ā Estimate dataset size
|
|
104
|
+
4. fetch_ohlcv / fetch_indicator ā Fetch data (ā¤5000 rows)
|
|
105
|
+
āā If too large: get_connection_config ā write Python script for local processing
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Go Live
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
1. list_backtests (status=COMPLETED) ā Find a profitable backtest
|
|
112
|
+
2. create_strategy ā Create live strategy from backtest
|
|
113
|
+
3. toggle_strategy (isActive=true) ā Activate live trading
|
|
114
|
+
4. get_strategy_logs ā Monitor execution
|
|
115
|
+
5. get_positions / get_account_info ā Check trading status
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Important Rules
|
|
121
|
+
|
|
122
|
+
1. **Backtest is async**: `create_backtest` returns immediately. You MUST poll `get_backtest_result` until status is `COMPLETED` or `FAILED`. Typical wait: 30sā3min.
|
|
123
|
+
2. **Data row caps**: `fetch_ohlcv` and `fetch_indicator` have a 5000 row limit. For larger datasets, use `get_connection_config` and process locally.
|
|
124
|
+
3. **Always validate first**: Call `validate_expression` before using an expression in `create_backtest` to catch errors early.
|
|
125
|
+
4. **Signal discovery order**: Always call `get_signal_metadata` ā `get_signals_by_category` before building expressions. Don't guess signal IDs.
|
|
126
|
+
5. **Strategy lifecycle**: Backtest ā Create Strategy ā Toggle Active. A strategy must be deactivated before deletion.
|
|
127
|
+
6. **Trading is real**: `place_order` executes real trades on Hyperliquid. Always confirm with the user before placing orders.
|
package/README.md
CHANGED
|
@@ -93,14 +93,17 @@ Add to `~/.cursor/mcp.json`:
|
|
|
93
93
|
|
|
94
94
|
## Available Tools
|
|
95
95
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
| `
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
96
|
+
| Category | Tools |
|
|
97
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
98
|
+
| **Signal Discovery** | `get_signal_metadata`, `get_signals_by_category` |
|
|
99
|
+
| **Backtest** | `get_backtest_config_schema`, `get_available_tokens`, `validate_expression`, `create_backtest`, `get_backtest_result`, `list_backtests` |
|
|
100
|
+
| **Market Data** | `list_tables`, `list_tokens`, `list_indicators`, `list_timeframes`, `get_data_range`, `check_query_size`, `fetch_ohlcv`, `fetch_indicator`, `get_connection_config` |
|
|
101
|
+
| **Custom Indicators** | `save_custom_indicator`, `list_custom_indicators`, `get_custom_indicator`, `delete_custom_indicator` |
|
|
102
|
+
| **Strategy Management** | `create_strategy`, `list_strategies`, `get_strategy`, `update_strategy`, `delete_strategy`, `toggle_strategy`, `get_strategy_logs` |
|
|
103
|
+
| **Trading** | `place_order`, `get_positions`, `get_account_info`, `get_portfolio` |
|
|
104
|
+
| **Market Intelligence** | `search_tokens`, `get_token_info`, `get_trending_tokens`, `get_alpha_feed`, `get_token_feed`, `fetch_news` |
|
|
105
|
+
|
|
106
|
+
> š See [INSTRUCTIONS.md](./INSTRUCTIONS.md) for detailed tool descriptions, workflows, and AI system prompt template.
|
|
104
107
|
|
|
105
108
|
---
|
|
106
109
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crush-protocol/mcp-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Crush MCP npm client package (remote Streamable HTTP + optional ClickHouse direct)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"crush-mcp-client": "dist/cli.js"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"dist"
|
|
13
|
+
"dist",
|
|
14
|
+
"INSTRUCTIONS.md"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|