Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Congressional Trade Signals

FreeNot checked

Enables querying of U.S. congressional stock trade data, including price history, recent trades, buy signals, stock activity, and politician activity, through n

GitHubEmbed

About

Enables querying of U.S. congressional stock trade data, including price history, recent trades, buy signals, stock activity, and politician activity, through natural language tools.

README

Do U.S. congressional stock trades beat the market — and can a retail investor act on them?

An end-to-end, auditable research pipeline that collects public STOCK Act disclosures, market-adjusts every trade against the S&P 500, detects multi-politician cluster buys, and scores them into STRONG / WATCH / SKIP signals — exposed both as a research dataset and as a live MCP server.

Research project extending Ziobrowski et al. (2004, 2011) into the post-STOCK Act era. Built as a Fellow at Humanitarians AI under the Mycroft verified-intelligence framework. Research only — not financial advice. No trades are placed.


The headline finding

In aggregate, congressional BUY trades beat the market by only +0.24% after per-trade SPY adjustment — most members simply ride market beta. The real signal is concentrated in cluster buys: when 2+ politicians independently buy the same ticker within 30 days, especially in semiconductors and AI infrastructure under active legislative oversight, those clusters show +17% to +68% alpha above SPY.

The value of the system is the skip rate — it filters out ~95% of trades as noise.


Architecture

 INGEST            GIGO (validate)             TOOL (analyze, read verified only)
┌─────────┐   ┌──────────────────────┐   ┌─────────────────────────────────────┐
│scraper  │ → │enricher              │ → │cluster_analyzer → langgraph_pipeline │
│(Selenium│   │(yfinance prices)     │   │(cluster detect)  (5-node multi-agent)│
│Capitol  │   │market_adjusted       │   │                                      │
│Trades)  │   │(SPY per-trade alpha) │   │           server.py (MCP, 5 tools)   │
└─────────┘   └──────────────────────┘   └─────────────────────────────────────┘
 data/raw/  ───────────────────────────→  data/verified/  ──→  logs/ + reports/

The LangGraph multi-agent pipeline (langgraph_pipeline.py)

conformance ──(fail)──→ END          hard data gate: never analyze garbage
     │
     ↓
 cluster ──→ scorer ──(0 STRONG)──→ report      skip the LLM when nothing to explain
                 │
              (STRONG>0)
                 ↓
            research (Claude) ──→ report         LLM thesis note per strong signal

Shared typed state with an append-only run-log reducer — every number in the final report traces back through the graph to its source filing (provenance).


Quick start

pip install -r requirements.txt

python scraper.py              # 1. INGEST  — scrape Capitol Trades → data/raw/trades.csv
python enricher.py             # 2. GIGO    — add yfinance prices (resumable, checkpointed)
python market_adjusted.py      # 3. GIGO    — per-trade SPY-matched alpha
python cluster_analyzer.py     # 4. TOOL    — detect clusters + politician sector profiles
python langgraph_pipeline.py --no-llm   # 5. TOOL — score signals, write log + report

Open dashboard.html in any browser for the interactive research dashboard.

As an MCP server (Claude Desktop)

server.py exposes 5 natural-language tools: get_price_history, get_recent_trades, get_buy_signals, get_stock_activity, get_politician_activity.


Methodology highlights

  • Per-trade market adjustment — each trade's return has SPY's return over the identical 30-day window subtracted. Stricter than the aggregate benchmarking in prior literature.
  • Returns measured from disclosure date, not transaction date — the moment a retail investor could realistically have known. No look-ahead.
  • Cluster = temporal co-occurrence, not ML clustering: 2+ distinct politicians buying the same ticker in a 30-day sliding window.
  • Two-factor score = cluster size × max buy-conviction ratio (BCR), validated against out-of-sample market-adjusted alpha.

Repo layout

Path What
scraper.py Selenium scraper for Capitol Trades (checkpoint/resume)
enricher.py yfinance price enrichment (incremental, resumable)
market_adjusted.py per-trade SPY alpha
cluster_analyzer.py cluster detection + politician sector profiles
langgraph_pipeline.py 5-node LangGraph multi-agent signal pipeline
server.py FastMCP server (5 tools)
dashboard.html interactive research dashboard (Chart.js)
PAPER_DRAFT.md working paper
recipes/, DATA_CONTRACT.md, logs/RUN_LOG.md Mycroft framework compliance

Author

Ameya Deshmukh@Ameya-Deshmukh26 [email protected] · Northeastern University

License

MIT — see LICENSE.

Data sourced from public STOCK Act disclosures via Capitol Trades and price data via Yahoo Finance. This project is for research and educational purposes only and does not constitute financial advice.

from github.com/Ameya-Deshmukh26/congressional-trade-signals

Installing Congressional Trade Signals

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/Ameya-Deshmukh26/congressional-trade-signals

FAQ

Is Congressional Trade Signals MCP free?

Yes, Congressional Trade Signals MCP is free — one-click install via Unyly at no cost.

Does Congressional Trade Signals need an API key?

No, Congressional Trade Signals runs without API keys or environment variables.

Is Congressional Trade Signals hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Congressional Trade Signals in Claude Desktop, Claude Code or Cursor?

Open Congressional Trade Signals on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Congressional Trade Signals with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs