traders-edge-mcp
Provides a consolidated 0DTE options cockpit for SPX/SPXW, including chain, Greeks, dealer exposure, volatility term structure, and economic events, using free delayed market data.
README
Traders Edge MCP
A consolidated 0DTE-focused options cockpit for SPX / SPXW, exposed as a Model Context Protocol server. It pulls free, key-less market data and turns it into the dealer-positioning, volatility, and event signals an index-options scalper actually watches — chain & Greeks, gamma exposure (GEX), the zero-gamma flip, call/put walls, max-pain, 0DTE expected move, dealer DEX / vanna / charm, the full VIX term structure, and an economic-event clock.
Greeks are recomputed analytically (vectorized Black–Scholes via numpy) from open interest and implied vol, with proper Eastern-time time-to-expiry so 0DTE gamma stays realistic into the bell.
Data is ~15 minutes delayed (CBOE delayed quotes). That is fine for positioning and regime. Overlay a live broker quote (e.g. Robinhood/E*TRADE/Alpaca MCP) for execution pricing.
Tools (48)
Chain & Greeks
| Tool | What it does |
|---|---|
options_chain |
SPX/SPXW chain near the money with IV + recomputed delta/gamma. Defaults to the nearest SPXW expiry; zero_dte=True for today. |
option_quote |
Full detail for one OCC symbol (e.g. SPXW260619C05500000): quote, IV, delta/gamma/vanna/charm. |
expirations |
Available SPX/SPXW expirations and days-to-expiry. |
Dealer positioning
| Tool | What it does |
|---|---|
gamma_exposure |
Total dealer GEX ($ per 1% move) + the zero-gamma flip level and long/short-gamma regime. |
gamma_walls |
Call wall / put wall (largest gamma strikes), net-gamma strikes, and max-pain for an expiration. |
zero_dte_exposure |
One-shot 0DTE dashboard: GEX, flip, walls, max-pain pin, expected move (ATM straddle), gamma concentration. |
dealer_exposure |
Dealer DEX (dollar delta), vanna (per 1% vol), and charm (per day) exposure. |
Vol complex
| Tool | What it does |
|---|---|
vix_complex |
VIX1D / VIX9D / VIX / VIX3M / VVIX / SKEW with a regime read. |
vix_term_structure |
Front-to-back VIX curve + contango/backwardation regime. |
Event clock
| Tool | What it does |
|---|---|
economic_calendar |
Upcoming high-impact US macro events + live Treasury auctions over N days. |
next_event |
The single next macro event with an ET countdown. |
Plus traders_edge_status (health check / current spot).
0DTE decision support
| Tool | What it does |
|---|---|
expected_move |
ATM-straddle implied range (~1-sigma) for the session, plus +/-1 & +/-2 sigma levels and the IV-based move. |
strike_probabilities |
Per-strike risk-neutral prob-ITM and prob-of-touch (Black-Scholes from each strike's IV). |
daily_game_plan |
One call for today's 0DTE map: expected-move bands + gamma flip/walls + max-pain + high-OI pins, assembled into support/resistance. |
Tier 2 — Macro context (FRED, key-less)
| Tool | What it does |
|---|---|
fed_funds |
Current Fed Funds rate + recent monthly path. |
yield_curve |
Treasury curve (3M–30Y), 2s10s / 3m10s spreads, inversion flags. |
inflation |
CPI / core CPI / PCE / core PCE (YoY) + 5Y/10Y breakevens. |
labor_market |
Unemployment, payroll change, participation, wages, claims. |
growth |
Real GDP, industrial production, retail sales. |
financial_conditions |
NFCI, HY & IG credit spreads, dollar index, VIX. |
recession_indicators |
Sahm Rule, curve spreads, composite read. |
series / latest |
Any FRED series ID over a window, or latest values for a list. |
series_search |
Catalog keyword search (needs free FRED_API_KEY). |
fred_status |
FRED health check. |
Macro data is pulled key-less from the FRED fredgraph CSV endpoint.
Cross-broker risk / Greeks aggregator
| Tool | What it does |
|---|---|
net_greeks |
Net dollar delta / gamma / theta / vega across Alpaca + your positions file; delta also in SPX points. |
risk_summary |
Beta-weighted SPX exposure, gross/long/short notional, by-broker & by-underlying breakdowns, top contributors. |
concentration |
Exposure % by underlying; flags names above the threshold (default 25%, CONCENTRATION_PCT). |
scenario_shock |
Portfolio P&L across a set of SPX % moves (delta + gamma convexity). |
daily_target |
Today's realized P&L vs your daily target (DAILY_TARGET, default $524), with a post-target discipline check. |
robinhood_positions |
Live Robinhood holdings (stocks + option legs with broker-provided Greeks). |
etrade_positions |
Live E*TRADE holdings (stocks + options; SPX/SPXW priced via CBOE). |
alpaca_positions / load_positions |
Raw position views from each source. |
risk_status |
Which position sources are configured / reachable. |
Positions are pulled automatically from your Alpaca, Robinhood, and E*TRADE accounts, and can be supplemented with a broker-agnostic positions file for anything held elsewhere:
- Alpaca — live
/v2/positions(creds viaALPACA_ENV_FILE, default the alpaca-mcp.env). - Robinhood — stock holdings plus option legs (with broker-provided delta/gamma/theta/vega/IV) via
the cached
robin_stockssession shared with the robinhood-local server. Creds fromRH_USERNAME/RH_PASSWORD(orRH_ENV_FILE, default the robinhood-local.env); the session pickle lives in~/.robinhood/and refreshes every 7 days (a one-time device-approval prompt may appear in the Robinhood app on first use after expiry). - E*TRADE — stock + option positions via the cached
pyetradeOAuth session shared with the etrade MCP (~/.etrade/tokens.pickle; idle tokens auto-renew). Creds fromETRADE_CONSUMER_KEY/SECRET(orET_ENV_FILE). E*TRADE access tokens expire nightly — if expired, re-authorize via the etrade MCP (setup_etrade_auth.py). SPX/SPXW E*TRADE options are priced from CBOE; equity-option Greeks from E*TRADE aren't fetched yet. - Positions file — default
~/.trading/positions.json(overridePOSITIONS_FILE).
Each source can be toggled per call via include_alpaca / include_robinhood / include_etrade /
include_file. SPX/SPXW options are auto-priced from CBOE; broker-supplied option Greeks are used
directly; equities are beta-weighted for SPX-equivalent exposure via a built-in beta map (editable
with BETA_OVERRIDES="ICE:1.05,NVDA:1.7" or BETA_MAP_FILE=<json>; unmapped symbols default to 1.0).
Example positions file:
{"positions": [
{"broker": "robinhood", "symbol": "ICE", "qty": 500, "type": "equity", "beta": 1.05},
{"broker": "robinhood", "symbol": "SPXW260620P07400000", "qty": -2, "type": "option"}
]}
Discipline / behavioral (Robinhood fills)
| Tool | What it does |
|---|---|
daily_pnl_curve |
Realized-P&L curve from your option fills (net of fees), with the target-cross marked and the give-back-after-target quantified. |
daily_review |
End-of-day scorecard: win rate, expectancy, profit factor, P&L by hour, and the before-vs-after-target split. |
should_i_trade |
Real-time GO / CAUTION / STOP gate from past-target status, give-back from peak, consecutive losses, churning, and time-of-session. |
Realized P&L is reconstructed from Robinhood option fills (net_amount, fees included) with round trips
matched open->close FIFO. These tools target the logged pattern of giving back gains after hitting target;
a recon note flags any day where positions expired or remain open (net cash flow != round-trip realized).
Position management & macro regime
| Tool | What it does |
|---|---|
covered_call_manager |
Scans your Robinhood short calls: DTE, assignment prob (delta), premium captured vs extrinsic left, annualized yield, share-coverage check, earnings-before-expiry flag, and roll signals. |
earnings_calendar |
Next single-name earnings for your holdings (or a symbol list): date, BMO/AMC session, days away, within-window flag; ETFs/funds listed separately. |
regime_classifier |
Folds VIX + VIX term structure + NFCI + HY credit spreads + 2s10s curve + Sahm rule into one risk-on/neutral/risk-off score with a 0DTE posture. |
Performance, tax & snapshot history
| Tool | What it does |
|---|---|
discipline_backtest |
Replays your fills through the stop-at-target rule: actual vs stop-at-target P&L, the after-target leak (losing days), win rate, expectancy, profit factor, an equity curve, and by-day-of-week / by-hour breakdowns. |
tax_summary |
Year-to-date realized options P&L (short vs long term, by month, gross gains/losses) plus identical-contract wash-sale candidates. CPA hand-off; not tax advice. |
snapshot_log |
Logs the current 0DTE state (spot, GEX, gamma flip, call/put walls, max-pain, expected move, VIX/VIX1D, regime) to local SQLite. |
snapshot_history |
Reads back the day's snapshots and summarizes intraday drift — GEX migration and where the key levels moved. |
roll_candidates |
Roll-up-and-out targets for a covered call: candidate strikes/expiries with mark, delta, net credit vs closing the current call, and annualized yield. |
Configuration
| Tool | What it does |
|---|---|
trading_config |
View or change your goals/discipline settings (daily target, give-back %, roll thresholds…) in config.json — live, no restart. |
Goals and discipline thresholds live in config.json next to the server (or point TE_CONFIG_FILE
elsewhere). Precedence is env var > config.json > built-in default, and edits are picked up live
(no restart). Change them by editing the file or via the tool — e.g. trading_config(action="set", key="daily_target", value="550"). Editable keys: daily_target, weekly_target, giveback_frac,
rapid_reentry_secs, late_session_et, max_trades_per_day, roll_delta, roll_dte. See
config.example.json.
Data sources (no API key required)
- CBOE delayed quotes — the keyless backbone:
- Option chain:
https://cdn.cboe.com/api/global/delayed_quotes/options/_SPX.json(contains both AM-settled monthly SPX and PM-settled SPXW weeklies/0DTE — ~32k contracts with open interest, IV, and Greeks). - Vol indices:
https://cdn.cboe.com/api/global/delayed_quotes/quotes/_{SYM}.json
- Option chain:
- TreasuryDirect — live upcoming auctions:
https://www.treasurydirect.gov/TA_WS/securities/upcoming
Optional: set FMP_API_KEY or FINNHUB_API_KEY for a fully live economic calendar (tick-precise
CPI / PCE / PPI release dates). Without a key, the calendar is built from rule-based releases
(jobless claims, NFP, ISM), the 2026 FOMC schedule, a curated macro table, and live Treasury auctions —
every event is source-tagged so you know its provenance.
Methodology & conventions
- Greeks: vectorized Black–Scholes,
q=0(index options),r=TE_RISK_FREE(default 4.3%; gamma is ~insensitive to it). Normal CDF via an Abramowitz–Stegun approximation (max error ~7e-8); no scipy. - Time to expiry: years from now (ET) to 16:00 ET on the expiration date, floored at ~30 minutes so 0DTE gamma stays finite at the close.
- GEX convention: dealers assumed long calls / short puts → call gamma adds, put gamma subtracts.
Dollar gamma per 1% move per option =
gamma × OI × 100 × spot² × 0.01. Positive total GEX ⇒ dealers long gamma (vol-dampening / mean-reverting); negative ⇒ short gamma (moves amplified). - Zero-gamma flip: net signed dollar gamma is recomputed across 81 spot levels (±10%); the flip is the zero-crossing nearest spot.
- Max-pain: the strike minimizing total option-holder intrinsic payout for that expiration.
- Expected move (0DTE): the ATM straddle mid (~1-sigma for the session).
- DEX / vanna / charm: same dealer (long-calls / short-puts) sign convention as GEX.
These are standard market-positioning heuristics computed from delayed open interest, not a guarantee of dealer books or future price. Use as one input alongside your own read.
Install
cd traders-edge-mcp
/Library/Frameworks/Python.framework/Versions/3.13/bin/python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
Configure (Claude Desktop)
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"traders-edge": {
"command": "/Users/<you>/Claude/mcp/traders-edge-mcp/.venv/bin/python",
"args": ["/Users/<you>/Claude/mcp/traders-edge-mcp/traders_edge_mcp.py"]
}
}
}
(See claude_desktop_config.example.json.) Restart Claude Desktop after editing.
Test
.venv/bin/python test_traders_edge.py # offline math/parsing tests
Disclaimer
For research and educational use only. Not investment advice. Market data is delayed; positioning metrics are modeled heuristics. You are responsible for your own trading decisions.
License
MIT — see LICENSE.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。