Skip to main content
Glama

FinBrain MCP 

PyPI version CI License

Requires Python 3.10+

A Model Context Protocol (MCP) server that exposes FinBrain datasets to AI clients (Claude Desktop, VS Code MCP extensions, etc.) via simple tools. Backed by the official finbrain-python SDK (v2 API).


Features

AI-Powered Price Predictions

Access FinBrain's machine learning price forecasts with daily (10-day) and monthly (12-month) horizons. Includes mean predictions with 95% confidence intervals.

News & Sentiment Analysis

Browse recent news articles for any ticker, or track aggregated daily sentiment scores over time. Screen news across all tracked stocks.

Alternative Data

  • LinkedIn Metrics — Employee count and follower trends as company health indicators

  • App Store Ratings — Mobile app performance data for consumer-facing companies

  • Options Flow — Put/call ratios and volume to gauge market positioning

  • Reddit Mentions — Ticker mention counts across subreddits, collected every 4 hours

  • Government Contracts — U.S. government contract awards from USAspending.gov

  • Patent Filings — USPTO granted patents mapped to tickers by corporate assignee, with CPC classification

Institutional & Insider Activity

  • US Congress Trades — Stock transactions disclosed by House representatives and Senators, with the transaction date and the public disclosure date (so you can measure reporting lag), the beneficial owner of the traded account (member, spouse, dependent child, joint, or an account code), and filed amounts normalized to the statutory STOCK Act brackets with the original filing preserved

  • Corporate Lobbying — Lobbying filings with registrant, income, expenses, and issue codes

  • Insider Transactions — SEC Form 4 filings showing executive buys and sells

  • Analyst Ratings — Wall Street coverage and price target changes


Related MCP server: stock-mcp

What you get

  • ⚡️ Local MCP server (no proxying) using your own FinBrain API key

  • 🧰 Tools (JSON by default, CSV optional) with paging

    • health

    • available_markets, available_tickers, available_regions

    • predictions_by_market, predictions_by_ticker

    • news_by_ticker, news_sentiment_by_ticker

    • app_ratings_by_ticker

    • analyst_ratings_by_ticker

    • house_trades_by_ticker, senate_trades_by_ticker

    • corporate_lobbying_by_ticker

    • insider_transactions_by_ticker

    • linkedin_metrics_by_ticker

    • options_put_call

    • reddit_mentions_by_ticker

    • government_contracts_by_ticker

    • patent_filings_by_ticker

    • recent_news, recent_analyst_ratings

    • screener_sentiment, screener_analyst_ratings, screener_news

    • screener_insider_trading, screener_house_trades, screener_senate_trades

    • screener_put_call_ratio, screener_linkedin, screener_app_ratings, screener_reddit_mentions, screener_government_contracts, screener_patent_filings

  • 🧹 Consistent, model-friendly shapes (we normalize raw API responses)

  • 📱 app_ratings_by_ticker returns a blended series — one row per date, carrying the company's biggest app on each store — plus apps, a summary of every app it publishes (platform, app_id, app_name, observation_count, latest_score, latest_ratings_count) and app_count. A company can publish many apps (Apple has 140 on iOS), so answering a per-app question from series would describe one app as though it covered the whole company: read apps to see what exists, then pass app_id to get that app's own observations. The summary carries no observations by design — 140 apps' history would flood the context. app_id is null on rows predating per-app keying (the platform is known, the app is not), and an unknown app_id returns available_app_ids rather than an empty series

  • 🏛️ insider_transactions_by_ticker, government_contracts_by_ticker, corporate_lobbying_by_ticker, and patent_filings_by_ticker rows carry cik — the company's SEC Central Index Key as of the record, a 10-digit zero-padded string ("0000320193"; keep it text, the leading zeros are part of the identifier), null when the record has no entity resolution. Use it to join rows to SEC-keyed datasets (EDGAR filings, 13F holdings) or a security master

  • 🔑 Provide your API key via the FINBRAIN_API_KEY environment variable (a shell env var or your MCP client's env block)


Install

Option A — Standard install (pip)

# macOS / Linux / Windows
pip install --upgrade finbrain-mcp

Option B — Dev install (editable)

# from repo root
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\activate
pip install -e ".[dev]"

Keep pip (prod) and your venv (dev) separate to avoid path mix-ups.

Option C — Docker

# Build the image
docker build -t finbrain-mcp:latest .

# Run with your API key
docker run --rm -e FINBRAIN_API_KEY="YOUR_KEY" finbrain-mcp:latest

See DOCKER.md for detailed Docker usage instructions.


Configure your FinBrain API key

Put the key directly in the MCP server entry your client uses (Claude Desktop or a VS Code MCP extension). This guarantees the launched server sees it, even if system env vars aren’t picked up.

Claude Desktop (pip install)

{
  "mcpServers": {
    "finbrain": {
      "command": "finbrain-mcp",
      "env": { "FINBRAIN_API_KEY": "YOUR_KEY" }
    }
  }
}

B) Environment variable

