gexbot-mcp
gexbot-mcp
GEXBot API をラップする軽量な MCP サーバーで、claude.ai に カスタムコネクタ として追加できるようにします。
公式の MCP Python SDK(FastMCP)で構築され、Streamable HTTP で提供されるため、リモート(例: Render)でホストできます。
仕様リファレンス: nfa-llc/gexbot-openapi — ベースURL https://api.gex.bot/v2、Bearerトークン認証。
公開ツール
ツール | 説明 |
| ゼロガンマ/フリップレベル、上位3つのコール壁、上位3つのプット壁、ネットGEXの符号と値、スポット価格、タイムスタンプ。 |
| スポットの±3%以内のストライクごとのネットGEX(トリム済み)。 |
| GEXBotがサポートするティッカー(株式/指数/先物)。 |
さらに、プレーンなHTTP GET /health エンドポイント(MCPツールではない)を提供し、稼働確認やRenderのヘルスチェックに使用します。
dte について
GEXBotは任意のDTE整数を受け取らず、データを固定カテゴリに分類します。このサーバーは dte 引数をそれらのカテゴリにマッピングします:
dte=0→zero(次の満期 / 0DTE)dte=1→one(次の満期 + 1)その他の値 →
full(公開されているすべての満期にわたる完全な集計、最大約90日先)
注目すべきティッカー
ハードコードされた制限はなく、GEXBotがサポートする任意のティッカーが動作します(list_tickers() を参照)。最もよく使うのは: QQQ、SPY、NDX、SPX、SPXW です。
Related MCP server: ai-trader
認証
サーバーはリクエスト時に環境変数 GEXBOT_API_KEY を読み取り、Authorization: Bearer <key> としてGEXBotに送信します。キーはハードコードされません — 実行する場所(ローカル、Docker、Render)で環境変数として設定する必要があります。
ローカルで実行
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
set GEXBOT_API_KEY=gexbot_custom_your_key_here # cmd.exe
# or: $env:GEXBOT_API_KEY = "gexbot_custom_your_key_here" # PowerShell
python server.pyサーバーはデフォルトで http://0.0.0.0:8000 で待ち受けます(PORT で上書き可能)。MCPエンドポイントは /mcp、ヘルスチェックは /health です。
簡単な動作確認:
curl http://localhost:8000/healthDockerで実行
docker build -t gexbot-mcp .
docker run -p 8000:8000 -e GEXBOT_API_KEY=gexbot_custom_your_key_here gexbot-mcpRender(無料枠)にデプロイ
このフォルダをGitHub(またはGitLab)リポジトリにプッシュします。
Renderダッシュボードで: New + → Web Service → リポジトリを接続します。
Renderは
Dockerfileを自動検出します。ビルド/開始コマンドは空白のままにします(Dockerが処理します)。または、ワンクリック設定を希望する場合、このリポジトリには
render.yamlが含まれています — New + → Blueprint を使用してリポジトリを指定します。
Instance Type を Free に設定します。
Environment で以下を追加します:
GEXBOT_API_KEY= あなたのキー(Secret としてマーク)。Renderダッシュボードで自分で貼り付けてください — リポジトリやrender.yamlには入れないでください。
Health Check Path:
/health。デプロイします。RenderがDockerイメージをビルドし、次のようなURLを提供します:
https://gexbot-mcp.onrender.com
注意: Renderの無料Webサービスは15分間アクティビティがないとスピンダウンし、次のリクエストで再起動に約30〜60秒かかります — アイドル時間後の最初のツール呼び出しは遅くなる場合があります。
claude.aiにカスタムコネクタとして追加
claude.aiで: Settings → Connectors → Add custom connector。
URL:
https://<your-app>.onrender.com/mcp保存します。Claudeは3つのツール(
get_gex_levels、get_gex_profile、list_tickers)を検出します。
エラーハンドリング
すべてのツールはコンパクトなJSON辞書を返します。失敗時には例外を発生させる代わりに {"error": "<message>", ...} を返すため、モデルが問題を確認して伝えることができます。処理されるケース:
APIキーが不正/欠落 → GEXBotから401 → 「GEXBOT_API_KEYを確認」という明確なメッセージ。
キーがリソースへのアクセス権を持たない → 403 → 明確なメッセージ。
サポートされていないティッカー → 404 → 明確なメッセージ。
不正なリクエスト(例: 不正なティッカー/カテゴリ)→ 400 → GEXBotのエラーメッセージを表示。
GEXBotの障害 / 市場終了のエッジケース → 5xxを明確なメッセージで処理。さらに、
get_gex_levels/get_gex_profileは、返されたデータのタイムスタンプが24時間以上古い場合に"stale": trueフラグを含めます(GEXBot自体には明示的な「市場終了」エラーがないため)。ネットワーク/タイムアウトエラー → 明確なメッセージ、クライアントにスタックトレースは漏らしません。
プロジェクト構成
server.py # the MCP server (FastMCP, Streamable HTTP)
requirements.txt
Dockerfile
render.yaml # optional Render Blueprint config
.env.exampleThis server cannot be deployed
Maintenance
Related MCP Connectors
The full TraderMatrix market-data connector for Claude, Cursor and any MCP client. 51 tools: scored and tiered unusual options activity, dealer gamma (GEX), Apex levels and gamma pockets, IV rank, sector flow, dark-pool net-notional rollups, market health and macro regime, gap-continuation and breakout signals, wheel and CSP screeners, a one-call ticker snapshot, and your own watchlists. Needs a TraderMatrix API key (OAuth sign-in works for Claude web and mobile). A free, no-key connector with the gapper scanner and Market Health tools is listed separately as TraderMatrix Free.
Options analytics for AI assistants: chains, IV rank, VRP, Greeks, GEX, expected moves, screeners.
Your investing research inside Claude: watchlists, financial ratios, reverse-DCF valuations, investment theses, notes, portfolio, earnings calendar and news for the companies you follow. 70 read and write tools; ask what's on your morning desk, rank a watchlist by ROE, log a trade or save a thesis. OAuth sign-in. Free to start.
AI workspace with FinzData built in: stocks, futures, options GEX, macro, crypto data and code runs.
Related MCP Servers
- AlicenseBqualityBmaintenanceProvides 32 trading analysis tools for AI-powered market analysis, including real-time data, technical indicators, options Greeks, scanners, and Interactive Brokers portfolio management, all accessible via natural language in Claude Desktop.36406MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude to run backtests, fetch market data, list strategies, and analyze trading algorithms via natural language.19 PyPI1,130GPL 3.0
- AlicenseAqualityDmaintenanceEnables AI agents to discover and retrieve options market-structure data (GEX, gamma flip levels, dealer positioning, skew, max pain, expected-move levels, options flow, and ranked trade setups) from Trading Volatility's public API via natural language.1710 PyPI1MIT
- AlicenseAqualityBmaintenanceProvides natural language access to ApexVol's options analytics platform, enabling queries on options chains, volatility metrics, Greeks, flow analysis, and strategy building via Claude Code or Claude Desktop.432MIT