tradeblocks-mcp 0.3.0 → 0.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 +47 -20
- package/dist/test-exports.js +12 -5
- package/dist/test-exports.js.map +1 -1
- package/manifest.json +12 -4
- package/package.json +6 -2
- package/server/chunk-4R6HHOMZ.js +446 -0
- package/server/chunk-4R6HHOMZ.js.map +1 -0
- package/server/{chunk-YERGAQP6.js → chunk-5IDEDNE3.js} +2 -2
- package/server/chunk-JCL22FXE.js +1536 -0
- package/server/chunk-JCL22FXE.js.map +1 -0
- package/server/{chunk-GLIFLIXX.js → chunk-RROWW55T.js} +2 -2
- package/server/{chunk-D4HDZEJT.js → chunk-SEGVTWSK.js} +9 -2
- package/server/{chunk-IP3Y3EPC.js → chunk-WPCACQSP.js} +3 -441
- package/server/chunk-WPCACQSP.js.map +1 -0
- package/server/daily-log-processor-4WDKMV5C.js +11 -0
- package/server/{daily-logs-store-ZMZBWHTZ.js → daily-logs-store-J2TKMNZA.js} +2 -2
- package/server/http-server.js +27 -0
- package/server/index.js +351 -1745
- package/server/index.js.map +1 -1
- package/server/trade-processor-XW6TUD7B.js +11 -0
- package/server/{trades-store-ARY6ZUXD.js → trades-store-ENKBF2Q2.js} +2 -2
- package/server/chunk-IP3Y3EPC.js.map +0 -1
- package/server/daily-log-processor-QTBQZLSC.js +0 -10
- package/server/trade-processor-E74L2VK4.js +0 -10
- /package/server/{chunk-YERGAQP6.js.map → chunk-5IDEDNE3.js.map} +0 -0
- /package/server/{chunk-GLIFLIXX.js.map → chunk-RROWW55T.js.map} +0 -0
- /package/server/{chunk-D4HDZEJT.js.map → chunk-SEGVTWSK.js.map} +0 -0
- /package/server/{daily-log-processor-QTBQZLSC.js.map → daily-log-processor-4WDKMV5C.js.map} +0 -0
- /package/server/{daily-logs-store-ZMZBWHTZ.js.map → daily-logs-store-J2TKMNZA.js.map} +0 -0
- /package/server/{trade-processor-E74L2VK4.js.map → trade-processor-XW6TUD7B.js.map} +0 -0
- /package/server/{trades-store-ARY6ZUXD.js.map → trades-store-ENKBF2Q2.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# TradeBlocks MCP Server
|
|
2
2
|
|
|
3
|
-
Model Context Protocol (MCP) server for options trading analysis.
|
|
3
|
+
Model Context Protocol (MCP) server for options trading analysis. Works with Claude Desktop, Claude Code, Codex CLI, Gemini CLI, ChatGPT, Google AI Studio, and any MCP-compatible client.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
7
|
+
- **21 MCP tools** for comprehensive trading analysis
|
|
8
|
+
- **Two transport modes**: stdio (CLI tools) and HTTP (web platforms)
|
|
8
9
|
- **Block-based data organization** - each folder is a trading strategy
|
|
9
|
-
- **Automatic caching** - statistics cached in
|
|
10
|
+
- **Automatic caching** - statistics cached in `block.json` for fast access
|
|
10
11
|
- **Flexible CSV detection** - auto-detects file types by column headers
|
|
11
|
-
- **Cross-platform** - works with Claude, Codex CLI, Gemini CLI, and any MCP client
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
@@ -18,27 +18,20 @@ Download the latest `.mcpb` file from [GitHub Releases](https://github.com/david
|
|
|
18
18
|
|
|
19
19
|
The installer will prompt you to select your Trading Data Directory.
|
|
20
20
|
|
|
21
|
-
### Option 2: npx (
|
|
21
|
+
### Option 2: npx (All Platforms)
|
|
22
22
|
|
|
23
23
|
Run directly without installation:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
+
# stdio mode (Claude Desktop, Claude Code, Codex CLI, Gemini CLI)
|
|
26
27
|
npx tradeblocks-mcp ~/Trading/backtests
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
For Claude Desktop, add to your config file:
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"mcpServers": {
|
|
34
|
-
"tradeblocks": {
|
|
35
|
-
"command": "npx",
|
|
36
|
-
"args": ["tradeblocks-mcp", "/path/to/your/backtests"]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
29
|
+
# HTTP mode (ChatGPT, Google AI Studio, Julius AI)
|
|
30
|
+
npx tradeblocks-mcp --http ~/Trading/backtests
|
|
40
31
|
```
|
|
41
32
|
|
|
33
|
+
See [Configuration by Platform](#configuration-by-platform) below for platform-specific setup.
|
|
34
|
+
|
|
42
35
|
### Option 3: From Source
|
|
43
36
|
|
|
44
37
|
```bash
|
|
@@ -54,8 +47,8 @@ node packages/mcp-server/server/index.js ~/Trading/backtests
|
|
|
54
47
|
## Quick Start
|
|
55
48
|
|
|
56
49
|
1. **Set up your data** - Create folders for each strategy with CSV files
|
|
57
|
-
2. **Connect
|
|
58
|
-
3. **Start analyzing** - Ask
|
|
50
|
+
2. **Connect your AI platform** - See [Configuration by Platform](#configuration-by-platform) below
|
|
51
|
+
3. **Start analyzing** - Ask your AI to "list my backtests" or "run a health check on iron-condor"
|
|
59
52
|
|
|
60
53
|
For detailed usage examples, see [docs/USAGE.md](docs/USAGE.md).
|
|
61
54
|
|
|
@@ -126,6 +119,40 @@ Add to `~/.gemini/settings.json`:
|
|
|
126
119
|
|
|
127
120
|
See [Gemini CLI MCP documentation](https://geminicli.com/docs/tools/mcp-server/) for more options.
|
|
128
121
|
|
|
122
|
+
### Web Platforms (ChatGPT, Google AI Studio, Julius)
|
|
123
|
+
|
|
124
|
+
Web AI platforms require HTTP transport with an ngrok tunnel:
|
|
125
|
+
|
|
126
|
+
**Terminal 1:** Start HTTP server
|
|
127
|
+
```bash
|
|
128
|
+
tradeblocks-mcp --http ~/Trading/backtests
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Terminal 2:** Expose via ngrok
|
|
132
|
+
```bash
|
|
133
|
+
ngrok http 3100
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Then add the ngrok URL (`https://xxx.ngrok.io/mcp`) to your platform's MCP settings.
|
|
137
|
+
|
|
138
|
+
See [Web Platforms Guide](docs/WEB-PLATFORMS.md) for detailed setup instructions.
|
|
139
|
+
|
|
140
|
+
## Transport Modes
|
|
141
|
+
|
|
142
|
+
| Mode | Flag | Use Case | Platforms |
|
|
143
|
+
|------|------|----------|-----------|
|
|
144
|
+
| stdio | (default) | Local CLI tools | Claude Desktop, Claude Code, Codex CLI, Gemini CLI |
|
|
145
|
+
| HTTP | `--http` | Web platforms via ngrok | ChatGPT, Google AI Studio, Julius AI |
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# stdio mode (default)
|
|
149
|
+
tradeblocks-mcp ~/backtests
|
|
150
|
+
|
|
151
|
+
# HTTP mode
|
|
152
|
+
tradeblocks-mcp --http ~/backtests
|
|
153
|
+
tradeblocks-mcp --http --port 8080 ~/backtests
|
|
154
|
+
```
|
|
155
|
+
|
|
129
156
|
## Agent Skills
|
|
130
157
|
|
|
131
158
|
For guided conversational workflows, install the bundled agent skills:
|
|
@@ -163,7 +190,7 @@ backtests/
|
|
|
163
190
|
tradelog.csv # Required - trade history
|
|
164
191
|
dailylog.csv # Optional - daily portfolio values
|
|
165
192
|
reportinglog.csv # Optional - live/reported trades
|
|
166
|
-
|
|
193
|
+
block.json # Auto-generated - cached metadata
|
|
167
194
|
NDX-Put-Spread/
|
|
168
195
|
my-export.csv # Works! Auto-detected by columns
|
|
169
196
|
...
|
package/dist/test-exports.js
CHANGED
|
@@ -20630,7 +20630,7 @@ async function loadDailyLogs(blockPath, blockId, filename = "dailylog.csv") {
|
|
|
20630
20630
|
}
|
|
20631
20631
|
}
|
|
20632
20632
|
async function loadMetadata(blockPath) {
|
|
20633
|
-
const metadataPath = path.join(blockPath, "
|
|
20633
|
+
const metadataPath = path.join(blockPath, "block.json");
|
|
20634
20634
|
try {
|
|
20635
20635
|
const content = await fs.readFile(metadataPath, "utf-8");
|
|
20636
20636
|
return JSON.parse(content);
|
|
@@ -20639,7 +20639,7 @@ async function loadMetadata(blockPath) {
|
|
|
20639
20639
|
}
|
|
20640
20640
|
}
|
|
20641
20641
|
async function saveMetadata(blockPath, metadata) {
|
|
20642
|
-
const metadataPath = path.join(blockPath, "
|
|
20642
|
+
const metadataPath = path.join(blockPath, "block.json");
|
|
20643
20643
|
await fs.writeFile(metadataPath, JSON.stringify(metadata, null, 2), "utf-8");
|
|
20644
20644
|
}
|
|
20645
20645
|
async function buildBlockMetadata(options) {
|
|
@@ -20714,9 +20714,16 @@ async function listBlocks(baseDir) {
|
|
|
20714
20714
|
let dailylogFilename;
|
|
20715
20715
|
let needsMetadataUpdate = false;
|
|
20716
20716
|
if (metadata?.csvMappings?.tradelog) {
|
|
20717
|
-
|
|
20718
|
-
|
|
20719
|
-
|
|
20717
|
+
const cachedTradelogPath = path.join(blockPath, metadata.csvMappings.tradelog);
|
|
20718
|
+
try {
|
|
20719
|
+
await fs.access(cachedTradelogPath);
|
|
20720
|
+
tradelogFilename = metadata.csvMappings.tradelog;
|
|
20721
|
+
dailylogFilename = metadata.csvMappings.dailylog;
|
|
20722
|
+
} catch {
|
|
20723
|
+
needsMetadataUpdate = true;
|
|
20724
|
+
}
|
|
20725
|
+
}
|
|
20726
|
+
if (!tradelogFilename) {
|
|
20720
20727
|
const standardTradelogPath = path.join(blockPath, "tradelog.csv");
|
|
20721
20728
|
const standardDailylogPath = path.join(blockPath, "dailylog.csv");
|
|
20722
20729
|
let hasStandardTradelog = false;
|