MCP Hub
Back to servers

FMP MCP Server

Provides financial data from Financial Modeling Prep for AI-assisted investment research, including company profiles, financial statements, and analyst ratings. It features high-level workflow tools for market analysis and atomic tools for deep dives into valuation and institutional ownership.

Updated
Feb 12, 2026

FMP MCP Server

A Model Context Protocol server that provides financial data from Financial Modeling Prep for AI-assisted investment research.

Built with FastMCP 2.0 and Python.

Tools

Workflow Tools (start here)

High-level tools that orchestrate multiple API calls into single research-ready responses:

ToolDescription
stock_briefQuick comprehensive snapshot: profile, price action, valuation, analyst consensus, insider signals, headlines
market_contextFull market environment: rates, yield curve, sector rotation, breadth, movers, economic calendar
earnings_setupPre-earnings positioning: consensus estimates, beat/miss history, analyst momentum, price drift, insider signals
fair_value_estimateMulti-method valuation: DCF, earnings-based, peer multiples, analyst targets, blended estimate
earnings_postmortemPost-earnings synthesis: beat/miss, trend comparison, analyst reaction, market response, guidance tone

Atomic Tools (deeper dives)

ToolDescription
company_overviewCompany profile, quote, key metrics, and analyst ratings
financial_statementsIncome statement, balance sheet, cash flow (annual/quarterly)
analyst_consensusAnalyst grades, price targets, and forward estimates
earnings_infoHistorical and upcoming earnings with beat/miss tracking
price_historyHistorical daily prices with technical context
stock_searchSearch for stocks by name or ticker
insider_activityInsider trading activity and transaction statistics
institutional_ownershipTop institutional holders and position changes
stock_newsRecent news and press releases
treasury_ratesCurrent Treasury yields and yield curve
economic_calendarUpcoming economic events and releases
market_overviewSector performance, gainers, losers, most active
earnings_transcriptEarnings call transcripts with pagination support
revenue_segmentsRevenue breakdown by product and geography
peer_comparisonPeer group valuation and performance comparison
dividends_infoDividend history, yield, growth, and payout analysis
earnings_calendarUpcoming earnings dates with optional symbol filter
etf_lookupETF holdings or stock ETF exposure (dual-mode with auto-detect)
estimate_revisionsAnalyst sentiment momentum: forward estimates, grade changes, beat rate
fmp_coverage_gapsDocs parity introspection: endpoint families not yet implemented in this MCP server

Setup

Prerequisites

Install

uv sync

Configure

Set your API key as an environment variable:

export FMP_API_KEY=your_api_key_here

Or create a .env file:

FMP_API_KEY=your_api_key_here

Run

uv run fastmcp run server.py

Claude Desktop / Claude Code

Add to your MCP config:

{
  "mcpServers": {
    "fmp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/fmp", "fastmcp", "run", "server.py"],
      "env": {
        "FMP_API_KEY": "your_api_key_here"
      }
    }
  }
}

Testing

uv run pytest tests/ -v

All tools are tested with mocked API responses using respx.

Live e2e tests (real API) can be run in pooled parallel mode:

uv run pytest tests/test_live.py -m live_full -n 4 -q

Architecture

server.py          # FastMCP entry point, registers all tool modules
fmp_client.py      # Async HTTP client with TTL caching and graceful error handling
tools/
  overview.py      # company_overview, stock_search
  financials.py    # financial_statements, revenue_segments
  valuation.py     # analyst_consensus, peer_comparison, estimate_revisions
  market.py        # price_history, earnings_info, dividends_info, earnings_calendar, etf_lookup
  ownership.py     # insider_activity, institutional_ownership
  news.py          # stock_news
  macro.py         # treasury_rates, economic_calendar, market_overview
  transcripts.py   # earnings_transcript (with pagination)
  workflows.py     # stock_brief, market_context, earnings_setup, fair_value_estimate, earnings_postmortem

Key design decisions:

  • Module pattern: Each tool file exports register(mcp, client) to keep tools organized
  • Parallel fetches: Workflow tools use asyncio.gather() to call multiple endpoints concurrently
  • Graceful degradation: FMPClient.get_safe() returns defaults on error so composite tools return partial data instead of failing entirely
  • In-memory TTL cache: Avoids redundant API calls with configurable TTLs per data type (60s for quotes, 24h for profiles)

License

MIT

Reviews

No reviews yet

Sign in to write a review