Finance MCP README

The full upstream README, mirrored for reference. Install config, tool schemas, adoption signals and our own overview live on the Finance MCP listing page.

unified-finance-mcp

CI PyPI version Python License: MIT

One MCP server for finance data: Yahoo Finance, TradingView, FMP, Alpha Vantage, marketaux, crypto-exchange USDT perpetuals (Bitget/Gate/MEXC over public REST, plus OKX/Binance via TradingView), Futu OpenD and the Kimi Datasource meta-source behind a single tool surface, with market-aware auto-routing across sources. auto means the model stops choosing providers: ask for a quote, a financial statement or an option chain and the server picks the sources that cover that market, tries them in chain order, and returns the first non-empty answer — the model calls one tool, not four.

Contents

Features

SurfaceToolsNotes
Unified domain tools14Cross-source tools with a source parameter — auto routes by market coverage, or pin one source explicitly. Per-symbol indicator queries (options / short / analyst / dividends / earnings) share one container: get_symbol_intel(kind=…)
TradingView containers3tv_scan, tv_analyze, egx_market — scanner/analysis containers selected by action (unknown actions return the available list)
CEX container1cex_market — crypto-exchange USDT-settled perpetuals on Bitget/Gate/MEXC/OKX/Binance: quote/kline/summary/funding/open_interest/exchanges/symbols by action. TradingView (screener=crypto) for quote/summary, exchange REST for kline/funding/OI
Futu OpenD mount53All futu-opend-mcp tools mounted alongside the unified ones when OpenD is configured. FINANCE_MCP_FUTU_MOUNT_LAYOUT=grouped folds them into 6 market-analysis containers + 1 on-demand reference container (action=list/describe/call), shrinking the surface from 76 to 30 tools
L2 self-describing containers2quant_backtest and kimi_datasource keep secondary functionality out of the primary tool list; call with action='help' / action='list' to discover them
Diagnostics1get_service_status reports provider availability, coverage and mounted tool counts (read-only, no network I/O)

Data sources: Yahoo Finance · TradingView · FMP · Alpha Vantage · marketaux · Bitget / Gate / MEXC (USDT-settled perpetuals, public REST — OKX/Binance quotes via TradingView) · Futu OpenD · SEC EDGAR · US Treasury (par yield curve + Fiscal Data) · World Bank / IMF · BLS (monthly backup + BLS:<seriesId> detail) · Kimi Datasource (tianyancha CN company data, S&P Capital IQ, gildata screener data, and more).

SEC EDGAR and the Treasury/Fiscal Data endpoints are keyless; SEC only requires a declared user agent (SEC_EDGAR_USER_AGENT).

The unified tools accept futu (HK.00700), Yahoo (0700.HK, COMI.CA) and TradingView (EGX:COMI) symbol forms; bare tickers default to US.

Architecture

unified-finance-mcp architecture