This works too, but note you must restart the client after setting it so the new value is inherited.

# macOS/Linux
export FINBRAIN_API_KEY="YOUR_KEY"

# Windows (PowerShell, current session)
$env:FINBRAIN_API_KEY="YOUR_KEY"

# Windows (persistent for new processes)
setx FINBRAIN_API_KEY "YOUR_KEY"
# then fully quit and reopen your MCP client (e.g., Claude Desktop)

Tip: If the env var route doesn’t seem to work (common on Windows if the client was already running), use the config JSON env method above—it’s more deterministic.


Run the server

Note: You typically don’t need to run the server manually—your MCP client (Claude/VS Code) starts it automatically. Use the commands below only for manual checks or debugging.

  • If installed (pip):

    finbrain-mcp

  • From a dev venv:

    python -m finbrain_mcp.server

Quick health check without an MCP client:

python - <<'PY'
import json
from finbrain_mcp.tools.health import health
print(json.dumps(health(), indent=2))
PY

Connect an AI client

No manual start needed: Claude Desktop and VS Code will launch the MCP server for you based on your config. You only need to run finbrain-mcp yourself for quick sanity checks or debugging.

Claude Desktop

Edit your config:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

Pip install (published package):

{
  "mcpServers": {
    "finbrain": {
      "command": "finbrain-mcp",
      "env": { "FINBRAIN_API_KEY": "YOUR_KEY" }
    }
  }
}

macOS tip (full path):

If "command": "finbrain-mcp" doesn’t work, find the absolute path and use that instead.

which finbrain-mcp    # macOS/Linux
# (Windows: where finbrain-mcp)

Claude config with full path (macOS example):

{
  "mcpServers": {
    "finbrain": {
      "command": "/full/path/to/finbrain-mcp",
      "env": { "FINBRAIN_API_KEY": "YOUR_KEY" }
    }
  }
}

Dev venv (run the module explicitly):

{
  "mcpServers": {
    "finbrain-dev": {
      "command": "C:\\Users\\you\\path\\to\\repo\\.venv\\Scripts\\python.exe",
      "args": ["-m", "finbrain_mcp.server"],
      "env": { "FINBRAIN_API_KEY": "YOUR_KEY" }
    }
  }
}

Docker:

{
  "mcpServers": {
    "finbrain": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "finbrain-mcp:latest"],
      "env": { "FINBRAIN_API_KEY": "YOUR_KEY" }
    }
  }
}

After editing, quit & reopen Claude.

VS Code (MCP)

  1. Open the Command Palette → “MCP: Open User Configuration”.
    This opens your mcp.json (user profile).

  2. Add the server under the servers key:

    {
      "servers": {
        "finbrain": {
          "command": "finbrain-mcp",
          "env": { "FINBRAIN_API_KEY": "YOUR_KEY" }
        }
      }
    }
  3. In Copilot Chat, enable Agent Mode to use MCP tools.


