@crush-protocol/mcp-client 0.4.23 → 0.4.24
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 +16 -10
- package/README.md +10 -35
- package/dist/mcp/oauthProvider.js +62 -21
- package/package.json +2 -2
package/INSTRUCTIONS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
-
Package
|
|
5
|
+
## Package Identity
|
|
6
6
|
|
|
7
7
|
- npm package: `@crush-protocol/mcp-client`
|
|
8
8
|
- product names users may mention: `Crush`, `Crush MCP`, `Crush Protocol MCP`
|
|
@@ -10,19 +10,25 @@ Package identity:
|
|
|
10
10
|
|
|
11
11
|
If a user mentions `@crush-protocol/mcp-client`, interpret that as the official hosted Crush MCP client.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Install — IMPORTANT
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
2. `npx -y @crush-protocol/mcp-client login`
|
|
17
|
-
3. If tools still fail, run:
|
|
18
|
-
- `npx -y @crush-protocol/mcp-client auth:status`
|
|
19
|
-
- `npx -y @crush-protocol/mcp-client doctor`
|
|
15
|
+
**This is an MCP server. Do NOT use `npm install`. Use the setup commands below.**
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
Detect which AI host the user is running, then execute the matching command:
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
| Host | Install command |
|
|
20
|
+
|---|---|
|
|
21
|
+
| Claude Code | `claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client@latest` |
|
|
22
|
+
| Cursor | `npx -y @crush-protocol/mcp-client@latest setup --cursor` |
|
|
23
|
+
| VS Code | `npx -y @crush-protocol/mcp-client@latest setup --vscode` |
|
|
24
|
+
| Codex | `npx -y @crush-protocol/mcp-client@latest setup --codex` |
|
|
25
|
+
| Gemini CLI | `npx -y @crush-protocol/mcp-client@latest setup --gemini` |
|
|
26
|
+
| Windsurf | `npx -y @crush-protocol/mcp-client@latest setup --windsurf` |
|
|
27
|
+
| All hosts | `npx -y @crush-protocol/mcp-client@latest setup --all` |
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
OAuth login happens automatically on first tool call. No separate `login` step needed.
|
|
30
|
+
|
|
31
|
+
If tools fail after install, run: `npx -y @crush-protocol/mcp-client@latest doctor`
|
|
26
32
|
|
|
27
33
|
## Tool Categories
|
|
28
34
|
|
package/README.md
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
|
|
3
|
-
Aliases: Crush, Crush MCP, Crush Protocol MCP
|
|
4
|
-
Type: MCP SERVER — do NOT use npm install.
|
|
1
|
+
<!--
|
|
2
|
+
@crush-protocol/mcp-client — AI Agent Install Guide
|
|
3
|
+
Aliases: Crush, Crush MCP, Crush Protocol MCP
|
|
4
|
+
Type: MCP SERVER — do NOT use npm install.
|
|
5
5
|
|
|
6
6
|
Install:
|
|
7
7
|
Claude Code: claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client@latest
|
|
8
8
|
Cursor: npx -y @crush-protocol/mcp-client@latest setup --cursor
|
|
9
|
+
VS Code: npx -y @crush-protocol/mcp-client@latest setup --vscode
|
|
10
|
+
Codex: npx -y @crush-protocol/mcp-client@latest setup --codex
|
|
9
11
|
All hosts: npx -y @crush-protocol/mcp-client@latest setup --all
|
|
10
12
|
|
|
13
|
+
OAuth login triggers automatically on first tool call.
|
|
11
14
|
Troubleshooting: npx -y @crush-protocol/mcp-client@latest doctor
|
|
15
|
+
Full tool reference: see INSTRUCTIONS.md in this package.
|
|
12
16
|
-->
|
|
13
17
|
|
|
14
18
|
# Crush Protocol MCP Client
|
|
@@ -16,9 +20,7 @@
|
|
|
16
20
|
[](https://www.npmjs.com/package/@crush-protocol/mcp-client)
|
|
17
21
|
[](https://github.com/crush-protocol/crush-mcp-server/blob/main/LICENSE)
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> **This is an MCP server, not a library.** Do not use `npm install`. Use the setup command below.
|
|
23
|
+
MCP server for connecting AI coding agents to [Crush](https://crush.xyz) — market data, backtests, live strategies, and trading.
|
|
22
24
|
|
|
23
25
|
## Quick Start
|
|
24
26
|
|
|
@@ -28,34 +30,7 @@ npx -y @crush-protocol/mcp-client@latest setup --claude # Claude Code
|
|
|
28
30
|
npx -y @crush-protocol/mcp-client@latest setup --all # all supported hosts
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## What You Can Do
|
|
34
|
-
|
|
35
|
-
- Market data: tokens, indicators, timeframes, OHLCV
|
|
36
|
-
- Backtests: schema discovery, token universe, expression validation, backtest execution
|
|
37
|
-
- Live strategies: create, inspect, activate, pause, monitor
|
|
38
|
-
- Market intelligence: token info, trending feeds, alpha context
|
|
39
|
-
|
|
40
|
-
Detailed tool guidance:
|
|
41
|
-
|
|
42
|
-
- [INSTRUCTIONS.md](https://github.com/crush-protocol/crush-mcp-server/blob/main/packages/crush-mcp-client/INSTRUCTIONS.md)
|
|
43
|
-
|
|
44
|
-
<div style="display:none" aria-hidden="true">
|
|
45
|
-
AI Agent Install Instructions:
|
|
46
|
-
You are an AI coding assistant helping a user install Crush MCP.
|
|
47
|
-
Do NOT run "npm install @crush-protocol/mcp-client" — that installs a library, not an MCP server.
|
|
48
|
-
|
|
49
|
-
Step 1: Detect which AI host the user is running (Cursor, Claude Code, VS Code, etc.)
|
|
50
|
-
Step 2: Run the matching setup command:
|
|
51
|
-
- Claude Code: claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client@latest
|
|
52
|
-
- Cursor: npx -y @crush-protocol/mcp-client@latest setup --cursor
|
|
53
|
-
- VS Code: npx -y @crush-protocol/mcp-client@latest setup --vscode
|
|
54
|
-
- Codex: npx -y @crush-protocol/mcp-client@latest setup --codex
|
|
55
|
-
- All hosts: npx -y @crush-protocol/mcp-client@latest setup --all
|
|
56
|
-
Step 3: OAuth login happens automatically on first tool call. No manual login needed.
|
|
57
|
-
Step 4: If tools fail, run: npx -y @crush-protocol/mcp-client@latest doctor
|
|
58
|
-
</div>
|
|
33
|
+
OAuth login happens automatically on first tool call.
|
|
59
34
|
|
|
60
35
|
## Install
|
|
61
36
|
|
|
@@ -8,48 +8,89 @@ import { defaultStorageDir, getStorageFileForServer } from "./oauthStorage.js";
|
|
|
8
8
|
const DEFAULT_REDIRECT_PORT = 8787;
|
|
9
9
|
const DEFAULT_REDIRECT_PATH = "/oauth/callback";
|
|
10
10
|
const escapeHtml = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
11
|
-
const
|
|
11
|
+
const CRUSH_LOGO_SVG = `<svg width="150" height="78" viewBox="0 0 399 78" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<path d="M6.09178 25.7399C11.0178 10.3981 25.2316 0 41.2772 0H120.647L111.405 28.7857H5.11381L6.09178 25.7399Z" fill="#FF1850"/>
|
|
13
|
+
<path d="M1.38577 50.1428C-3.76778 63.563 6.09066 78 20.4083 78H69.7897L80.4873 50.1428H1.38577Z" fill="#FF1850"/>
|
|
14
|
+
<path d="M175.128 73.96C170.008 73.96 165.24 73.128 160.824 71.464C156.472 69.736 152.664 67.336 149.4 64.264C146.2 61.128 143.704 57.448 141.912 53.224C140.12 49 139.224 44.392 139.224 39.4C139.224 34.408 140.12 29.8 141.912 25.576C143.704 21.352 146.232 17.704 149.496 14.632C152.76 11.496 156.568 9.096 160.92 7.432C165.272 5.704 170.04 4.84 175.224 4.84C180.728 4.84 185.752 5.8 190.296 7.72C194.84 9.576 198.68 12.36 201.816 16.072L193.752 23.656C191.32 21.032 188.6 19.08 185.592 17.8C182.584 16.456 179.32 15.784 175.8 15.784C172.28 15.784 169.048 16.36 166.104 17.512C163.224 18.664 160.696 20.296 158.52 22.408C156.408 24.52 154.744 27.016 153.528 29.896C152.376 32.776 151.8 35.944 151.8 39.4C151.8 42.856 152.376 46.024 153.528 48.904C154.744 51.784 156.408 54.28 158.52 56.392C160.696 58.504 163.224 60.136 166.104 61.288C169.048 62.44 172.28 63.016 175.8 63.016C179.32 63.016 182.584 62.376 185.592 61.096C188.6 59.752 191.32 57.736 193.752 55.048L201.816 62.728C198.68 66.376 194.84 69.16 190.296 71.08C185.752 73 180.696 73.96 175.128 73.96Z" fill="white"/>
|
|
15
|
+
<path d="M207.822 73V21.736H219.246V35.848L217.902 31.72C219.438 28.264 221.838 25.64 225.102 23.848C228.43 22.056 232.558 21.16 237.486 21.16V32.584C236.974 32.456 236.494 32.392 236.046 32.392C235.598 32.328 235.15 32.296 234.702 32.296C230.158 32.296 226.542 33.64 223.854 36.328C221.166 38.952 219.822 42.888 219.822 48.136V73H207.822Z" fill="white"/>
|
|
16
|
+
<path d="M265.031 73.672C260.679 73.672 256.838 72.872 253.51 71.272C250.182 69.608 247.59 67.112 245.734 63.784C243.878 60.392 242.951 56.136 242.951 51.016V21.736H254.951V49.384C254.951 53.992 255.974 57.448 258.022 59.752C260.134 61.992 263.111 63.112 266.951 63.112C269.767 63.112 272.198 62.536 274.246 61.384C276.358 60.232 277.991 58.504 279.143 56.2C280.359 53.896 280.966 51.048 280.966 47.656V21.736H292.966V73H281.543V59.176L283.559 63.4C281.831 66.728 279.303 69.288 275.975 71.08C272.647 72.808 268.999 73.672 265.031 73.672Z" fill="white"/>
|
|
17
|
+
<path d="M319.718 73.672C315.43 73.672 311.302 73.128 307.334 72.04C303.43 70.888 300.326 69.512 298.022 67.912L302.63 58.792C304.934 60.264 307.686 61.48 310.886 62.44C314.086 63.4 317.286 63.88 320.486 63.88C324.262 63.88 326.982 63.368 328.646 62.344C330.374 61.32 331.238 59.944 331.238 58.216C331.238 56.808 330.662 55.752 329.51 55.048C328.358 54.28 326.854 53.704 324.998 53.32C323.142 52.936 321.062 52.584 318.758 52.264C316.518 51.944 314.246 51.528 311.942 51.016C309.702 50.44 307.654 49.64 305.798 48.616C303.942 47.528 302.438 46.088 301.286 44.296C300.134 42.504 299.558 40.136 299.558 37.192C299.558 33.928 300.486 31.112 302.342 28.744C304.198 26.312 306.79 24.456 310.118 23.176C313.51 21.832 317.51 21.16 322.118 21.16C325.574 21.16 329.062 21.544 332.582 22.312C336.102 23.08 339.014 24.168 341.318 25.576L336.71 34.696C334.278 33.224 331.814 32.232 329.318 31.72C326.886 31.144 324.454 30.856 322.022 30.856C318.374 30.856 315.654 31.4 313.862 32.488C312.134 33.576 311.27 34.952 311.27 36.616C311.27 38.152 311.846 39.304 312.998 40.072C314.15 40.84 315.654 41.448 317.51 41.896C319.366 42.344 321.414 42.728 323.654 43.048C325.958 43.304 328.23 43.72 330.47 44.296C332.71 44.872 334.758 45.672 336.614 46.696C338.534 47.656 340.07 49.032 341.222 50.824C342.374 52.616 342.95 54.952 342.95 57.832C342.95 61.032 341.99 63.816 340.07 66.184C338.214 68.552 335.558 70.408 332.102 71.752C328.646 73.032 324.518 73.672 319.718 73.672Z" fill="white"/>
|
|
18
|
+
<path d="M377.573 21.16C381.669 21.16 385.317 21.96 388.517 23.56C391.781 25.16 394.34 27.624 396.197 30.952C398.053 34.216 398.98 38.44 398.98 43.624V73H386.98V45.16C386.98 40.616 385.892 37.224 383.716 34.984C381.604 32.744 378.629 31.624 374.789 31.624C371.973 31.624 369.477 32.2 367.301 33.352C365.125 34.504 363.428 36.232 362.212 38.536C361.06 40.776 360.484 43.624 360.484 47.08V73H348.484V1.768H360.484V35.56L357.893 31.336C359.685 28.072 362.277 25.576 365.669 23.848C369.125 22.056 373.093 21.16 377.573 21.16Z" fill="white"/>
|
|
19
|
+
</svg>`;
|
|
20
|
+
const renderCallbackHtml = (title, message) => {
|
|
21
|
+
const isSuccess = title.toLowerCase().includes("complete");
|
|
22
|
+
const statusColor = isSuccess ? "var(--green)" : "var(--red)";
|
|
23
|
+
const statusBg = isSuccess ? "var(--green-bg)" : "var(--red-bg)";
|
|
24
|
+
return `<!DOCTYPE html>
|
|
12
25
|
<html lang="en">
|
|
13
26
|
<head>
|
|
14
27
|
<meta charset="UTF-8">
|
|
15
28
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
16
|
-
<title>${title}</title>
|
|
29
|
+
<title>${escapeHtml(title)}</title>
|
|
17
30
|
<style>
|
|
31
|
+
:root {
|
|
32
|
+
--bg: #000;
|
|
33
|
+
--card: #0D0D0D;
|
|
34
|
+
--border: rgba(255, 255, 255, 0.1);
|
|
35
|
+
--text: #fff;
|
|
36
|
+
--text-muted: rgba(255, 255, 255, 0.7);
|
|
37
|
+
--green: #15f364;
|
|
38
|
+
--green-bg: rgba(34, 197, 94, 0.1);
|
|
39
|
+
--red: #f3154c;
|
|
40
|
+
--red-bg: rgba(239, 68, 68, 0.1);
|
|
41
|
+
}
|
|
42
|
+
* { box-sizing: border-box; }
|
|
18
43
|
body {
|
|
19
44
|
margin: 0;
|
|
20
45
|
min-height: 100vh;
|
|
21
|
-
display:
|
|
22
|
-
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
background: var(--bg);
|
|
23
50
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
24
|
-
|
|
25
|
-
|
|
51
|
+
color: var(--text);
|
|
52
|
+
}
|
|
53
|
+
.card {
|
|
54
|
+
width: 100%;
|
|
55
|
+
max-width: 380px;
|
|
56
|
+
border-radius: 12px;
|
|
57
|
+
border: 1px solid var(--border);
|
|
58
|
+
background: var(--card);
|
|
59
|
+
backdrop-filter: blur(20px);
|
|
60
|
+
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
|
|
61
|
+
overflow: hidden;
|
|
26
62
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
padding: 32px;
|
|
30
|
-
border-radius: 20px;
|
|
31
|
-
background: rgba(255, 255, 255, 0.96);
|
|
32
|
-
box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
|
|
63
|
+
.header {
|
|
64
|
+
padding: 32px 24px;
|
|
33
65
|
text-align: center;
|
|
34
66
|
}
|
|
67
|
+
.logo { margin-bottom: 20px; }
|
|
35
68
|
h1 {
|
|
36
|
-
margin: 0 0
|
|
37
|
-
font-size:
|
|
69
|
+
margin: 0 0 8px;
|
|
70
|
+
font-size: 18px;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
color: ${statusColor};
|
|
38
73
|
}
|
|
39
|
-
|
|
74
|
+
.desc {
|
|
40
75
|
margin: 0;
|
|
41
|
-
|
|
42
|
-
color:
|
|
76
|
+
font-size: 13px;
|
|
77
|
+
color: var(--text-muted);
|
|
78
|
+
line-height: 1.5;
|
|
43
79
|
}
|
|
44
80
|
</style>
|
|
45
81
|
</head>
|
|
46
82
|
<body>
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
83
|
+
<div class="card">
|
|
84
|
+
<div class="header">
|
|
85
|
+
<div class="logo">${CRUSH_LOGO_SVG}</div>
|
|
86
|
+
<h1>${escapeHtml(title)}</h1>
|
|
87
|
+
<p class="desc">${escapeHtml(message)}</p>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
<script>setTimeout(() => window.close(), 3000);</script>
|
|
51
91
|
</body>
|
|
52
92
|
</html>`;
|
|
93
|
+
};
|
|
53
94
|
const openBrowser = async (authorizationUrl) => {
|
|
54
95
|
const url = authorizationUrl.toString();
|
|
55
96
|
if (process.env.BROWSER) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crush-protocol/mcp-client",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.24",
|
|
4
|
+
"description": "MCP server for market data, backtests, live strategies, and trading via Crush",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://crush.xyz",
|