One server, two faces: the 23 unified tools route through a market-aware auto-router to the external providers (solid lines; cex_market additionally reaches the crypto exchanges' public REST endpoints directly), while the 53 mounted futu-opend-mcp tools attach directly to a running Futu OpenD gateway (dashed; shown in the default flat layout — grouped folds them into 6 market-analysis containers + 1 on-demand reference container, 30 tools total). Badges 1–9 on the tool boxes map to the routing chains in the legend. Editable source: docs/architecture.drawio.

Install

Requires Python ≥ 3.10.

bash
uvx unified-finance-mcp          # ephemeral run (uv)
pipx install unified-finance-mcp # persistent install
pip install unified-finance-mcp  # classic install

The console entry point is unified-finance-mcp. By default it serves stdio (MCP client spawns it directly); --transport http serves streamable HTTP with a /health endpoint.

Configuration

All configuration is via environment variables. The server's own knobs use the FINANCE_MCP_* prefix; third-party credentials keep their vendor names. Every key is optional — each provider activates only when its credential is present, and auto-routing skips unavailable sources.

Core (all providers)

VariablePurposeDefault
FINANCE_MCP_TRANSPORTstdio or http (or CLI --transport)stdio
FINANCE_MCP_HOSTHTTP listen host (or CLI --host)127.0.0.1
FINANCE_MCP_PORTHTTP listen port (or CLI --port)8000
FINANCE_MCP_REQUEST_TIMEOUTPer-source request timeout (seconds)20
FINANCE_MCP_MAX_RETRIESHTTP retry count3
FINANCE_MCP_MIN_HOST_DELAYMinimum delay between requests to one host (seconds)0.5
FINANCE_MCP_FUTU0 disables the Futu OpenD mount entirelytrue
FINANCE_MCP_FUTU_MOUNT_LAYOUTflat mounts all 53 futu-opend-mcp tools side-by-side; grouped folds them into 6 market-analysis futu_* containers + 1 on-demand futu_reference container (action=list/describe/call), 76 → 30 toolsflat
FINANCE_MCP_CEX0 disables the cex_market containertrue
FINANCE_MCP_CEX_EXCHANGESComma-separated whitelist for cex_market (failover order)bitget,gate,mexc
FINANCE_MCP_CEX_PRODUCTBitget product type for candle requestsUSDT-FUTURES
FINANCE_MCP_CEX_TV_SCREENERTradingView screener slug for the CEX quote/summary pathcrypto

FMP

Free API key: https://site.financialmodelingprep.com/register

VariablePurposeDefault
FMP_API_KEYFMP API key—
FMP_BASE_URLFMP endpoint override; point it at your multi-key rotator, e.g. http://api-key-rotator:8788/fmphttps://financialmodelingprep.com

Alpha Vantage

Free API key: https://www.alphavantage.co/support/#api-key

VariablePurposeDefault
ALPHAVANTAGE_API_KEYAlpha Vantage API key—
ALPHAVANTAGE_BASE_URLEndpoint override (rotator-friendly), e.g. http://api-key-rotator:8788/alphavantagehttps://www.alphavantage.co

marketaux

Free API token: https://www.marketaux.com/register

VariablePurposeDefault
MARKETAUX_API_TOKENmarketaux news API token—
MARKETAUX_BASE_URLEndpoint override (rotator-friendly), e.g. http://api-key-rotator:8788/marketauxhttps://api.marketaux.com

Native macro (World Bank / IMF / BLS keyless + optional FRED)

World Bank, IMF and BLS sub-endpoints are keyless (always on). FRED unlocks monthly-frequency US series (CPI index, fed funds, 10Y yield, payrolls, retail sales) when configured.

BLS backs up CPI / UNEMPLOYMENT / NONFARM_PAYROLL with monthly data when FRED_API_KEY is absent. api.bls.gov answers 403 to the default (London) egress but 200 to a US egress, so two transports exist: set BLS_PROXY_URL (a US HTTP proxy) and BLS is fetched directly; without it, the Jina Reader (r.jina.ai, keyless ~20 RPM, JINA_API_KEY → 500 RPM) fetches the same keyless GET endpoint. Both need no BLS key. Set JINA_READER_URL= (empty) to disable the reader entirely.

Two surfaces share the FRED key: get_economic_data covers the 8 canonical indicators with keyless World Bank/IMF/BLS fallbacks; get_fred_series / search_fred_series expose any of the 800k+ FRED series by raw series_id (no fallbacks — FRED only, e.g. get_fred_series("DEXJPUS")).

Free API key (5-minute registration): https://fredaccount.stlouisfed.org/apikeys

VariablePurposeDefault
FRED_API_KEYFRED API key (optional; without it macro falls back to keyless World Bank/IMF, and the *fred* tools stay off)—
WORLD_BANK_BASE_URL / IMF_BASE_URL / FRED_BASE_URL / BLS_BASE_URLEndpoint overrides (mirror/rotator-friendly)official hosts
BLS_PROXY_URLPer-host HTTP proxy for BLS only (a US egress passes Akamai; empty = use the reader)—
JINA_READER_URLReader used for BLS when no proxy is set (empty string disables it)https://r.jina.ai
JINA_API_KEYOptional reader key: 20 RPM keyless → 500 RPM—
ECB_BASE_URL / OECD_BASE_URL / EUROSTAT_BASE_URLReserved for tombstoned SDMX follow-up providers (not wired)official hosts

SEC EDGAR + US Treasury (keyless)

Both are free with no registration. SEC only requires a declared user agent: a UA containing github.com is answered with 403 "Undeclared Automated Tool" (measured 2026-11-18), which is why the EDGAR provider does not reuse the library UA. Set a contact address to stay inside SEC's fair-access policy; the site-wide ceiling is 10 req/s and the server paces at 2 req/s.

Treasury is two hosts: the par yield curve is a CSV export on home.treasury.gov, Fiscal Data is the JSON API on api.fiscaldata.treasury.gov.

VariablePurposeDefault
SEC_EDGAR_USER_AGENTDeclared UA, e.g. "unified-finance-mcp you@example.com". Do not put github.com in it.unified-finance-mcp
SEC_EDGAR_BASE_URL / SEC_EDGAR_TICKERS_URLEndpoint overrides (mirror-friendly)data.sec.gov / www.sec.gov/files/company_tickers.json
TREASURY_YIELD_CSV_URL / TREASURY_FISCAL_BASE_URLEndpoint overridesofficial hosts

Eastmoney (CN A-share, keyless)

Keyless public JSON endpoints (push2 / push2his / searchapi) — CN-market chain head for get_quote / get_history. No key required, no key field exists; base overrides exist for testing/mirroring only.

VariablePurposeDefault
EASTMONEY_QUOTE_BASE_URL / EASTMONEY_HISTORY_BASE_URL / EASTMONEY_SEARCH_BASE_URLEndpoint overridesEM public hosts

Kimi Datasource

Auth resolution order: KIMI_PROXY_URL → KIMI_ACCESS_TOKEN → KIMI_AUTH_FILE. Exactly one way needs to be configured for the kimi tools to activate.

VariablePurposeDefault
KIMI_PROXY_URLPrimary. URL of a proxy that injects credentials for you — e.g. the CLIProxyAPI cliproxy-kimi-tools plugin at http://cli-proxy-api:8317/v0/management/kimi/tools, or a standalone kimi-datasource-proxy container. When KIMI_ACCESS_TOKEN is also set, it is sent as Authorization: Bearer … (the CLIProxyAPI management key) and the proxy strips it before talking to Kimi.—
KIMI_AUTH_FILEFallback. Path (or glob) to a cliproxy kimi credential JSON, e.g. /mnt/docker/cliproxy/auths/kimi-*.json — the first file with disabled != true is used; the client self-refreshes the token when it expires—
KIMI_ACCESS_TOKENFallback (direct). A Kimi Code token used directly against KIMI_BASE_URL, with no refresh logic. With KIMI_PROXY_URL set: doubles as the proxy's management key (see above).—
KIMI_BASE_URLUpstream endpoint used with the two fallback pathshttps://api.kimi.com/coding/v1/tools
KIMI_FILES_DIRWhere datasource result files are written/tmp/unified_finance_mcp

Source-level discipline (adjudicated in docs/research/kimi-sources/): ~30 mirror-mode sources (world_bank, fred, pubmed, …) are blocked with a free-official-endpoint hint; wind/sp_data pass only their gap-class APIs; caixin traffic is soft-routed at the caixin_call_name parameter — the ~60% of its 687 APIs with free equivalents (quotes/funds/macro/futures/…) are blocked pre-upstream (0 积分 spent) with an alternative hint, while the 8 unique categories (insurance, executive history, environmental, private funds, bond-issuer financials, sentiment index, patents, bank regulatory ratios, industry-chain graphs) pass through.

Futu OpenD (inherited from futu-opend-mcp)

VariablePurposeDefault
FUTU_OPEND_HOSTOpenD gateway host127.0.0.1
FUTU_OPEND_PORTOpenD gateway port11111
FUTU_OPEND_ENCRYPTUse encrypted protocoltrue
FUTU_OPEND_RSA_KEY / FUTU_OPEND_RSA_KEY_FILERSA private key (inline or file) for encrypted OpenD—

Client configuration

Claude Code

bash
# stdio (default transport)
claude mcp add finance -- uvx unified-finance-mcp

# with environment, e.g. your API keys + rotator endpoints
claude mcp add finance \
  --env FMP_API_KEY=<your-fmp-key> \
  --env FMP_BASE_URL=http://api-key-rotator:8788/fmp \
  --env KIMI_PROXY_URL=http://kimi-datasource-proxy:8788/coding/v1/tools \
  --env FUTU_OPEND_HOST=192.168.1.10 \
  -- uvx unified-finance-mcp

# streamable HTTP mode (server started with --transport http)
claude mcp add --transport http finance http://127.0.0.1:8000/mcp

claude_desktop_config.json

config.json
{
  "mcpServers": {
    "finance": {
      "command": "uvx",
      "args": ["unified-finance-mcp"],
      "env": {
        "FMP_API_KEY": "<your-fmp-key>",
        "FMP_BASE_URL": "http://api-key-rotator:8788/fmp",
        "ALPHAVANTAGE_API_KEY": "<your-av-key>",
        "KIMI_PROXY_URL": "http://kimi-datasource-proxy:8788/coding/v1/tools",
        "FUTU_OPEND_HOST": "127.0.0.1"
      }
    }
  }
}

Streamable HTTP (any MCP client)

Start the server:

bash
FINANCE_MCP_TRANSPORT=http unified-finance-mcp --port 8000
# or: unified-finance-mcp --transport http --port 8000

then connect to http://127.0.0.1:8000/mcp (health probe at http://127.0.0.1:8000/health).

Migrating from mcpo (5 servers → 1)

Replace the mcpo-aggregated stack — futu-opend, yfinance, tradingview (wrapped through mcpo) plus FMP and Alpha Vantage over streamable HTTP — with a single unified-finance-mcp entry.

Before (mcpo config, five servers):

config.json
{
  "mcpServers": {
    "futu":        { "command": "uvx", "args": ["futu-opend-mcp"] },
    "yfinance":    { "command": "mcpo", "args": ["--config", "/path/to/yfinance-mcp.json"] },
    "tradingview": { "command": "mcpo", "args": ["--config", "/path/to/tradingview-mcp.json"] },
    "fmp":         { "type": "sse", "url": "http://localhost:8788/fmp" },
    "alphavantage":{ "type": "sse", "url": "http://localhost:8788/alphavantage" }
  }
}

After:

config.json
{
  "mcpServers": {
    "finance": {
      "command": "uvx",
      "args": ["unified-finance-mcp"],
      "env": {
        "FMP_API_KEY": "<your-fmp-key>",
        "FMP_BASE_URL": "http://api-key-rotator:8788/fmp",
        "ALPHAVANTAGE_API_KEY": "<your-av-key>",
        "MARKETAUX_API_TOKEN": "<your-marketaux-token>",
        "KIMI_PROXY_URL": "http://kimi-datasource-proxy:8788/coding/v1/tools",
        "FUTU_OPEND_HOST": "127.0.0.1"
      }
    }
  }
}

The same credentials carry over; yfinance and tradingview need no key (they are backed by yfinance and tradingview-ta/tradingview-screener in-process, which also removes the Python ≥3.14 wrapper constraint mcpo hit).

Tool quick reference

ToolWhat it does
get_quoteLatest snapshot for one or more symbols (futu/yahoo/TV symbol forms)
get_historyOHLCV history; interval 1m–1mo, start/end dates
get_company_infoCompany profile: name, sector, market cap, description
get_financial_reportIncome / balance / cashflow statements, annual or quarterly
get_newsSymbol news, or global headlines with symbol=None
get_technical_indicatorsRatings summary + indicator values (summary or named indicators)
run_screenerScreen stocks by market and numeric filters, sorted and limited
get_ownershipMajor / institutional / mutual-fund holders, insider transactions & summary
get_events_calendarEarnings, dividends, IPO calendar (date range optional)
get_economic_dataMacro series in three vocabularies: the 8 canonical indicators (GDP, CPI, unemployment, …), any World Bank indicator code (NY.GDP.MKTP.CD + country/start/end), or the US Treasury pseudo-indicators TREASURY_YIELD_CURVE (full 1Mo–30Y par curve, period=YYYY-MM) / TREASURY_DEBT / TREASURY_AVG_INTEREST_RATE / TREASURY_MTS_OUTLAYS
get_fred_series / search_fred_seriesAny FRED series by raw series_id + series search (needs FRED_API_KEY)
get_sec_filingSEC EDGAR by ticker or CIK: kind=filings (forms, dates, accession numbers, primary document) or kind=facts (as-reported XBRL concepts for a tag whitelist, each row carrying form/filed/accn). Keyless; set SEC_EDGAR_USER_AGENT
search_symbolsSearch symbols by company name or ticker
get_symbol_intelPer-symbol indicator queries by kind: options (chain at one expiration, calls/puts IV/OI) · short (shares short, days-to-cover, % of float) · analyst (estimates, price targets, recommendations) · dividends (history + next dates) · earnings (EPS est. vs reported + surprise %, limit rows)
get_company_risk_cnCN company risk profile from tianyancha (via kimi)
quant_backtestStrategy backtest container: run / compare / walk_forward; action='help' for the full parameter guide
kimi_datasourceSelf-describing datasource access: action='list' / 'describe' / 'call'
tv_scanTradingView exchange-wide scans (top gainers/losers, volume breakout, …) by action
tv_analyzeTradingView symbol analysis (summary, candle patterns, multi-timeframe, …) by action
egx_marketEgyptian Exchange tools (overview, sector scan, index, screener, trade plan, fibonacci) by action
cex_marketCrypto-exchange USDT-settled perpetuals by action (quote/kline/summary/funding/open_interest/exchanges/symbols). Default whitelist bitget,gate,mexc; okx/binance are TradingView-only (quote/summary) and opted in via FINANCE_MCP_CEX_EXCHANGES. CL here is a USDT PERPETUAL (funding rate, 24/7), NOT CL=F / NYMEX:CL1!
get_service_statusProvider availability/coverage and mounted tool counts (read-only)

Plus the 53 mounted futu-opend-mcp tools (get_snapshot, get_kline, futu_get_option_chain, get_capital_flow, …) for HK/CN/US depth from OpenD — or, with FINANCE_MCP_FUTU_MOUNT_LAYOUT=grouped, seven futu_* containers selected by action=list | describe | call: six market-analysis domains (futu_market, futu_fundamentals, futu_corporate, futu_capital, futu_options, futu_macro) plus futu_reference, which folds everything not market-analysis related (company profile/executives, sector & industry chains, the institution directory and its reverse holdings lookups) out of the primary list and behind one on-demand container.

Development

Terminal
pip install -e ".[dev]"
ruff check .                        # lint
pytest -q -m "not integration"      # unit suite (integration marker needs live APIs/OpenD)

Layout: src/unified_finance_mcp/ — providers/ (Yahoo, TradingView, FMP, Alpha Vantage, marketaux, CEX, Futu bridge, Kimi), tools/ (the 17 tool modules registered from ALL_MODULES, including intel.py = get_symbol_intel, cex.py = cex_market and futu_containers.py = the grouped futu domain containers), config.py (env Settings), http.py (polite per-host rate-limited client).

Release process

  1. Push your changes to main and confirm CI is green (ruff + pytest).
  2. On PyPI, add this repository as a pending trusted publisher (one-time setup).
  3. Tag and push:
bash
git tag v0.1.0 && git push origin v0.1.0

publish.yml builds the wheel/sdist and publishes to PyPI via OIDC trusted publishing (no tokens stored in the repo).

License

MIT