What can you ask the agent?

You don’t need to know tool names—just ask in plain English. Examples:

  • Predictions

    • “Get FinBrain’s daily predictions for AMZN.”

    • “Show monthly predictions (12-month horizon) for AMZN.”

    • “Get market-wide daily predictions for S&P 500 tickers.”

  • News

    • “Get recent news articles for AMZN.”

    • “What’s the news sentiment for AMZN from 2025-01-01 to 2025-03-31 (limit 50)?”

    • “Show me the latest news across all S&P 500 stocks.”

  • App ratings

    • “Fetch app store ratings for AMZN between 2025-01-01 and 2025-06-30.”

  • Analyst ratings

    • “List analyst ratings for AMZN in Q1 2025.”

  • Congressional trades

    • “Show recent House trades involving AMZN.”

    • “Show recent Senate trades involving META.”

    • “For NVDA House trades, how long did each member take to disclose the trade?”

    • “Which recent Senate trades were made through a spouse or joint account?”

  • Corporate lobbying

    • “Show corporate lobbying filings for AAPL.”

    • “What lobbying firms has MSFT used in 2024 (from 2024-01-01 to 2024-12-31)?”

  • Insider transactions

    • “Recent insider transactions for AMZN?”

  • LinkedIn metrics

    • “Get LinkedIn employee & follower counts for AMZN (last 12 months).”

  • Options (put/call)

    • “What’s the put/call ratio for AMZN over the last 60 days?”

  • Reddit mentions

    • “Show Reddit mentions for TSLA over the last week.”

    • “Which subreddits are talking about AAPL the most?”

  • Government contracts

    • “Show government contracts awarded to LMT in 2025.”

    • “Which companies have the largest government contract awards?”

  • Patent filings

    • “Show recent patent filings for AAPL.”

    • “Which companies have the most granted patents lately?”

  • Screeners (cross-ticker)

    • “Screen sentiment across S&P 500 stocks.”

    • “Show the latest analyst ratings across all stocks.”

    • “Screen insider trades across all tickers (limit 50).”

    • “Screen LinkedIn data for US region stocks.”

    • “What are the most mentioned tickers on Reddit right now?”

    • “Which companies are filing the most patents right now?”

  • Availability

    • “Which markets are available?”

    • “List tickers in the daily predictions universe.”

    • “Show available regions and their markets.”

Notes

  • Date format: YYYY-MM-DD.

  • Time-series endpoints return the most recent N points by default—say “limit 200” to get more.

  • Predictions horizon: daily (10-day) or monthly (12-month).

  • Say “as CSV” to receive CSV instead of JSON.

  • No need to specify a market—just use the ticker symbol directly.


Development

# setup
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\activate
pip install -e ".[dev]"  # run tests pytest -q

Project structure (high level)

finbrain-mcp
├─ README.md
├─ pyproject.toml
├─ LICENSE
├─ .github/
├─ examples/
├─ src/
│  └─ finbrain_mcp/
│     ├─ __init__.py
│     ├─ server.py                # MCP server entrypoint
│     ├─ registry.py              # FastMCP instance
│     ├─ client_adapter.py        # wraps finbrain-python; caches SDK client; calls normalizers
│     ├─ auth.py                  # resolves API key (env var)
│     ├─ utils.py                 # helpers (latest_slice, CSV, DF->records)
│     ├─ normalizers/             # endpoint-specific shapers
│     └─ tools/                   # MCP tool functions (registered & testable)
└─ tests/                         # pytest suite with a fake SDK

