trade-analytics-mcp
Enables AI to analyze trade quality by fetching real price action around fills, generating annotated candlestick charts, and computing metrics like MAE/MFE, R-multiple, and capture efficiency.
README
trade-analytics-mcp
Give your AI eyes and a ruler for your trades. An open-source MCP server that lets your LLM/agent pull the real price action around every fill in an order-history export, see each trade on a candlestick chart, and measure it — heat taken, R-multiple, whether it went green before red, how much of the move it captured — so it can tell you whether a loss was bad luck or bad location.
You bring your own market-data key; the data stays on your machine.
Why — what it actually lets your AI do
An order-history export (Tradovate, your broker's CSV, …) is just timestamps, prices, sizes, sides. From that alone an AI can spot behaviour — overtrading, revenge entries, size creep, bad time-of-day — but it is blind to trade-location quality: was the entry into structure or a chase? how much adverse excursion did you sit through? did you cut a winner early? was the stop sane for the volatility?
This MCP closes that gap — in two tiers.
🆓 Free, on your machine
resolve_symbol + get_price_context run 100% locally under your own Databento key — no
account, no fee, no data leaving the machine. Your agent can:
- turn "MNQ" / "micro nasdaq" into the exact contract, point value, and front-month; and
- pull the real OHLCV around each fill (auto-windowed) with your entries/exits/stops as JSON,
so it reasons over the actual price path — where the entry sat, the shape of the move, proximity to the day's high/low — instead of guessing. That alone turns "I think I chased" into a grounded read.
💳 With a trade-analytics API key (paid)
render and analyze send only the numeric slice of that same local data to the hosted API and
add the two things that are tedious or impossible to do well from raw JSON:
render— an annotated candlestick chart image (entries ▲ / exits ▼, SL/TP zones, reference levels), returned and saved to a file so your AI can drop it into a journal.analyze— the precise per-trade metrics that separate good-trade-bad-outcome from bad-location: MAE / MFE (heat vs best excursion), R-multiple, went-green-first, capture efficiency, plus USD P&L, time-in-trade, win rate, and session roll-ups.
So — with the paid tools — instead of "you lost on trade #3," your AI can say:
"Trade #3 (short at 20,110) went +0.8R in your favour within three minutes, then reversed through your entry to −18 pts before you exited at −15 — MFE 12, MAE 18, capture −1.2. Location was fine (into the prior-day high); management wasn't," — and hand you the annotated chart.
A typical review
"Review my MNQ trades from last week." → your agent reconstructs the round-trips, calls
resolve_symbol(MNQ → the right contract),analyze(per-trade MAE/MFE/R/capture + a session summary), andrenderon the notable trades (charts saved to your vault), then writes the review with the numbers and the pictures.
Tools
| Tool | What it does | Cost |
|---|---|---|
resolve_symbol |
"MNQ" / "micro nasdaq" → precise contract, point value, front-month | Free, local |
get_price_context |
OHLCV + your entries/exits/SL as JSON for a window auto-sized around the trade | Free, local |
render |
An annotated candlestick chart image, returned and saved to a file (PNG or SVG) | Paid |
analyze |
Per-trade MAE/MFE, R-multiple, went-green-first, capture efficiency + summary | Paid |
resolve_symbol and get_price_context run 100% on your machine under your own data key — no
account, no fee. render and analyze forward only the numeric slice of your own data to the
hosted trade-analytics API and return the result; nothing is retained.
Setup
1. Get a Databento key (your market data)
Databento is a modern market-data provider — institutional-grade historical and live data through a simple API. This example MCP implementation uses it to fetch the candles around your trades, under your own key, locally.
- No subscription. It's pay-as-you-go, and new accounts get a free usage credit that comfortably covers normal trade review — historical 1-minute OHLCV is cheap and is often effectively free within that credit.
- Sign up at databento.com → open the portal → create an API key →
that's your
DATABENTO_API_KEY.
Your key and your data stay on your machine; only the numeric slices you render/analyze leave it.
2. (For charts + analysis) Get a trade-analytics API key
render and analyze need a key from the
trade-analytics dashboard. There's a free tier to
try it; paid tiers raise the monthly quota. The free local tools work without one.
3. Add the MCP to your client
Claude Code (or any terminal harness):
claude mcp add trade-analytics \
-e DATABENTO_API_KEY=db-your-key \
-e TRADE_ANALYTICS_API_KEY=tc_live_your-key \
-- npx -y trade-analytics-mcp
Drop the TRADE_ANALYTICS_API_KEY line to run just the free local tools.
Claude Desktop / other MCP clients — add to the config:
{
"mcpServers": {
"trade-analytics": {
"command": "npx",
"args": ["-y", "trade-analytics-mcp"],
"env": {
"DATABENTO_API_KEY": "db-your-key",
"TRADE_ANALYTICS_API_KEY": "tc_live_your-key"
}
}
}
}
Configuration
Resolved with precedence CLI flags > env > defaults:
| Setting | Env | Flag | Notes |
|---|---|---|---|
| Databento key | DATABENTO_API_KEY |
--databento-key |
Required. Your own; data stays local. |
| API key | TRADE_ANALYTICS_API_KEY |
--api-key |
Only for render / analyze. |
| API URL | TRADE_ANALYTICS_API_URL |
--api-url |
Defaults to the hosted API. |
| Output dir | TRADE_ANALYTICS_OUTPUT_DIR |
--output-dir |
Where render saves images. |
Built on the trade-analytics API
This whole server is a thin client — it fetches data locally and calls the trade-analytics API for the rendering and analysis. That API is a general, data-agnostic service for turning OHLC data into chart images and trade metrics: send it candles (from any source), get back a chart or a trade analysis. This MCP is just one example of what you can build on it — a dashboard, a trading bot, a Discord/Slack integration, a backtest reporter, or your own journaling tool would all sit on the same endpoints.
Privacy
- Your Databento key and your market data live on your machine.
- The free tools make no network calls to us at all.
render/analyzesend only the numeric candle slice needed for that one call; the API is stateless and retains nothing.
Develop
npm install
npm run typecheck && npm test && npm run build
npm run dev # run the stdio server locally
MIT licensed. Issues and PRs welcome.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。