Financial Modeling Prep (fmpsdk)

io.github.daxm由 GitHub 帳號 daxm 發布v20260829.1更新於 Oct 24, 2026

Financial Modeling Prep API as MCP tools — quotes, statements, prices, and ~240 endpoints.

已驗證STDIO僅桌面金融資料與分析

概覽

AI 產生的概覽

本機 MCP 伺服器,透過精選工具與約 240 個端點的探索能力,讓助理查詢 Financial Modeling Prep 的市場與公司資料。

可以做什麼
查詢股票代號的報價、公司概況、財務報表、比率與歷史價格,以及市場新聞等 FMP 資料。使用精選工具處理常見請求,並透過探索工具在執行時存取全部約 240 個方法。回傳結果通常是字典清單,需要助理自行解析。
適用情境
當助理需要透過既有的 Financial Modeling Prep 訂閱取得公司或市場的即時與歷史財務資料(基本面、報表、報價、價格圖表或新聞)時適用。
執行需求
以本機程序執行,通常用 uvx 從 PyPI 套件 fmpsdk-mcp 啟動,需要 Python 3.9 以上。需要以環境變數 FMP_API_KEY 提供 Financial Modeling Prep API 金鑰,並需要連線至 FMP 的網路。許多端點需要付費的 FMP 方案等級。
安裝前請注意
FMP_API_KEY 憑證會傳給本機程序,請勿放入共用設定。端點受 FMP 方案等級限制,未涵蓋時會拋出方案限制錯誤;TipRanks 方法需要另外付費的附加套件,且未針對真實回應驗證。資料會傳送到 FMP 的伺服器。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Financial Modeling Prep (fmpsdk),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

FMP SDK

[PyPI version] [Python versions] [License: BSD-3-Clause]

The idea behind this project is to provide a 'one-stop-shop' to the API endpoints provided by Financial Modeling Prep (FMP).

A personal note to you: my apologies for letting this package get so out of date. FMP kept reshuffling its API, then I had a personal issue delay me further. Things are back on track now. Because of that gap, roughly half of this package's old methods had gone defunct against FMP's current API, so rather than patch around that I rebuilt it from scratch against FMP's stable/ API. If you're on 20250102.0 or earlier you're on the old, pre-rewrite methods; anything newer uses the schema described below. Old releases are yanked from PyPI (a plain pip install fmpsdk now always gets the rewrite), but still installable if you pin one explicitly, e.g. pip install fmpsdk==20250102.0 — note that won't actually restore functionality, though: FMP sunset the legacy /api/v3/ API those old methods called entirely on 2025-08-31, so a pinned old version installs fine but its calls will fail regardless. It's there for compatibility with existing pinned requirements files while you migrate, not as a way to keep avoiding the rewrite.

What's covered

29 data groups, ~240 methods total, each reachable both as client.<method>(...) and grouped under a matching namespace, e.g. client.statements.income_statement(...):

  • Company & fundamentals — profile, executives, M&A, DCF valuation, financial statements/ ratios/growth (income, balance sheet, cash flow — as-reported, TTM, and growth variants)
  • Market data — real-time & aftermarket quotes, historical price charts, technical indicators
  • Reference & screening — symbol/CIK/CUSIP/ISIN search, the company screener, sector/ industry/exchange directories
  • Calendars & events — earnings, dividends, splits, IPOs, the economic calendar
  • Ownership & compliance — insider trades, Form 13F institutional ownership, SEC filings, ESG disclosures
  • Alternative markets — crypto, forex, commodities, indexes, ETFs & mutual funds
  • Sentiment & analysis — analyst grades/price targets, TipRanks ratings, congressional trading, market movers
  • Bulk downloads — whole-universe data dumps, one call instead of one per symbol

Every method's own docstring says which FMP plan tier it needs (Free/Starter/Premium/ Ultimate) — see Pricing tiers below. One exception: the 7 client.tipranks methods are implemented and unit-tested but untested against a real response — see that section for why.

