ThinChain

ThinChain

MCP server that sanitizes bad broker data and compresses 500-row options chains to strategy-specific slices for AI trading agents. 95% token reduction. Handles ghost quotes, inverted spreads, and impossible greeks automatically.

Category
Visit Server

README

<!-- mcp-name: io.github.SnipMCP/thinchain -->

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

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

Or with Docker:

docker-compose up --build

Configuration

TRADIER_API_KEY=your_key_here
TRADIER_BASE_URL=https://api.tradier.com/v1
POLYGON_API_KEY=your_key_here
POLYGON_BASE_URL=https://api.polygon.io
DEFAULT_BROKER=tradier
CACHE_TTL_SECONDS=30
LOG_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

# Tab 1 — start the MCP server
python -m thinchain.server
# 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:        25
Est tokens:  38,560          Est tokens:  2,000
Token savings:               95%
Anomalous rows removed:      217
Data 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured