Insider Political Alpha MCP Server

by apifyforge

144 downloads
Not rated
GitHub Website

About

Insider political trading signal detection — this MCP server applies six institution-grade statistical algorithms to congressional stock disclosures, SEC insider filings, campaign finance records, and federal contract data, and returns scored findings to any MCP-compatible AI cli

Details

Author
apifyforge
Downloads
144
Categories
Finance

- Bivariate Hawkes process with MLE fitting for temporal coincidence
- Fama-French event study with political factor and CAR
- Ziv-Merhav transfer entropy network for information flow
- Cross-Recurrence Quantification Analysis of donation‑trade correlation
- Difference-in-Differences contract anticipation estimator
- Composite alpha scoring with five risk levels (CRITICAL to LOW)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Insider Political Alpha MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Add the endpoint URL to your MCP client (Claude Desktop, Cursor, Windsurf) with your Apify API token as the bearer token. Choose a tool – such as profile_legislator_alpha or detect_informed_trading – and the server dispatches multiple data actors in parallel. Most tool calls complete in 2–5 minutes and return structured JSON with a composite score, risk level, and plain-English findings.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "insider political alpha mcp server": {
            "insider-political-alpha-mcp": {
                "url": "https://ryanclinton--insider-political-alpha-mcp.apify.actor/mcp"
            }
        }
    }
}

McpServers

{
    "insider-political-alpha-mcp": {
        "url": "https://ryanclinton--insider-political-alpha-mcp.apify.actor/mcp"
    }
}

Insider Political Alpha MCP Server

> View on ApifyForge | Use on Apify Store

---

Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf):

{
  "mcpServers": {
    "insider-political-alpha-mcp": {
      "url": "https://ryanclinton--insider-political-alpha-mcp.apify.actor/mcp"
    }
  }
}

---

Insider political trading signal detection — this MCP server applies six institution-grade statistical algorithms to congressional stock disclosures, SEC insider filings, campaign finance records, and federal contract data, and returns scored findings to any MCP-compatible AI client in real time. Built for quantitative researchers, compliance teams, and political intelligence analysts who need more than a raw data feed.

The server runs in Apify Standby mode and exposes eight tools over the MCP protocol at the /mcp endpoint. Each tool call dispatches 3-10 Apify data actors in parallel, assembles the results, and runs one or more detection algorithms — bivariate Hawkes process, Fama-French event study, Ziv-Merhav transfer entropy, Cross-Recurrence Quantification Analysis, Difference-in-Differences, or betweenness centrality — before returning a structured JSON response with a composite 0-100 alpha score, risk level, and plain-English findings. No Bloomberg subscription, no Capitol Trades account, no manual data joining required.

What data can you extract?

| Data Point | Source | Example |
|---|---|---|
| 📊 Temporal coincidence score | Bivariate Hawkes process | 74 / 100 (excitation fraction 0.37) |
| 📈 Cumulative Abnormal Return (CAR) | Fama-French + political factor | +8.3% over [-5, +30] day window |
| 🔗 Information flow network edges | Ziv-Merhav transfer entropy | "Energy bills → XOM trades (TE=0.81)" |
| 💸 Donation-trade coordination score | Cross-Recurrence Quantification | DET=0.62, LAM=0.54, score=58/100 |
| 🏛️ Contract anticipation DiD estimator | Difference-in-Differences | delta=+$42,000 excess buying pre-award |
| 🕸️ Information broker betweenness | Brandes centrality algorithm | 0.412 (top 3% of legislator network) |
| ⚠️ Composite alpha score | All six algorithms combined | 81 / 100, risk level: CRITICAL |
| 📋 Flagged trade-event pairs | Hawkes excitation kernel | lag=3.0 days, excitation contrib=0.847 |
| 📉 Political beta t-statistic | OLS regression, political factor | t=2.84 (significant, p < 0.05) |
| 🏢 Top information brokers | Bipartite projection + BFS | legislator name, score, connected companies |
| 📜 Raw congressional trades | Congress Stock Tracker | member, ticker, type, amount, date |
| 💰 Campaign donation records | FEC Campaign Finance | contributor, recipient, amount, cycle |

Why use Insider Political Alpha MCP Server?

Manually cross-referencing congressional stock disclosures against Federal Register rulemaking activity, FEC donation timelines, and USAspending contract awards takes weeks per legislator. Free tools like CapitolTrades show raw transactions with no statistical testing. Paid platforms like Quiver Quant cost $50-200/month and offer no custom algorithm access or programmatic API.

This MCP server automates the entire pipeline: data collection across 13 sources runs in parallel, six detection algorithms execute on the assembled dataset, and results arrive as structured JSON with scored findings and human-readable alerts — all via a single tool call from Claude, Cursor, or any MCP-compatible client.

- Scheduling — run periodic scans daily or weekly to track legislative sessions and earnings windows
- API access — trigger analyses from Python, JavaScript, or any HTTP client using the Apify API
- Parallel data collection — up to 10 actors run simultaneously per tool call, reducing latency
- Monitoring — get Slack or email alerts when runs fail or produce CRITICAL-level signals
- Integrations — push flagged signals to Zapier, Make, Google Sheets, HubSpot, or webhooks

Features

- Bivariate Hawkes process with MLE fitting — 200-iteration gradient descent estimates cross-excitation alpha_12 and decay beta_12 between political event and trade sequences; reports excitation fraction, branching ratio, and a stationarity check
- Fama-French event study with political factor — extends a three-factor model (market, SMB, HML) with a political indicator variable; computes Cumulative Abnormal Return over a [-5, +30] day window; t-statistic above 2.0 triggers a significance flag
- Ziv-Merhav transfer entropy network — discretizes return series into three-bin symbol sequences using tertile thresholds; parses one series using a dictionary built from the other; builds directed edges weighted by normalized cross-parsing complexity; ranks primary information flow channels
- Cross-Recurrence Quantification Analysis (CRQA) — phase-space embeds donation and trade amount series with dimension=2 and delay=1; computes cross-recurrence matrix using epsilon at the 10th percentile of distance distribution; outputs DET, LAM, Shannon entropy, and Coordination Score = DET x LAM x (1 - entropy/max_entropy)
- Difference-in-Differences contract anticipation — partitions legislators into treatment (named committee members) and control groups; measures excess signed trade value in a 60-day pre-award window; includes a parallel trends validation test
- Betweenness centrality brokerage detection — Brandes BFS algorithm on a projected unipartite legislator graph built from congressional trading and FEC donation bipartite edges; normalizes by (n-1)(n-2)/2; Broker Score multiplies centrality by abnormal return correlation
- Composite alpha scoring with five risk levels — weighted ensemble across all algorithms (temporal coincidence 30%, information flow 20%, brokerage 20%, donation-trade CRQA 15%, contract anticipation 15%); outputs CRITICAL / HIGH / ELEVATED / MODERATE / LOW
- Parallel actor orchestrationrunActorsParallel dispatches up to 10 Apify actors concurrently, each with a 120-second independent timeout and 256 MB memory allocation
- 8 MCP tools registered — each tool charges independently via pay-per-event and includes a spending limit guard before any actor calls are made
- 13 upstream data sources — Congress Stock Tracker, SEC Insider Trading, FEC Campaign Finance, Federal Register Search, Congress Bill Search, USAspending, SAM.gov, Finnhub, FRED (DTB3, SP500, VIXCLS), EDGAR Filing Search, EDGAR Analyzer, OpenCorporates, Company Deep Research

Use cases for informed trading signal detection

Quantitative research and alpha generation

Quant funds and individual investors tracking congressional alpha can call detect_informed_trading or profile_legislator_alpha as part of a systematic screening workflow. The Hawkes excitation fraction and Fama-French t-statistic provide statistically grounded signals useful for building political factor models. The full parameter output — alpha_12, beta_12, CAR, t-stat — can be piped directly into downstream econometric pipelines in Python or R.

Compliance and ethics monitoring

Legislative ethics offices, law firms, and corporate compliance teams can run generate_alpha_signal_report for broad-spectrum STOCK Act screening. CRITICAL-level composite scores identify situations warranting deeper review. Every response includes a full audit trail of data counts, algorithm parameters, and finding strings for documentation purposes.

Investigative journalism and political research

Journalists and think tanks investigating insider trading allegations can call profile_legislator_alpha to assemble a complete statistical dossier on a named legislator — covering trade timing, abnormal returns, donation patterns, and network position — in a single tool call. Structured JSON output integrates directly into document management and evidence workflows.

Government contract intelligence

Defense contractors, lobbyists, and federal market analysts can call detect_contract_anticipation to test whether committee members with jurisdiction over specific procurement categories showed excess buying behavior in the 60-day window before award announcements. The DiD estimator quantifies the treatment effect with a parallel trends validation.

Political risk and ESG analysis

Asset managers with ESG mandates and political risk desks can use map_information_flow to identify which regulatory agencies or legislative committees generate the highest-entropy information channels into specific sectors. This supports constructing political risk overlays on sector allocations without manual event-study coding.

Academic and policy research

Economists studying market microstructure and political economy can access the raw Hawkes parameters, transfer entropy edge weights, CRQA metrics, and DiD estimators directly in every response for use in downstream statistical analysis. The full intermediate parameter set is always returned, not just summary flags.

How to use the Insider Political Alpha MCP Server

1. Connect your MCP client — Add https://insider-political-alpha-mcp.apify.actor/mcp to Claude Desktop, Cursor, or any MCP-compatible client configuration. Include your Apify API token as the bearer token in the Authorization header.
2. Choose a tool — Start with profile_legislator_alpha for a named legislator, generate_alpha_signal_report for broad sector screening, or detect_contract_anticipation for a specific procurement query.
3. Wait for parallel data collection — The server dispatches multiple actors simultaneously. Most tool calls complete in 2-5 minutes depending on data volume from upstream sources.
4. Read the scored output — Results arrive as structured JSON with a composite score, risk level, component scores, and plain-English findings. Export or forward to your analysis pipeline as needed.

Input parameters

This MCP server accepts no actor-level input. It runs in Apify Standby mode and receives all inputs through MCP tool calls. The input schema is intentionally empty. Tool inputs are described per-tool in the reference table below.

Tool input reference

| Tool | Parameter | Type | Required | Description |
|---|---|---|---|---|
| detect_informed_trading | legislator | string | No | Filter by legislator name |
| detect_informed_trading | company | string | No | Company name or ticker |
| detect_informed_trading | query | string | No | General search term |
| compute_abnormal_returns | company | string | Yes | Company name or ticker to analyze |
| compute_abnormal_returns | ticker | string | No | Stock ticker symbol |
| compute_abnormal_returns | legislator | string | No | Filter political events by legislator |
| map_information_flow | query | string | No | Search query to filter events |
| map_information_flow | legislator | string | No | Focus on specific legislator |
| analyze_donation_trade_correlation | legislator | string | No | Legislator to analyze |
| analyze_donation_trade_correlation | company | string | No | Company or donor to analyze |
| analyze_donation_trade_correlation | query | string | No | General search term |
| detect_contract_anticipation | contract_query | string | Yes | Contract keyword, agency, or contractor name |
| detect_contract_anticipation | committee_members | string[] | No | Names of treatment-group committee members |
| identify_information_brokers | query | string | No | Filter by legislator, company, or sector |
| profile_legislator_alpha | legislator | string | Yes | Legislator name to profile |
| profile_legislator_alpha | company | string | No | Focus analysis on specific company |
| generate_alpha_signal_report | focus_sector | string | No | Sector focus (e.g. "defense", "healthcare") |
| generate_alpha_signal_report | time_period | string | No | Time period description (e.g. "last 90 days") |

Tool call examples

Profile a specific legislator (most common use case):

{
"tool": "profile_legislator_alpha",
"arguments": {
"legislator": "Jane Harrington",
"company": "Raytheon"
}
}

Broad sector screening for alpha signals:

{
"tool": "generate_alpha_signal_report",
"arguments": {
"focus_sector": "defense",
"time_period": "last 90 days"
}
}

Contract anticipation for a specific award:

{
"tool": "detect_contract_anticipation",
"arguments": {
"contract_query": "Lockheed Martin F-35 depot maintenance",
"committee_members": ["Jane Harrington", "Robert Kellner"]
}
}

Tool tips

- Start with generate_alpha_signal_report — the broad sweep surfaces the highest-scoring legislators and companies before you commit to deeper per-legislator analysis
- Pair profile_legislator_alpha with a company name — specifying both legislator and company focuses the Fama-French event study on the stock most relevant to the investigation
- Provide committee_members for detect_contract_anticipation — without named committee members, there is no treatment-control split and the DiD estimator will return a degenerate result
- Use sector keywords for generate_alpha_signal_report — terms like "healthcare", "semiconductor", or "energy" propagate to all 10 upstream actor queries simultaneously
- Set a spending limit before broad sweepsprofile_legislator_alpha and generate_alpha_signal_report each run 8-10 actors; configure a per-run budget in Apify Console before starting

Output example

{
  "legislator": "Jane Harrington",
  "company": "Raytheon Technologies",
  "compositeAlphaScore": 81,
  "riskLevel": "CRITICAL",
  "componentScores": {
    "temporalCoincidence": 74,
    "abnormalReturnSignal": 88,
    "informationFlow": 62,
    "donationTradeCorrelation": 71,
    "brokerageRank": 0.412
  },
  "findings": [
    "Observation window: 312 days, 18 political events, 9 trades",
    "Cross-excitation alpha_12=0.8231, decay beta_12=0.1142",
    "Excitation fraction: 37.4% of trading is politically excited",
    "ALERT: Very high political excitation — strong informed trading signal",
    "Political beta: 0.000412, t-stat: 2.841",
    "SIGNIFICANT: t-stat 2.84 > 2.0 — abnormal returns around political events",
    "Positive political beta: stocks rise around political events — potential informed buying",
    "Mean CAR over 4 event windows: +8.34%",
    "HIGH COORDINATION: Donation and trading patterns are strongly coupled"
  ],
  "dataCounts": {
    "congressionalTrades": 9,
    "federalRegisterEntries": 11,
    "congressBills": 7,
    "campaignDonations": 22,
    "stockPricePoints": 43,
    "insiderTrades": 8,
    "edgarFilings": 3
  },
  "rawTrades": [
    {
      "member": "Jane Harrington",
      "ticker": "RTX",
      "transactionType": "Purchase",
      "amount": 50000,
      "transactionDate": "2025-09-04"
    }
  ]
}

Output fields

| Field | Type | Description |
|---|---|---|
| compositeAlphaScore | number | 0-100 weighted ensemble score across all six algorithms |
| riskLevel | string | CRITICAL / HIGH / ELEVATED / MODERATE / LOW |
| componentScores.temporalCoincidence | number | 0-100 score from Hawkes process |
| componentScores.abnormalReturnSignal | number | 0-100 score from Fama-French t-statistic |
| componentScores.informationFlow | number | 0-100 score from transfer entropy network |
| componentScores.donationTradeCorrelation | number | 0-100 score from CRQA coordination metric |
| componentScores.brokerageRank | number | 0-1 betweenness centrality (normalized) |
| findings | string[] | Plain-English findings, alerts, and statistical summaries |
| hawkesParameters.crossExcitation | number | alpha_12: cross-excitation coefficient |
| hawkesParameters.crossDecay | number | beta_12: exponential decay rate |
| hawkesParameters.excitationFraction | number | Fraction of trading attributed to political events |
| hawkesParameters.logLikelihood | number | Final MLE log-likelihood value |
| flaggedPairs[] | object[] | Top 20 trade-event pairs sorted by excitation contribution |
| flaggedPairs[].lagDays | number | Days between political event and trade |
| flaggedPairs[].excitationContrib | number | Hawkes kernel contribution at that lag |
| cumulativeAbnormalReturn | number | CAR over [-5, +30] window around political events |
| tStatistic | number | t-statistic for the political factor coefficient |
| significant | boolean | True when t-stat exceeds 2.0 |
| eventWindows[] | object[] | Per-event pre/post/abnormal return breakdown |
| informationFlow.topChannels | object[] | Highest-TE directed edges in the network |
| informationFlow.networkDensity | number | Edge density of the transfer entropy graph |
| crqaMetrics.determinism | number | DET: diagonal line fraction of recurrence matrix |
| crqaMetrics.laminarity | number | LAM: vertical line fraction of recurrence matrix |
| crqaMetrics.entropy | number | Shannon entropy of diagonal line length distribution |
| coordinationScore | number | DET x LAM x (1 - entropy/maxEntropy) |
| didEstimator | number | DiD delta: excess signed return for treatment group pre-award |
| parallelTrendsTest | boolean | True when pre-award trends are sufficiently parallel |
| anticipationScore | number | 0-100 normalized contract anticipation signal |
| topBrokers[] | object[] | Legislators ranked by betweenness centrality score |
| networkStats | object | nodes, edges, density, connected components |
| dataCounts | object | Record count returned by each upstream actor |

How much does it cost to run informed trading signal detection?

Insider Political Alpha MCP Server uses pay-per-event pricing — you pay a fixed fee per tool call. Platform compute costs and upstream actor costs are included.

| Tool | Actors called | Approx. cost per call |
|---|---|---|
| detect_informed_trading | 4 | ~$0.08 |
| compute_abnormal_returns | 4 | ~$0.08 |
| map_information_flow | 4 | ~$0.08 |
| analyze_donation_trade_correlation | 3 | ~$0.06 |
| detect_contract_anticipation | 4 | ~$0.08 |
| identify_information_brokers | 3 | ~$0.06 |
| profile_legislator_alpha | 8 | ~$0.16 |
| generate_alpha_signal_report | 10 | ~$0.20 |

You can set a maximum spending limit per run to control costs. The server checks the spending limit before each tool call and returns a clear message if the limit has been reached.

Compare this to Quiver Quant Premium at $50/month or Capitol Trades Pro at $99/month — with this MCP server, most research sessions cost under $5 with no subscription commitment, full parameter access, and programmatic output.

Using the Insider Political Alpha MCP Server via API

Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.