Troubleshooting

  • ENOENT (can’t start server)

    • Wrong path in client config. Use the venv’s exact path:

      • …\.venv\Scripts\python.exe + ["-m","finbrain_mcp.server"], or

      • …\.venv\Scripts\finbrain-mcp.exe

  • FinBrain API key not configured

    • Put FINBRAIN_API_KEY in the client’s env block or

    • setx FINBRAIN_API_KEY "YOUR_KEY" and fully restart the client.

  • Mixing dev & prod installs

    • Keep pip (prod) and venv (dev) separate.

    • In configs, point to one or the other—not both.


License

MIT (see LICENSE).


Acknowledgements

  • Built on Model Context Protocol and FastMCP.

  • Uses the official finbrain-python SDK.


© 2026 FinBrain Technologies — Built with ❤️ for the quant community.

Available Tools

33 tools
analyst_ratings_by_tickerC

Normalized analyst ratings: { format: "json", ticker, name, series: [{date, rating_type, institution, signal, target_price_from, target_price_to, target_price_raw}, ...], series_count, series_total } CSV returns the sliced series.

Inputs: req (required).

app_ratings_by_tickerC

Normalized app ratings with paging over series. JSON: { format: "json", ticker, name, series: [{date, play_store_score, play_store_ratings_count, app_store_score, app_store_ratings_count, play_store_install_count}, ...], series_count, series_total } CSV: CSV text of the sliced series.

Inputs: req (required).

available_marketsB

List available markets (e.g., 'S&P 500').

Inputs: no named parameters. Returns: result

available_regionsA

List markets grouped by region. Use region codes for filtering in other endpoints.

Inputs: no named parameters.

available_tickersC

List available tickers for a dataset.

Inputs: req (required).

corporate_lobbying_by_tickerC

Normalized corporate lobbying filings: { format: "json", ticker, name, series: [{date, filing_uuid, filing_year, quarter, client_name, registrant_name, income, expenses, issue_codes, government_entities, cik}, ...], series_count, series_total } CSV returns the sliced series.

Inputs: req (required).

government_contracts_by_tickerB

U.S. government contract awards for a single ticker: { format: "json", ticker, name, series: [{award_id, award_amount, award_type, awarding_agency, awarding_sub_agency, recipient_name, start_date, end_date, description, naics_code, naics_description, contract_award_type, cik}, ...], series_count, series_total } CSV returns the sliced series.

Inputs: req (required).

healthA

Basic server health & version info. Tries to resolve the API key and construct the SDK client (no network call), then returns versions.

Inputs: no named parameters. Returns: object

house_trades_by_tickerD

Normalized US House trades: { format: "json", ticker, name, series: [{date, representative, trade_type, amount_min, amount_max, amount_exact, amount_raw, disclosure_date, owner, amount_as_filed, amount_flag}, ...], series_count, series_total } date is the transaction date; disclosure_date is when the trade was publicly disclosed in the member's periodic transaction report. The gap between them is the reporting lag. owner is the beneficial owner of the traded account: "SELF", "SP" (spouse), "DC" (dependent child), "JT" (joint), or an account code; blank House filings report as "SELF". owner and disclosure_date are nullable, though rare — historical rows were backfilled upstream. amount_raw is the amount string as served by the API, normalized to a statutory STOCK Act bracket when the filed string is an unambiguous variant of one; amount_as_filed then preserves the original filing. amount_flag is "review" or "ambiguous" when the filed amount could not be safely normalized (amount_raw keeps the filed string, or "Unknown"); both are null on all other rows. CSV returns the sliced series.

Inputs: req (required).

insider_transactions_by_tickerC

Normalized insider transactions with paging over series. JSON: { format: "json", ticker, name, series: [{date, insider_name, relationship, transaction_type, price, shares, usd_value, total_shares, sec_form4_date, sec_form4_link, cik}, ...], series_count, series_total } CSV: sliced series as CSV.

Inputs: req (required).

linkedin_metrics_by_tickerC

