Skip to main content
Glama
FMP MCP Server

FMP MCP Server

by DigiBugCat

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:

Tool

Description

stock_brief

Quick comprehensive snapshot: profile, price action, valuation, analyst consensus, insider signals, headlines

market_context

Full market environment: rates, yield curve, sector rotation, breadth, movers, economic calendar

earnings_setup

Pre-earnings positioning: consensus estimates, beat/miss history, analyst momentum, price drift, insider signals

earnings_preview

Pre-earnings setup scorecard: composite signal, thesis alignment, and bull/bear triggers

fair_value_estimate

Multi-method valuation: DCF, earnings-based, peer multiples, analyst targets, blended estimate

earnings_postmortem

Post-earnings synthesis: beat/miss, trend comparison, analyst reaction, market response, guidance tone

Atomic Tools (deeper dives)

Tool

Description

company_overview

Company profile, quote, key metrics, and analyst ratings

financial_statements

Income statement, balance sheet, cash flow (annual/quarterly)

analyst_consensus

Analyst grades, price targets, and forward estimates

price_history

Historical daily prices with technical context

stock_search

Search for stocks by name or ticker

insider_activity

Insider trading activity and transaction statistics

institutional_ownership

Top institutional holders and position changes

stock_news

Recent news and press releases

treasury_rates

Current Treasury yields and yield curve

economic_calendar

Upcoming economic events and releases

market_overview

Sector performance, gainers, losers, most active

earnings_transcript

Earnings call transcripts with pagination support

revenue_segments

Revenue breakdown by product and geography

peer_comparison

Peer group valuation and performance comparison

dividends_info

Dividend history, yield, growth, and payout analysis

earnings_calendar

Upcoming earnings dates with optional symbol filter

etf_lookup

ETF holdings or stock ETF exposure (dual-mode with auto-detect)

estimate_revisions

Analyst sentiment momentum: forward estimates, grade changes, beat rate

fmp_coverage_gaps

Docs parity introspection: endpoint families not yet implemented in this MCP server

Related MCP server: Financial Modeling Prep 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
tools/_helpers.py  # Shared SDK helpers: safe calls, TTL cache, model dumping/normalization
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, 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, earnings_preview, fair_value_estimate, earnings_postmortem

Key design decisions:

  • Module pattern: Each tool file exports register(mcp, client) to keep tools organized

  • SDK-first FMP client: Uses AsyncFMPDataClient (fmp-data==2.2.0) directly for typed endpoint coverage

  • Parallel fetches: Workflow tools use asyncio.gather() to call multiple endpoints concurrently

  • Graceful degradation: _safe_call() 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

Available Tools

21 tools
analyst_consensusAnalyst ConsensusA
Read-onlyIdempotent

Get Wall Street analyst consensus: price targets, ratings, and buy/sell distribution.

Returns analyst count, consensus/high/low price targets, upside percentage, buy/hold/sell breakdown, and FMP's own rating.

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

company_overviewCompany OverviewA
Read-onlyIdempotent

Get a comprehensive company snapshot including profile, valuation ratios, and current quote.

Use this FIRST for any stock analysis query. Returns name, sector, market cap, P/E, P/B, dividend yield, ROE, debt/equity, and more.

Args: symbol: Stock ticker symbol (e.g. "AAPL", "MSFT")

Inputs: symbol (required). Returns: object

dividends_infoDividends InfoA
Read-onlyIdempotent

Get dividend history, yield, growth rates, and stock split history.

Returns current dividend yield, 3Y/5Y dividend CAGR, upcoming ex-date, payout context, and stock split history.

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

earnings_infoEarnings InfoA
Read-onlyIdempotent

Get analyst earnings estimates and income statement history for a stock.

Returns upcoming quarterly estimates (EPS and revenue) from analyst consensus, plus recent annual income data for trend context.

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

earnings_postmortemEarnings PostmortemA
Read-onlyIdempotent

Post-earnings synthesis: beat/miss, trend comparison, analyst reaction, market response, and guidance tone.

