Financial Modeling Prep MCP server

Integrates with Financial Modeling Prep API to provide access to real-time and historical financial data across stocks, company profiles, financial statements, technical indicators, and economic information for investment research and market analysis.
Back to servers
Setup instructions
Provider
Ben Rabi
Release date
May 25, 2025
Stats
40 stars

The Financial Modeling Prep MCP server enables AI assistants to access and analyze financial data, including stock information, company fundamentals, and market insights through a standardized Model Context Protocol implementation.

Installation

Setting Up Your Environment

To use this MCP server, you'll need to obtain a Financial Modeling Prep access token:

  1. Visit the Financial Modeling Prep website
  2. Create an account and verify your email address
  3. After signing in, find your API key in your Dashboard
  4. For more data access, consider upgrading to a paid plan

Local Installation

# Clone and setup
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server
cd Financial-Modeling-Prep-MCP-Server
npm install
npm run build

# Run with your FMP token
FMP_ACCESS_TOKEN=YOUR_TOKEN npm run dev

# Or specify the token via CLI argument
npm run dev -- --fmp-token=YOUR_TOKEN

Docker Installation

# Basic deployment
docker run -p 8080:8080 -e FMP_ACCESS_TOKEN=YOUR_TOKEN your-image-name

# With Docker Compose (create docker-compose.yml first)
docker-compose up

Server Configuration Modes

The server operates in three different modes that control how tools are loaded:

Dynamic Mode

Starts with only 3 meta-tools and loads other tools on demand:

# Enable via CLI argument
npm run dev -- --fmp-token=YOUR_TOKEN --dynamic-tool-discovery

# Or via environment variable
DYNAMIC_TOOL_DISCOVERY=true FMP_ACCESS_TOKEN=YOUR_TOKEN npm run dev

Static Mode

Pre-loads specific toolsets at session creation:

# Enable via CLI argument with specific toolsets
npm run dev -- --fmp-token=YOUR_TOKEN --fmp-tool-sets=search,company,quotes

# Or via environment variable
FMP_TOOL_SETS=search,company,quotes FMP_ACCESS_TOKEN=YOUR_TOKEN npm run dev

Legacy Mode

Loads all 253+ tools at session creation (default behavior):

# Just specify the token with no mode parameters
npm run dev -- --fmp-token=YOUR_TOKEN

Usage Examples

Making HTTP Requests

The server exposes an MCP endpoint at /mcp that accepts JSON-RPC formatted requests:

# Initialize a session
curl -X POST "http://localhost:8080/mcp" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "clientInfo": {"name": "client", "version": "1.0.0"},
      "capabilities": {}
    }
  }'

Session Configuration

You can configure each session by passing Base64-encoded JSON in the config query parameter:

# Dynamic Mode Session
CONFIG_BASE64=$(echo -n '{"DYNAMIC_TOOL_DISCOVERY":"true"}' | base64)
curl -X POST "http://localhost:8080/mcp?config=${CONFIG_BASE64}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize",...}'

# Static Mode Session
CONFIG_BASE64=$(echo -n '{"FMP_TOOL_SETS":"search,company,quotes"}' | base64)
curl -X POST "http://localhost:8080/mcp?config=${CONFIG_BASE64}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize",...}'

Using Financial Data Tools

Search for a Stock Symbol

curl -X POST "http://localhost:8080/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "searchSymbol",
      "arguments": {
        "query": "Apple"
      }
    }
  }'

Get a Stock Quote

curl -X POST "http://localhost:8080/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "getQuote",
      "arguments": {
        "symbol": "AAPL"
      }
    }
  }'

Get Company Profile

curl -X POST "http://localhost:8080/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "getCompanyProfile",
      "arguments": {
        "symbol": "MSFT"
      }
    }
  }'

Dynamic Toolset Management

When using dynamic mode, you can load and unload toolsets as needed:

Enable a Toolset

curl -X POST "http://localhost:8080/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "enable_toolset",
      "arguments": {
        "toolset": "search"
      }
    }
  }'

Check Toolset Status

curl -X POST "http://localhost:8080/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "get_toolset_status",
      "arguments": {}
    }
  }'

Disable a Toolset

curl -X POST "http://localhost:8080/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "disable_toolset",
      "arguments": {
        "toolset": "search"
      }
    }
  }'

Available Toolsets

The server provides tools organized into these categories:

  • search: Symbol search and directories
  • company: Company profiles and information
  • quotes: Real-time stock prices
  • statements: Financial statements
  • calendar: Earnings, dividends, IPOs
  • charts: Price history and technical charts
  • news: Financial news and press releases
  • analyst: Price targets and ratings
  • market-performance: Sectors, gainers, losers
  • insider-trades: Corporate insider activity
  • institutional: Fund holdings and 13F filings
  • indexes: Market indexes like S&P 500
  • economics: Treasury rates and indicators
  • crypto: Cryptocurrency data
  • forex: Foreign exchange rates
  • commodities: Gold, oil, agricultural products
  • etf-funds: ETF and mutual fund data
  • esg: Environmental, social, governance ratings
  • technical-indicators: RSI, SMA, MACD
  • senate: Government trading disclosures
  • sec-filings: Regulatory documents
  • earnings: Earnings reports and transcripts
  • dcf: Discounted cash flow valuations
  • bulk: Large-scale data downloads

Using Hosted Registries

You can also access this MCP server through these hosted platforms:

These platforms handle hosting and authentication, simplifying integration with AI assistants.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "fmp-mcp" '{"command":"npx","args":["-y","fmp-mcp","--fmp-token=${FMP_ACCESS_TOKEN}"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "fmp-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "fmp-mcp",
                "--fmp-token=${FMP_ACCESS_TOKEN}"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "fmp-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "fmp-mcp",
                "--fmp-token=${FMP_ACCESS_TOKEN}"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later