fmp-mcp-server

leonas5555/fmp-mcp-server

3.1

If you are the rightful owner of fmp-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server for Financial Modeling Prep (FMP) API data, designed for integration with LLM-powered trading strategies.

Tools
6
Resources
0
Prompts
0

FMP MCP Server

A Model Context Protocol (MCP) server for Financial Modeling Prep (FMP) API data, designed for integration with LLM-powered trading strategies.

Overview

This server wraps key FMP API endpoints into a standardized MCP format, providing structured financial data for:

  • Earnings surprise data (get_eps_surprise)
  • Technical indicators (get_rsi, get_sma)
  • Analyst price targets (get_price_targets)
  • Insider trading activity (get_insider_trading)
  • Earnings calendar (get_earnings_calendar)

These endpoints were specifically selected to support PEAD (Post-Earnings Announcement Drift) strategy, sentiment-pullback strategies, and risk management through analyst consensus and insider trading activity monitoring.

Prerequisites

  1. Python 3.11 or newer
  2. FMP API key (get one at Financial Modeling Prep)

Installation

Local Setup

  1. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Set up environment variables:

    cp .env.example .env
    

    Edit .env and add your FMP API key.

  4. Start the server:

    ./start.sh
    # Or directly:
    python fmp_mcp_server.py
    

Docker Setup

  1. Build the Docker image:

    docker build -t fmp-mcp-server .
    
  2. Run the container:

    docker run -p 8080:8080 --env-file .env fmp-mcp-server
    

Usage

Once the server is running, you can access:

  • API documentation: http://localhost:8080/docs
  • OpenAPI spec: http://localhost:8080/openapi.json
  • MCP endpoint: http://localhost:8080/mcp

Example MCP Tool Calls

Get earnings surprise data for AAPL:

from langchain.tools import MCP

tools = MCP.from_url("http://localhost:8080/mcp").tools()
eps_data = tools.get_eps_surprise(symbol="AAPL")
print(eps_data)

Get RSI data for NVDA:

rsi_data = tools.get_rsi(symbol="NVDA", time_period=14)
print(rsi_data)

Integration with Trading Fleet

This server is designed to work with the agentic-trading-fleet architecture. The tools provided here complement the Insight Sentry API by providing structured financial data that is particularly useful for PEAD strategy, risk management, and backtesting.

Endpoints

Tool NamePurposeStrategy Use Case
get_eps_surpriseStructured EPS data (actual/est/surprise)PEAD strategy, earnings drift
get_rsiRSI technical indicator valuesSentiment-Pullback, technical backtest
get_smaSMA technical indicator valuesTechnical analysis, moving average strategies
get_price_targetsAnalyst consensus and price targetsLong-horizon risk filter
get_insider_tradingInsider transactions (buys/sells)News-halt heuristic for large insider sales
get_earnings_calendarUpcoming earnings eventsPEAD strategy, volatility forecasting

License