Analyzes the most recent (or specified) earnings report. Returns EPS and revenue surprise, YoY/QoQ comparisons, post-earnings price reaction, analyst rating changes since the print, and guidance tone from transcript.

Args: symbol: Stock ticker symbol (e.g. "AAPL") quarter: Specific quarter (1-4) to analyze. Omit for most recent. year: Specific year to analyze. Omit for most recent.

Inputs: symbol (required), quarter, year. Returns: object

earnings_setupEarnings SetupA
Read-onlyIdempotent

Pre-earnings positioning analysis: consensus estimates, historical beat/miss rate, analyst momentum, price drift, and insider signals.

Orchestrates 8 endpoints to answer "should I play this earnings?" Returns days until earnings, consensus EPS/revenue, beat rate from last 4-8 quarters, analyst upgrade/downgrade momentum, pre-earnings price drift, insider net activity, and a heuristic setup signal.

Args: symbol: Stock ticker symbol (e.g. "AAPL", "DDOG")

Inputs: symbol (required). Returns: object

earnings_transcriptEarnings TranscriptA
Read-onlyIdempotent

Get an earnings call transcript for a company.

When year/quarter are not specified, fetches the most recent available transcript. Returns paginated transcript content with line-boundary snapping. Use offset + max_chars to paginate through long transcripts.

Args: symbol: Stock ticker symbol (e.g. "AAPL") year: Fiscal year (e.g. 2025). Omit for latest available. quarter: Quarter number 1-4. Omit for latest available. max_chars: Max characters to return per call (default 40000) offset: Character offset to start from (default 0). Use next_offset from previous response to continue.

Inputs: symbol (required), year, quarter, max_chars, +1 more. Returns: object

economic_calendarEconomic CalendarA
Read-onlyIdempotent

Get upcoming high-impact macro-economic events.

Filters for important events (Fed, CPI, NFP, GDP, etc.) and sorts by date. Covers the next N days (default 14).

Args: days_ahead: Number of days to look ahead (default 14, max 90)

Inputs: days_ahead. Returns: object

fair_value_estimateFair Value EstimateA
Read-onlyIdempotent

Multi-method fair value estimate with peer context.

Calculates fair value using PE-based, PS-based, simplified DCF, and analyst target methods. Compares current multiples to peer medians. Returns a blended fair value, upside/downside, and valuation rating.

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

financial_statementsFinancial StatementsA
Read-onlyIdempotent

Get income statement, balance sheet, and cash flow data with growth rates.

Returns simplified per-period financials and 3-year CAGRs for key metrics. Use after company_overview for deeper analysis.

Args: symbol: Stock ticker symbol (e.g. "AAPL") period: "annual" or "quarter" (default "annual") limit: Number of periods to return (default 5)

Inputs: symbol (required), period, limit. Returns: object

insider_activityInsider ActivityA
Read-onlyIdempotent

Get insider trading activity, statistics, and ownership context.

Returns net buy/sell over 30/90 days, cluster buying signals, CEO/CFO action highlights, and insider ownership as % of float.

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

institutional_ownershipInstitutional OwnershipA
Read-onlyIdempotent

Get institutional ownership breakdown and position changes.

Returns top 10 holders with % ownership, quarter-over-quarter position changes, and institutional vs float ratio.

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

market_contextMarket ContextA
Read-onlyIdempotent

Full market environment: rates, yield curve, sector rotation, breadth, movers, and economic calendar.

Combines treasury rates, risk premium, sector performance, biggest movers, and upcoming macro events into a single environment snapshot. Calculates yield curve spread, rotation signal, breadth signal, and overall regime classification.

Inputs: no named parameters. Returns: object

market_overviewMarket OverviewA
Read-onlyIdempotent

Get today's market snapshot: sector performance, biggest movers, and most active stocks.

Returns sector rankings, top 5 gainers/losers, and most actively traded names.

Inputs: no named parameters. Returns: object

