Thinchain

io.github.SnipMCP由 GitHub 帳號 SnipMCP 發布v0.1.1更新於 Oct 24, 2026

MCP server that sanitizes bad broker data and compresses options chains 95% for AI trading agents.

已驗證STDIO僅桌面金融資料與分析

概覽

AI 產生的概覽

本機 MCP 伺服器,在券商選擇權鏈資料送達 AI 交易代理前進行清洗與壓縮。

可以做什麼
  • 依標的與到期日取得壓縮後的選擇權鏈,並依鐵兀鷹、跨式等策略裁剪履約價
  • 取得經清洗的標的報價,剔除幽靈報價、倒掛價差與異常數值
  • 查詢某標的與到期日的熔斷狀態與資料品質等級
  • 透過衛生規則、策略切片與異常門檻對原始券商輸出做清洗、壓縮與把關
適用情境
適合助理處理 Tradier 或 Polygon 的選擇權資料、而原始選擇權鏈過大或雜訊過多時使用。也適用於鐵兀鷹、跨式等策略查詢,以及交易前判斷選擇權鏈資料是否可信。
執行需求
以本機 Python 套件執行(pip 安裝,或以 docker-compose 啟動 Docker)。需在 .env 檔中設定券商 API 金鑰與基礎位址,包括 TRADIER_API_KEY 與 POLYGON_API_KEY,以及 DEFAULT_BROKER、CACHE_TTL_SECONDS 等設定。需要能連線至券商 API 的網路。
安裝前請注意
需要真實券商 API 憑證(TRADIER_API_KEY、POLYGON_API_KEY),並存放在本機 .env 檔中。它只讀取與重塑行情資料,但輸出會用於交易決策,清洗或快取後的資料仍可能過期或不完整。README 另推廣一項付費託管雲端服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Thinchain,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ThinChain

The catalytic converter between raw broker data and your AI trading agent.

Battle-tested. Sanitization logic extracted from a production options trading app. Handles every bad tick Tradier has thrown at us in production.

[ThinChain Demo]

☁️ Moving to production?

The open-source server runs locally with your own API keys. For hosted infrastructure with multi-broker failover, SLA guarantees, and webhook alerts — join the managed cloud waitlist.

The Problem

Tradier's MCP dumps 500-row JSON chains. One bad print can corrupt an agent's reasoning. ThinChain sanitizes, compresses, and circuit-breaks that data before it reaches your model.

Installation

bash
git clone https://github.com/snipmcp/thinchain.gitcd thinchainpip install -e ".[dev]"cp .env.example .env

Or with Docker:

bash
docker-compose up --build

Configuration

env
TRADIER_API_KEY=your_key_hereTRADIER_BASE_URL=https://api.tradier.com/v1POLYGON_API_KEY=your_key_herePOLYGON_BASE_URL=https://api.polygon.ioDEFAULT_BROKER=tradierCACHE_TTL_SECONDS=30LOG_LEVEL=INFO

Usage

Three example prompts to send to Claude (or any MCP-compatible agent):

  1. Use get_compressed_chain to get an iron condor setup on SPY expiring 2026-06-19
  2. Check if SPY options data is trustworthy before I place my trade
  3. Get me the ATM straddle strikes for AAPL expiring 2026-06-19

Run it in two terminals

bash
# Tab 1 — start the MCP serverpython -m thinchain.server
bash
# Tab 2 — call a tool from a Python shell or your MCP client# Tool signatures:#   get_compressed_chain(symbol, expiration, strategy="raw",#                        delta_range=None, broker="tradier")#   get_sanitized_quote(symbol, broker="tradier")#   get_circuit_status(symbol, expiration, broker="tradier")

How it works

Three layers between raw broker output and your model:

Broker API → [Sanitize] → [Compress] → [Circuit Break] → MCP Tool → AI Agent              hygiene     strategy      anomaly gate              rules       slicing       + cache
  • Sanitize: Drops ghost quotes (0.0/0.0), inverted spreads, NaN/empty/dash values, clamps deltas to [-1, 1], normalizes positive theta on long options, flags illiquid strikes.
  • Compress: Slices the chain to only the strikes relevant to your strategy (iron condor, straddle, etc.) — typically 95%+ token reduction.
  • Circuit Break: Four-tier data quality (clean / noisy / degraded / circuit_breaker_active). When >65% of rows are anomalous, refuses to serve stale data and falls back to last known-good cache.

Real numbers from a live SPY iron condor (2026-06-19 expiration)

RAW TRADIER PAYLOAD          THINCHAIN OUTPUT─────────────────────────────────────────────Rows:        482             Rows:        25Est tokens:  38,560          Est tokens:  2,000Token savings:               95%Anomalous rows removed:      217Data quality:                noisy → still safely served

ThinChain compresses 482 rows / 38,560 tokens down to 25 rows / 2,000 tokens — and flags 217 anomalous strikes (illiquid, ghost quotes, wide spreads) that would have polluted the agent's context.

Roadmap

  • Managed cloud tier (hosted, multi-tenant, webhook alerts)
  • Polygon connector hardening (live SIP feed)
  • Webhook alerts for circuit breaker trips

Contributing

PRs welcome. Run pytest before submitting.

來源:README.md,提交 9373301

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分