How to Use

  1. Requires Python 3.9+. Install the package: pip install fmpsdk python-dotenv (python-dotenv is optional — it's just how the example below loads your API key from a .env file).
  2. Create a .env file and put your API key in it. Inside .env: FMP_API_KEY='blah'
  3. Build a Client and call methods on it, grouped by data category — e.g. client.company.profile(symbol="AAPL"), client.statements.income_statement(symbol="AAPL").
  4. The return from a method call is almost always a list of dictionaries. It is up to you to parse it.

Example code

python
#!/usr/bin/env python3
from dotenv import load_dotenv
import fmpsdk
# Actual API key is stored in a .env file. Not good to store API key directly in script.load_dotenv()client = fmpsdk.Client()  # reads FMP_API_KEY from the environment
# Company Valuation Methodssymbol = "AAPL"print(f"Company Profile: {client.company.profile(symbol=symbol)}")
# Every non-2xx FMP response raises a typed exception instead of returning# None or an error-shaped dict, so a plan-gated or bad-key call is obvious:try:    client.statements.income_statement_ttm(symbol=symbol)except fmpsdk.FMPPlanLimitError:    print("Your FMP plan doesn't cover this endpoint — check its docstring for which tier does.")except fmpsdk.FMPAuthenticationError:    print("Check your FMP_API_KEY.")

One naming quirk worth knowing up front: client.quote is the namespace for the whole quote group (client.quote.aftermarket_quote(...), client.quote.batch_quote(...), etc.), so it shadows the top-level quote() method of the same name — call that one as client.quote.quote(symbol="AAPL").

Pricing tiers

FMP's plans form a ladder — Free, Starter, Premium, Ultimate — and each one adds more endpoints on top of the last. A call your plan doesn't cover raises fmpsdk.FMPPlanLimitError rather than returning data. There's no single tier table to keep in sync here — instead, every group module's docstring (e.g. fmpsdk/endpoints/search.py) and every method's own docstring says plainly which tier it needs, right next to the code that calls it, verified live against a real key at every tier from Free through Ultimate. Check those, or just try the call and catch FMPPlanLimitError.

One exception, outside that ladder entirely: client.tipranks's 7 methods. They still 402 even on Ultimate — FMP's own error message says why: TipRanks data needs a separate paid add-on ("TipRanks data boost"), bought independently of the four plan tiers above. We haven't purchased it, so these 7 methods are implemented and unit-tested (mocked) but never verified against a real response — treat them as unverified rather than confirmed-working. If you have that add-on and hit a bug in one of them, a PR with the fix (and what the real response actually looks like) is welcome.

MCP server & OpenAPI spec

mcp/ — a Model Context Protocol server, published separately as fmpsdk-mcp (so pip install fmpsdk never pulls in fastmcp). Lets an AI assistant (Claude Code, Claude Desktop, …) query FMP through this library: 10 curated tools for the common asks (quotes, profiles, statements, ratios, price history, news) plus discovery tools that reach all ~240 methods at runtime. With uv:

bash
claude mcp add fmpsdk -s user -e FMP_API_KEY=your-key -- uvx fmpsdk-mcp

See mcp/README.md for the Claude Desktop config, the full tool list, and development setup.

openapi.json — an OpenAPI 3.1 description of the same API surface. FMP publishes no OpenAPI/Swagger document; this file is generated by introspecting this library's source (python tools/gen_openapi.py), not fetched from or endorsed by FMP.

Contributing

See CONTRIBUTING.md — dev setup, the unit/live/ultimate test tiers, and specifically how to verify and PR a fix for the untested tipranks methods above.

License

BSD 3-Clause — see LICENSE.md.

Attribution

Special thanks to the following people who have pitched in on this project! Open source works thanks to people who jump in and help! These are this project's stars. Thank you.

來源:README.md,提交 3f9f68b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v20260829.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分