peer_comparisonPeer ComparisonA
Read-onlyIdempotent

Compare a stock's valuation and growth metrics against its peers.

Finds FMP-identified peers, then compares P/E, P/S, EV/EBITDA, growth rates, and margins. Shows target's premium/discount to peer median and rank within the group.

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

price_historyPrice HistoryA
Read-onlyIdempotent

Get price performance, key levels, and momentum indicators.

Returns current price, 52-week range, SMA-50/200, performance across timeframes, volatility, and recent daily closes. Not for raw chart data.

Args: symbol: Stock ticker symbol (e.g. "AAPL") period: Time period - "1w", "1m", "3m", "6m", "ytd", "1y", "2y", "5y" (default "1y")

Inputs: symbol (required), period. Returns: object

revenue_segmentsRevenue SegmentsA
Read-onlyIdempotent

Get revenue breakdown by product/service and geographic region.

Returns segment % of total, identifies fastest-growing segment, and flags concentration risk (>50% from one segment).

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

stock_briefStock BriefA
Read-onlyIdempotent

Quick comprehensive stock snapshot: profile, price action, valuation, analyst consensus, insider signals, and top headlines.

Replaces the 4-tool chain (overview + price + news + consensus) with a single call. Returns momentum across timeframes, SMA positioning, valuation multiples, analyst consensus + upside, insider signal, and a heuristic quick-take signal.

Args: symbol: Stock ticker symbol (e.g. "AAPL")

Inputs: symbol (required). Returns: object

stock_newsStock NewsA
Read-onlyIdempotent

Get recent news articles and press releases for a stock.

Merges news and press releases, deduplicates by title similarity, and sorts by date. Flags major event types (earnings, FDA, M&A, etc.).

Args: symbol: Stock ticker symbol (e.g. "AAPL") limit: Max total items to return (default 20)

Inputs: symbol (required), limit. Returns: object

treasury_ratesTreasury RatesA
Read-onlyIdempotent

Get current US Treasury yield curve and equity risk premium.

Returns latest yields across maturities, yield curve slope (10Y-2Y), inversion flag, and DCF-ready inputs (10Y rate + equity risk premium).

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific financial analysis aspects like earnings, valuation, or market data, with clear boundaries. However, some overlap exists between company_overview and stock_brief, and between market_overview and market_context, which could cause minor confusion but descriptions help differentiate them.

    Naming Consistency5/5

    Tool names follow a consistent snake_case pattern with clear verb_noun or noun_verb structures throughout, such as analyst_consensus, company_overview, and earnings_setup. There are no deviations in naming conventions, making the set predictable and readable.

    Tool Count3/5

    With 21 tools, the count is borderline high for a financial data server, potentially overwhelming for agents. While it covers a broad domain, some tools like stock_brief might overlap with others, suggesting the set could be streamlined without losing functionality.

    Completeness5/5

    The tool surface provides comprehensive coverage for stock analysis, including company data, earnings, valuation, market context, and search capabilities. It supports full CRUD-like workflows for financial research with no obvious gaps, enabling agents to perform detailed analysis from overview to deep dives.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      Enables AI assistants to access and analyze financial data including stock information, company fundamentals, and market insights through the Financial Modeling Prep API.
      267
      624 npm
      149
      TypeScript
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI assistants access to comprehensive financial data including real-time stock quotes, company fundamentals, financial statements, market analysis, economic indicators, and 250+ financial tools across 24 categories from Financial Modeling Prep API.
      624 npm
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to analyze stocks, screen markets, compare peers, read earnings calls, and track sector rotations using live financial data from Financial Modeling Prep.
      21
      PolyForm Noncommercial 1.0.0
    • A
      license
      B
      quality
      C
      maintenance
      Provides access to Financial Modeling Prep's comprehensive financial data API, enabling real-time stock quotes, company fundamentals, financial statements, market insights, analyst data, and technical indicators directly in Claude Desktop.
      26
      130 npm
      2
      MIT