Normalized LinkedIn metrics: JSON: { format: "json", ticker, name, series: [{date, employee_count, followers_count}, ...], # paged series_count, series_total } CSV: CSV text of the sliced series.

Inputs: req (required).

news_by_tickerB

Returns recent news articles for a ticker: { format: "json", ticker, name, series: [{date, headline, source, url}, ...] (paged), series_count, series_total } If format="csv", returns CSV of the sliced series.

Inputs: req (required).

news_sentiment_by_tickerC

Returns normalized sentiment: { format: "json", ticker, name, series: [{date, score}, ...] (paged), series_count, series_total } If format="csv", returns CSV of the sliced series.

Inputs: req (required).

options_put_callC

Normalized options put/call time series. JSON: { format: "json", ticker, name, series: [{date, put_call_ratio, call_count, put_count}, ...], # paged series_count, series_total } CSV: CSV text of the sliced series.

Inputs: req (required).

patent_filings_by_tickerC

USPTO granted patents mapped to a single ticker by corporate assignee: { format: "json", ticker, name, series: [{patent_id, patent_date, title, type, kind, num_claims, num_cited_by, assignee_organization, assignee_type, application_filing_date, filing_to_grant_days, inventors, num_inventors, cpc_sections, cpc_subsections, primary_cpc_section, cik}, ...], series_count, series_total } CSV returns the sliced series.

Inputs: req (required).

predictions_by_marketC

Screener-based market predictions (flat rows with expected_* percentages). Filters by market name or region.

Inputs: req (required).

predictions_by_tickerC

Normalized ticker prediction with a time series: { ticker, name, type, last_update, expected_short/mid/long, series: [{date, mid, low, high}, ...], }

Inputs: req (required).

recent_analyst_ratingsC

Get the most recent analyst ratings across all tracked stocks. Returns rows with ticker, name, date, institution, rating_type, signal, target_price.

Inputs: req (required).

recent_newsB

Get the most recent news articles across all tracked stocks. Returns rows with ticker, name, date, headline, source, url.

Inputs: req (required).

reddit_mentions_by_tickerC

Reddit mention counts across subreddits for a single ticker: { format: "json", ticker, name, series: [{date, subreddit, mentions}, ...], series_count, series_total } CSV returns the sliced series.

Inputs: req (required).

screener_analyst_ratingsC

Screen analyst ratings across tickers. Returns rows with ticker, name, date, institution, rating_type, signal, target_price.

Inputs: req (required).

screener_app_ratingsA

Screen app ratings across tickers by market or region. Returns rows with ticker, name, date, app_store_score, play_store_score. Either market or region is required.

Inputs: req (required).

screener_government_contractsA

Screen U.S. government contract awards across all tickers. Returns rows with ticker, name, award_id, award_amount, recipient_name, start_date, awarding_agency, naics_description, plus a summary with aggregate stats (total_contracts, total_tickers, total_value).

Inputs: req (required).

screener_house_tradesA

Screen House of Representatives trades across all tickers. Returns rows with ticker, name, date, politician, trade_type, amount, disclosure_date (public disclosure date) and owner (beneficial owner of the account: "SELF", "SP", "DC", "JT", or an account code). owner and disclosure_date are nullable, though rare — historical rows were backfilled upstream.

Inputs: req (required).

screener_insider_tradingA

Screen insider trades across all tickers. Returns rows with ticker, name, date, insider_name, relationship, transaction_type, shares, total_value.

Inputs: req (required).

screener_linkedinA

Screen LinkedIn data across tickers by market or region. Returns rows with ticker, name, date, employee_count, followers_count, job_count. Either market or region is required.

Inputs: req (required).

screener_newsC

Screen news across tickers. Returns rows with ticker, name, date, headline, source, url.

Inputs: req (required).

screener_patent_filingsA

Screen USPTO granted patents across all tickers. Returns rows with ticker, name, patent_id, patent_date, title, type, assignee_organization, primary_cpc_section, num_claims, plus a summary with aggregate stats (total_patents, total_tickers, top_cpc_sections).

Inputs: req (required).

screener_put_call_ratioB

Screen put/call ratio across tickers. Returns rows with ticker, name, date, put_call_ratio, call_count, put_count.

Inputs: req (required).

screener_reddit_mentionsA

Screen Reddit mentions across tickers. Returns rows with ticker, name, date, total_mentions, subreddits, plus a summary with aggregate stats (top_mentioned, subreddit_names, etc.).

Inputs: req (required).

screener_senate_tradesA

Screen Senate trades across all tickers. Returns rows with ticker, name, date, politician, trade_type, amount, disclosure_date (public disclosure date) and owner (beneficial owner of the account: "SELF", "SP", "DC", "JT", an account code, or "UNKNOWN" for blank Senate filings). owner and disclosure_date are nullable, though rare — historical rows were backfilled upstream.

Inputs: req (required).

screener_sentimentA

Screen sentiment across tickers by market or region. Returns rows with ticker, name, date, score. Either market or region is required.

Inputs: req (required).

senate_trades_by_tickerC

Normalized US Senate trades: { format: "json", ticker, name, series: [{date, senator, trade_type, amount_min, amount_max, amount_exact, amount_raw, disclosure_date, owner, amount_as_filed, amount_flag}, ...], series_count, series_total } date is the transaction date; disclosure_date is when the trade was publicly disclosed in the member's periodic transaction report. The gap between them is the reporting lag. owner is the beneficial owner of the traded account: "SELF", "SP" (spouse), "DC" (dependent child), "JT" (joint), an account code, or "UNKNOWN" for blank Senate filings. owner and disclosure_date are nullable, though rare — historical rows were backfilled upstream. amount_raw is the amount string as served by the API, normalized to a statutory STOCK Act bracket when the filed string is an unambiguous variant of one; amount_as_filed then preserves the original filing. amount_flag is "review" or "ambiguous" when the filed amount could not be safely normalized (amount_raw keeps the filed string, or "Unknown"); both are null on all other rows. CSV returns the sliced series.

Inputs: req (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 33 tools

    Disambiguation4/5

    The by_ticker, screener_, recent_, and available_ prefixes give most tools a clear scope, so the majority are unambiguous. A few pairs like options_put_call vs screener_put_call_ratio and news_by_ticker vs recent_news need closer attention, but the descriptions resolve the intended use.

    Naming Consistency4/5

    Names mostly follow a consistent pattern of resource plus scope prefix/suffix, such as available_*, *_by_ticker, screener_*, and recent_*. The exceptions are minor but visible: options_put_call lacks a by_ticker suffix, and insider_transactions_by_ticker jumps to screener_insider_trading.

    Tool Count3/5

    At 33 tools, this server is on the heavy side, largely because most datasets are exposed both as per-ticker endpoints and as screener endpoints. The count is not unreasonable for the broad financial-data domain, but it sits near the limit of what is easy to navigate.

    Completeness4/5

    The server provides discovery, per-ticker data, recent items, and screeners across a wide array of financial and alternative-data categories. Obvious gaps are minor: there is no screener for corporate lobbying, and a few category axes (market, region, ticker) are not applied uniformly across all tools.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Provides structured financial market data (stocks, ETFs, mutual funds, fundamentals, market indicators) to AI systems via MCP, enabling natural language access to financial datasets with both hosted and local deployment options.
      31
      287 npm
      1
      ISC
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and backend integrations to access A-share, US equity, ETF, index, and crypto market data, technical indicators, fundamentals, money flow, filings, and news through MCP tools and standardized APIs.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and backend workflows to access standardized multi-market financial data, technical indicators, fundamentals, news, filings, money flow, and CSV/JSON exports through MCP tools and HTTP endpoints.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to access and analyze financial data, stock information, company fundamentals, and market insights through a standardized MCP interface. It provides 250+ tools across categories such as financial statements, quotes, technical indicators, ETFs, crypto, forex, commodities, economics, and SEC filings.
      624 npm
      Apache 2.0