FinBrain MCP
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 entrypoints:
finbrain-mcp,finbrain-mcp-login
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, or OS keyring
Install
Option A — Isolated install (recommended)
# macOS/Linux
pipx install finbrain-mcp
pipx upgrade finbrain-mcp
# from repo root
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\activate
pip install -e ".[dev]"
Keep pipx (prod) and your venv (dev) separate to avoid path mix-ups.
Configure your FinBrain API key
A) In your MCP client config (recommended / most reliable)
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/pipx 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
envmethod above—it’s more deterministic.
Run the server
-
If installed (pipx/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
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
Pipx install (published package):
{
"mcpServers": {
"finbrain": {
"command": "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" }
}
}
}
Tip: You can omit the
envblock if you usedfinbrain-mcp-login.
After editing, quit & reopen Claude.
VS Code (MCP-capable extensions)
Most accept a similar JSON:
{
"mcpServers": {
"finbrain": {
"command": "finbrain-mcp",
"env": { "FINBRAIN_API_KEY": "YOUR_KEY" }
}
}
}
Using the tools
All tools return JSON by default and support paging; many also support CSV via format="csv".
Availability
-
available_markets() → list[str] -
available_tickers({ "dataset": "predictions" }) → [{"ticker": "...", "name": "...", "market": "..."}]
Predictions
-
predictions_by_market({ "market": "S&P 500", "limit": 100 })
Returns the latest rows (sorted bylast_update) with flat fields:expected_short|mid|long,sentiment_score,last_update,type, … -
predictions_by_ticker({ "ticker": "AMZN", "prediction_type": "daily" })
Or"monthly"for 12-month horizon. Returns metadata +
series: [{date, mid, low, high}]andsentiment: [{date, score}].
Sentiment
-
news_sentiment_by_ticker({ "market": "S&P 500", "ticker": "AMZN", "limit": 30 })series: [{date, score}]
App Ratings
-
app_ratings_by_ticker({ "market": "S&P 500", "ticker": "AMZN", "limit": 50 })series: [{date, play_store_score, play_store_ratings_count, app_store_score, app_store_ratings_count, play_store_install_count}]
Analyst Ratings
-
analyst_ratings_by_ticker({ "market": "S&P 500", "ticker": "AMZN" })series: [{date, rating_type, institution, signal, target_price_from, target_price_to, target_price_raw}]
House Trades
-
house_trades_by_ticker({ "market": "S&P 500", "ticker": "AMZN" })series: [{date, representative, trade_type, amount_min, amount_max, amount_exact, amount_raw}]
Insider Transactions
-
insider_transactions_by_ticker({ "market": "S&P 500", "ticker": "AMZN" })series: [{date, date_raw, insider_name, relationship, transaction_type, price, shares, usd_value, total_shares, sec_form4_date, sec_form4_datetime, sec_form4_link}]
-
linkedin_metrics_by_ticker({ "market": "S&P 500", "ticker": "AMZN" })series: [{date, employee_count, followers_count}]
Options (Put/Call)
-
options_put_call({ "market": "S&P 500", "ticker": "AMZN" })series: [{date, put_call_ratio, call_count, put_count}]
Most tools accept
offset&limit, andformat: "csv"to get CSV text of the sliced series.
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)
src/finbrain_mcp/
server.py # MCP server entrypoint
registry.py # FastMCP instance
client_adapter.py # wraps finbrain-python and normalizes outputs
auth.py # resolves API key (env/file/keyring)
utils.py # generic helpers (paging, CSV, DF->records) normalizers/ # endpoint-specific shapers
tools/ # MCP tool functions (registered & testable)
tests/ # pytest suite with a fake SDK
examples/ # sample client configs
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_KEYin the client’senvblock or -
Run
finbrain-mcp-login(installkeyringif missing) or -
setx FINBRAIN_API_KEY "YOUR_KEY"and fully restart the client.
-
-
Mixing dev & prod installs
-
Keep pipx (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-pythonSDK.
© 2025 FinBrain Technologies — Built with ❤️ for the quant community.
Metadata
Release files for finbrain-mcp 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| finbrain_mcp-0.0.0.tar.gz | 20.7 kB | With provenance | Details for finbrain_mcp-0.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| finbrain_mcp-0.0.0-py3-none-any.whl | Python 3 | none | any | Details for finbrain_mcp-0.0.0-py3-none-any.whl |
Total release size: 46.6 kB
Release files / finbrain_mcp-0.0.0.tar.gz
| Download URL | finbrain_mcp-0.0.0.tar.gz |
|---|---|
| Size | 20.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ac850611bfdf833f7f7309a6033e83c972c576da85098dd42df91987e8d361e
|
|
BLAKE2b-256 checksum How to use checksums |
885774386981141643979bd63d5181b8602dad4fcc09e81d21d1a844b8c2f694
|
| 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 18, 2025.
Transparency logRelease files / finbrain_mcp-0.0.0-py3-none-any.whl
| Download URL | finbrain_mcp-0.0.0-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8afb9b3a14d47bb06aa8d57ae18ed5ac0d003141c890300c13b9c07052bcb06
|
|
BLAKE2b-256 checksum How to use checksums |
d992baf7af66819fa703dd93e9e0b15c68c22a95d1c9d8a81d0c7165be4ec9f6
|
| 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 18, 2025.
Transparency logSecurity for finbrain-mcp 0.0.0
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.
Attestation for finbrain_mcp-0.0.0.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 18, 2025.
Transparency logA 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.