Skip to main content

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.

  • Package name: finbrain-mcp

  • CLI entrypoint: finbrain-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

    • predictions_by_market, predictions_by_ticker

    • news_sentiment_by_ticker

    • app_ratings_by_ticker

    • analyst_ratings_by_ticker

    • house_trades_by_ticker

    • insider_transactions_by_ticker

    • linkedin_metrics_by_ticker

    • options_put_call

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

  • 🔑 Multiple ways to provide your API key: env var, file


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.


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": "/usr/local/bin/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" }
    }
  }
}

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" }
    }
  }
}
  1. 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.”
  • News sentiment

    • “What’s the news sentiment for AMZN from 2025-01-01 to 2025-03-31 (limit 50)?”
    • “Export AMZN news sentiment for 2025 YTD as CSV.”
  • 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.”
  • House trades

    • “Show recent House trades involving AMZN.”
  • 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?”
  • Availability

    • “Which markets are available?”
    • “List tickers in the daily predictions universe.”

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.

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; calls normalizers
│     ├─ auth.py                  # resolves API key (env var)
│     ├─ settings.py              # tweakable defaults (e.g., series limits)
│     ├─ 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.


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

Metadata

Release files for finbrain-mcp 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for finbrain-mcp 0.1.4
File Size Uploaded Provenance Actions
finbrain_mcp-0.1.4.tar.gz 25.9 kB With provenance Details for finbrain_mcp-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for finbrain-mcp 0.1.4
File Interpreter ABI Platform Actions
finbrain_mcp-0.1.4-py3-none-any.whl Python 3 none any Details for finbrain_mcp-0.1.4-py3-none-any.whl

Total release size: 52.1 kB

Release files / finbrain_mcp-0.1.4.tar.gz

Download URL finbrain_mcp-0.1.4.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
21c07ff36b5ff25fe1b203267f38107f3411c4a1c56a639710055ee37e75bdfe
BLAKE2b-256 checksum
How to use checksums
4d94e09f29f9dc28b658ddd6ce58776357e48f76c19a582142ce8c5da105b040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2025.

Transparency log

Release files / finbrain_mcp-0.1.4-py3-none-any.whl

Download URL finbrain_mcp-0.1.4-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65413cbabdd37a9fec29d5285f81c8b2df7fddb20946ae849f119653032ec50a
BLAKE2b-256 checksum
How to use checksums
02544936da762c9f3fe512d6e51e1d257fad79d7b78d0ef9b3a7d18472eff912
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2025.

Transparency log

Security for finbrain-mcp 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for finbrain_mcp-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page