by imbenrabi
Provides AI assistants with direct access to Financial Modeling Prep data, including real‑time stock quotes, company fundamentals, financial statements, market indexes, news, and alternative data sets via the Model Context Protocol.
The server implements the Model Context Protocol for Financial Modeling Prep, exposing a rich catalog of over 250 financial tools (search, quotes, statements, metrics, technical indicators, news, SEC filings, crypto, forex, commodities, government trading, etc.). AI agents can invoke these tools to retrieve up‑to‑date market data and perform complex financial analysis without writing custom API calls.
npx financial-modeling-prep-mcp-server --fmp-token=YOUR_API_KEY
/mcp.FMP_ACCESS_TOKEN as an environment variable for self‑hosted deployments.enable_toolset, disable_toolset, list_toolsets, describe_toolset, list_tools).Q: Do I need to host my own server?
A: No. A publicly hosted instance is available at https://financial-modeling-prep-mcp-server-production.up.railway.app/mcp. You only need to supply your FMP API key.
Q: Which mode should I choose? A: Use the hosted instance’s dynamic mode for flexibility. Self‑hosted users can pick static mode for predictable performance or legacy mode for full tool access.
Q: How are sessions managed?
A: Clients send a unique mcp-client-id header. The server creates a session and returns mcp-session-id; subsequent requests must include both headers.
Q: What if I exceed my FMP API quota? A: The server forwards requests directly to FMP; quota limits are enforced by your FMP account. Upgrade your FMP plan if needed.
Q: Can I limit the tools that are loaded?
A: Yes. In static mode set FMP_TOOL_SETS (comma‑separated) via environment variable or CLI. In dynamic mode use the meta‑tools to enable only required toolsets at runtime.
Q: Is there support for HTTPS? A: When self‑hosting, expose the Fastify server behind a TLS terminator (e.g., Nginx or a cloud load balancer). The hosted instance already serves over HTTPS.
Q: How do I contribute? A: Fork the repo, make changes, and open a pull request. The CI pipeline runs linting, tests, and builds the package.
Q: Where can I find the full list of available tools?
A: Call the tools/list method after session initialization, or refer to the “Available Tools” section in the README.
A Model Context Protocol (MCP) implementation for Financial Modeling Prep, enabling AI assistants to access and analyze financial data, stock information, company fundamentals, and market insights.
Choose your deployment option:
No installation required!
https://financial-modeling-prep-mcp-server-production.up.railway.app/mcpAvailable via:
Example session config:
{
"FMP_ACCESS_TOKEN": "your_fmp_api_key_here"
}
Choose your mode and deploy:
NPM Installation:
npm install -g financial-modeling-prep-mcp-server
export FMP_ACCESS_TOKEN=your_token_here
export DYNAMIC_TOOL_DISCOVERY=true # or choose static/legacy
fmp-mcp
Docker (build from source):
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server
cd Financial-Modeling-Prep-MCP-Server
docker build -t fmp-mcp-server .
docker run -p 8080:8080 \
-e FMP_ACCESS_TOKEN=your_token_here \
-e DYNAMIC_TOOL_DISCOVERY=true \
fmp-mcp-server
See Installation Methods for detailed self-hosting options.
enable_toolset, disable_toolset, list_toolsets, describe_toolset, list_toolsThis server can be used in two ways:
Direct HTTP Endpoint:
https://financial-modeling-prep-mcp-server-production.up.railway.app/mcp
Also available through MCP registries:
Configuration:
enable_toolset, disable_toolset, list_toolsets, describe_toolset, list_tools)Deploy your own instance for complete control:
This MCP server leverages toolception - a dynamic MCP server toolkit for runtime toolset management with Fastify transport and meta-tools. Toolception provides complete server orchestration including HTTP transport, session management, and tool lifecycle.
ClientResourceCache maintains isolated sessions per client with LRU/TTL evictionImportant: This server uses HTTP/SSE transport only (no stdio). See compatibility notes below.
| Client | Support | How to Connect |
|---|---|---|
| Claude.ai | Yes | Settings > Connectors > Add remote server |
| Claude Desktop | Yes | Settings > Connectors (NOT claude add or config.json) |
| Claude Mobile | Yes | Uses servers added via claude.ai |
| Smithery/Glama | Yes | Via registry with server card |
| Custom HTTP | Yes | Include mcp-client-id header |
Claude Desktop users: Do NOT use claude add <url> or edit claude_desktop_config.json - these expect stdio transport. Instead, add as a remote server via Settings > Connectors.
See Anthropic's Remote MCP Server Guide.
/ endpointClientResourceCache)ModuleResolver lazy-loads tools based on resolved modePOST /mcp - Main MCP protocol endpoint (JSON-RPC formatted messages)
GET /ping - Simple ping endpoint (returns {"status": "ok"})GET /healthcheck - Comprehensive health check endpointGET /.well-known/mcp/server-card.json - MCP server card for auto-discovery (SEP-1649)The server supports multiple configuration methods with a clear precedence hierarchy to ensure predictable behavior.
The server supports three operational modes. The mode you use depends on your deployment scenario:
FMP_ACCESS_TOKEN in session configDYNAMIC_TOOL_DISCOVERY=true)Starts with only 5 meta-tools:
enable_toolset - Enable a toolset by namedisable_toolset - Disable a toolset by namelist_toolsets - List available toolsets with active statusdescribe_toolset - Describe a toolset with details and toolslist_tools - List currently registered tool namesWhen to Use:
Our Hosted Instance: This is the default mode
Self-Hosted: Set via DYNAMIC_TOOL_DISCOVERY=true or --dynamic-tool-discovery
FMP_TOOL_SETS=search,company,quotes)Pre-loads specific toolsets at session creation. All specified tools available immediately.
When to Use:
Our Hosted Instance: Not available (we use dynamic mode)
Self-Hosted: Set via FMP_TOOL_SETS=search,company,quotes or --fmp-tool-sets=search,company,quotes
Loads all 253+ tools at session creation. Maximum compatibility with all features.
When to Use:
Our Hosted Instance: Not available (we use dynamic mode)
Self-Hosted: Default when no mode is configured, or set DYNAMIC_TOOL_DISCOVERY=false
When self-hosting, configuration follows this strict precedence hierarchy:
🥇 CLI Arguments (highest priority)
↓
🥈 Environment Variables
↓
🥉 Session Configuration (lowest priority)
Note: Our hosted instance mode configuration is fixed to dynamic tool exploration and cannot be changed via session config.
When server-level configurations are set (CLI arguments or environment variables), they override all session-level configurations for ALL sessions. This ensures consistent behavior across the entire server instance.
Example Override Scenario:
# Server started with CLI argument
npm run dev -- --dynamic-tool-discovery
# ALL session requests will use Dynamic Mode, regardless of session config
# Session config like {"FMP_TOOL_SETS": "search,company"} will be IGNORED
CLI Arguments (Server-level - overrides everything)
npm run dev -- --fmp-token=TOKEN --dynamic-tool-discovery
npm run dev -- --fmp-token=TOKEN --fmp-tool-sets=search,company,quotes
npm run dev -- --port=4000 --fmp-token=TOKEN
Environment Variables (Server-level - overrides session configs)
DYNAMIC_TOOL_DISCOVERY=true npm run dev
FMP_TOOL_SETS=search,company,quotes npm run dev
Session Configuration (Session-level - via HTTP query parameter)
# Base64 encoded JSON config in query parameter
curl -X POST "http://localhost:8080/mcp?config=eyJEWU5BTUlDX1RPT0xfRElTQ09WRVJZIjoidHJ1ZSJ9"
While MCP clients can filter tools automatically, large tool sets may impact performance. To optimize your experience, you can specify which tool categories to load instead of loading all 253 tools at once:
| Tool Set | Description | Example Tools |
|---|---|---|
search |
Search & Directory | Search stocks, company lookup, symbol directories |
company |
Company Profile & Info | Company profiles, executives, employee count |
quotes |
Real-time Quotes | Live stock prices, market data, price changes |
statements |
Financial Statements | Income statements, balance sheets, cash flow, ratios |
calendar |
Financial Calendar | Earnings calendar, dividends, IPOs, stock splits |
charts |
Price Charts & History | Historical prices, technical charts, market movements |
news |
Financial News | Market news, press releases, financial articles |
analyst |
Analyst Coverage | Price targets, ratings, analyst estimates |
market-performance |
Market Performance | Sector performance, gainers, losers, most active |
insider-trades |
Insider Trading | Corporate insider activity, ownership changes |
institutional |
Institutional Holdings | 13F filings, fund holdings, institutional ownership |
indexes |
Market Indexes | S&P 500, NASDAQ, Dow Jones, index constituents |
economics |
Economic Data | Treasury rates, GDP, inflation, economic indicators |
crypto |
Cryptocurrency | Crypto prices, market data, digital assets |
forex |
Foreign Exchange | Currency pairs, exchange rates, forex data |
commodities |
Commodities | Gold, oil, agricultural products, futures |
etf-funds |
ETFs & Mutual Funds | Fund holdings, performance, fund information |
esg |
ESG & Sustainability | Environmental, social, governance ratings |
technical-indicators |
Technical Indicators | RSI, SMA, EMA, MACD, Bollinger Bands |
senate |
Government Trading | Congressional and Senate trading disclosures |
sec-filings |
SEC Filings | 10-K, 10-Q, 8-K filings, regulatory documents |
earnings |
Earnings & Transcripts | Earnings reports, call transcripts |
dcf |
DCF Valuation | Discounted cash flow models, valuations |
bulk |
Bulk Data | Large-scale data downloads for analysis |
🚧 This feature is currently in BETA. API and behavior may change in future versions.
The Dynamic Toolset Management feature allows you to enable and disable tool categories at runtime instead of pre-configuring them at startup. This provides more flexibility and can help optimize performance by loading only the tools you need when you need them.
When dynamic toolset management is enabled, each session starts with only 5 meta-tools:
enable_toolset - Enable a toolset by namedisable_toolset - Disable a toolset by name (state only)list_toolsets - List available toolsets with active status and definitionsdescribe_toolset - Describe a toolset with definition, active status and toolslist_tools - List currently registered tool names (best effort)AI assistants can then use these meta-tools to dynamically load and unload specific tool categories as needed for different tasks within their session.
Command Line Arguments:
# Enable dynamic toolset management for all sessions
npm run dev -- --fmp-token=YOUR_TOKEN --dynamic-tool-discovery
# Production deployment
node dist/index.js --fmp-token=YOUR_TOKEN --dynamic-tool-discovery
Environment Variables:
# Set environment variable
export DYNAMIC_TOOL_DISCOVERY=true
export FMP_ACCESS_TOKEN=YOUR_TOKEN
npm run dev
# Or inline
DYNAMIC_TOOL_DISCOVERY=true FMP_ACCESS_TOKEN=YOUR_TOKEN npm start
Docker:
# docker-compose.yml
version: "3.8"
services:
fmp-mcp:
build: .
ports:
- "8080:8080"
environment:
- FMP_ACCESS_TOKEN=YOUR_FMP_ACCESS_TOKEN
- DYNAMIC_TOOL_DISCOVERY=true # Enable for all sessions
When no server-level dynamic mode is set, individual sessions can request dynamic mode:
# Base64 encode: {"DYNAMIC_TOOL_DISCOVERY":"true"}
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",...}'
Start server with dynamic mode:
DYNAMIC_TOOL_DISCOVERY=true npm start
AI assistant initializes session and gets meta-tools:
// Response includes only 5 meta-tools:
{
"tools": [
{ "name": "enable_toolset", "description": "Enable a toolset by name" },
{ "name": "disable_toolset", "description": "Disable a toolset by name (state only)" },
{ "name": "list_toolsets", "description": "List available toolsets with active status and definitions" },
{ "name": "describe_toolset", "description": "Describe a toolset with definition, active status and tools" },
{ "name": "list_tools", "description": "List currently registered tool names (best effort)" }
]
}
AI assistant enables needed toolsets:
// Enable search toolset
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"enable_toolset","arguments":{"toolset":"search"}}}
// Enable quotes toolset
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"enable_toolset","arguments":{"toolset":"quotes"}}}
AI assistant uses the enabled tools:
// Now can use search and quotes tools
{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"searchSymbol","arguments":{"query":"AAPL"}}}
{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"getQuote","arguments":{"symbol":"AAPL"}}}
AI assistant can disable unused toolsets:
{
"jsonrpc": "2.0",
"id": 6,
"method": "tools/call",
"params": {
"name": "disable_toolset",
"arguments": { "toolset": "search" }
}
}
For production environments, you can use this MCP server through various registries that provide hosted and managed MCP servers:
The Financial Modeling Prep MCP Server is available through the official Model Context Protocol Registry, providing standardized installation and discovery for AI platforms.
NPM Installation:
npm install financial-modeling-prep-mcp-server
npx fmp-mcp --fmp-token=YOUR_TOKEN
Docker (build from source):
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server
cd Financial-Modeling-Prep-MCP-Server
docker build -t fmp-mcp-server .
docker run -p 8080:8080 -e FMP_ACCESS_TOKEN=YOUR_TOKEN fmp-mcp-server
From Source:
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server
cd Financial-Modeling-Prep-MCP-Server
npm install && npm run build
npm start -- --fmp-token=YOUR_TOKEN
The server supports multiple installation methods through the MCP Registry:
| Method | Command | Best For |
|---|---|---|
| NPM | npm install financial-modeling-prep-mcp-server |
Development and local testing |
| Docker | git clone && docker build -t fmp-mcp-server . |
Production deployments |
| Source | git clone && npm install |
Customization and contributions |
1. Choose Your Installation Method:
# Option A: NPM (recommended for development)
npm install financial-modeling-prep-mcp-server
npx fmp-mcp --fmp-token=YOUR_TOKEN
# Option B: Docker (recommended for production)
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server
cd Financial-Modeling-Prep-MCP-Server
docker build -t fmp-mcp-server .
docker run -p 8080:8080 -e FMP_ACCESS_TOKEN=YOUR_TOKEN fmp-mcp-server
# Option C: From source (for customization)
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server
cd Financial-Modeling-Prep-MCP-Server && npm install && npm run build
npm start -- --fmp-token=YOUR_TOKEN
2. Get Your FMP API Token:
3. Test the Installation:
# Health check
curl http://localhost:8080/healthz
# List available tools
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
4. Connect to Your AI Platform:
http://localhost:8080/mcpThis server uses HTTP/SSE transport and is compatible with platforms that support remote MCP servers:
Note: This server does NOT support stdio transport. Do not use
claude add <url>orclaude_desktop_config.json- these methods expect stdio.
The Financial Modeling Prep MCP Server supports multiple installation methods to fit different deployment scenarios and development workflows.
Prerequisites:
Install globally:
npm install -g financial-modeling-prep-mcp-server
fmp-mcp --fmp-token=YOUR_TOKEN
Install locally in project:
npm install financial-modeling-prep-mcp-server
npx fmp-mcp --fmp-token=YOUR_TOKEN
With configuration options:
# Custom port and dynamic mode
npx fmp-mcp --fmp-token=YOUR_TOKEN --port=4000 --dynamic-tool-discovery
# Static toolset mode
npx fmp-mcp --fmp-token=YOUR_TOKEN --fmp-tool-sets=search,company,quotes
Prerequisites:
Build the Docker image:
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server
cd Financial-Modeling-Prep-MCP-Server
docker build -t fmp-mcp-server .
Basic Docker run:
docker run -p 8080:8080 \
-e FMP_ACCESS_TOKEN=YOUR_TOKEN \
fmp-mcp-server
With custom configuration:
# Dynamic mode with custom port
docker run -p 4000:4000 \
-e FMP_ACCESS_TOKEN=YOUR_TOKEN \
-e PORT=4000 \
-e DYNAMIC_TOOL_DISCOVERY=true \
fmp-mcp-server
# Static toolset mode
docker run -p 8080:8080 \
-e FMP_ACCESS_TOKEN=YOUR_TOKEN \
-e FMP_TOOL_SETS=search,company,quotes \
fmp-mcp-server
Docker Compose:
version: "3.8"
services:
fmp-mcp:
build: .
ports:
- "8080:8080"
environment:
- FMP_ACCESS_TOKEN=YOUR_FMP_ACCESS_TOKEN
- PORT=8080
# Optional: Choose server mode
- DYNAMIC_TOOL_DISCOVERY=true
# OR: - FMP_TOOL_SETS=search,company,quotes
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"]
interval: 30s
timeout: 10s
retries: 3
Prerequisites:
Clone and build:
# Clone repository
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server.git
cd Financial-Modeling-Prep-MCP-Server
# Install dependencies
npm install
# Build TypeScript
npm run build
# Start server
npm start -- --fmp-token=YOUR_TOKEN
Development mode:
# Run with hot reload
npm run dev -- --fmp-token=YOUR_TOKEN
# Run tests
npm test
# Run with coverage
npm run test:coverage
# Verify installation methods
npm run verify:installation
# Type checking
npm run typecheck
Custom build configuration:
# Build with specific target
npx tsc --target ES2022
# Build and watch for changes
npx tsc --watch
# Clean build
rm -rf dist && npm run build
These apply when self-hosting your own instance. Our hosted instance has fixed configuration.
| Variable | Description | Self-Host Default | Our Hosted Instance | Notes |
|---|---|---|---|---|
FMP_ACCESS_TOKEN |
Financial Modeling Prep API token | - | Not set | Our hosted: Pass via session config |
PORT |
Server port | 8080 |
Railway-managed | |
DYNAMIC_TOOL_DISCOVERY |
Enable dynamic toolset mode | false |
true (fixed) |
Our hosted: Always dynamic mode |
FMP_TOOL_SETS |
Static toolsets (comma-separated) | - | Not applicable | Our hosted: Dynamic mode only |
NODE_ENV |
Node.js environment | development |
production |
Deployment Scenarios:
Using Our Hosted Instance (Railway):
FMP_ACCESS_TOKEN in session configSelf-Hosting Your Own Instance:
# Example: Dynamic mode with server-level API key
export FMP_ACCESS_TOKEN=your_token_here
export DYNAMIC_TOOL_DISCOVERY=true
export PORT=8080
npm start
# Example: Static mode with specific toolsets
export FMP_ACCESS_TOKEN=your_token_here
export FMP_TOOL_SETS=search,company,quotes
npm start
# Example: Legacy mode (all tools)
export FMP_ACCESS_TOKEN=your_token_here
npm start
After installation, verify the server is working:
Health check:
curl http://localhost:8080/healthz
MCP capabilities:
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"clientInfo": {"name": "test", "version": "1.0.0"},
"capabilities": {}
}
}'
List available tools:
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
Common issues and solutions:
Port already in use:
# Use different port
PORT=4000 npm start -- --fmp-token=YOUR_TOKEN
Invalid API token:
# Verify token at https://financialmodelingprep.com/developer/docs
curl "https://financialmodelingprep.com/api/v3/profile/AAPL?apikey=YOUR_TOKEN"
Memory issues with all tools:
# Use dynamic mode or specific toolsets
npm start -- --fmp-token=YOUR_TOKEN --dynamic-tool-discovery
Docker permission issues:
# Run with user permissions
docker run --user $(id -u):$(id -g) -p 8080:8080 \
-e FMP_ACCESS_TOKEN=YOUR_TOKEN \
fmp-mcp-server
The Financial Modeling Prep MCP Server is listed on Smithery as one way to access our hosted instance.
Important Update: Smithery Hosting Changes (March 2026)
On March 1st, 2026, Smithery discontinued their free hosting service. As a result:
Using Our Hosted Instance
Server Configuration:
https://financial-modeling-prep-mcp-server-production.up.railway.app/mcpSession Configuration Requirements:
You must pass your FMP API key in the session configuration. The server does not have an API key configured at the environment level.
Example Session Configuration:
{
"FMP_ACCESS_TOKEN": "your_fmp_api_key_here"
}
Alternative Configurations:
// Explicitly request dynamic mode (already the default)
{
"FMP_ACCESS_TOKEN": "your_fmp_api_key_here",
"DYNAMIC_TOOL_DISCOVERY": "true"
}
// Note: Static/Legacy modes are NOT SUPPORTED on our hosted instance
// Server-level configuration overrides session requests
{
"FMP_ACCESS_TOKEN": "your_fmp_api_key_here",
"FMP_TOOL_SETS": "search,company,quotes" // This will be ignored
}
Important Notes:
Getting Your FMP API Key
Want Different Configuration?
If you need static or legacy mode, or want full control over the server configuration:
Self-Host Your Own Instance:
Then Register with Smithery (Optional):
For Smithery integration documentation, visit smithery.ai/docs.
The server runs as an HTTP server that exposes a Model Context Protocol endpoint. Each request can include session-specific configuration via query parameters.
Local Development:
# 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 in development
FMP_ACCESS_TOKEN=YOUR_TOKEN npm run dev
# Or with CLI arguments
npm run dev -- --fmp-token=YOUR_TOKEN
npm run dev -- --port=4000 --fmp-token=YOUR_TOKEN
🔐 Server-Level Dynamic Mode (All Sessions Use Dynamic Mode):
# CLI argument (highest priority)
npm run dev -- --fmp-token=YOUR_TOKEN --dynamic-tool-discovery
# Environment variable
DYNAMIC_TOOL_DISCOVERY=true FMP_ACCESS_TOKEN=YOUR_TOKEN npm run dev
🔧 Server-Level Static Mode (All Sessions Use Specified Toolsets):
# CLI argument (highest priority)
npm run dev -- --fmp-token=YOUR_TOKEN --fmp-tool-sets=search,company,quotes
# Environment variable
FMP_TOOL_SETS=search,company,quotes FMP_ACCESS_TOKEN=YOUR_TOKEN npm run dev
📚 Server-Level Legacy Mode (All Sessions Get All Tools):
# Default behavior - no specific configuration
npm run dev -- --fmp-token=YOUR_TOKEN
FMP_ACCESS_TOKEN=YOUR_TOKEN npm run dev
# Change server port via environment variable
PORT=4000 npm run dev -- --fmp-token=YOUR_TOKEN
# Change server port via CLI argument
npm run dev -- --port=4000 --fmp-token=YOUR_TOKEN
The following system prompts are designed to help AI assistants effectively use this MCP server for financial analysis tasks. Choose the appropriate prompt based on your server configuration mode.
You are an expert financial analyst AI with access to comprehensive market data tools.
CORE RULES:
- Always use tools for current market data; never rely on outdated information or estimates
- Check conversation history to avoid redundant tool calls
- Provide concise, data-driven responses
- Always include: "This is not financial advice"
DYNAMIC TOOLSET MANAGEMENT:
Your tools are organized into categories ("toolsets") that must be enabled before use.
Available toolsets: search, company, quotes, statements, calendar, charts, news, analyst, market-performance, insider-trades, institutional, indexes, economics, crypto, forex, commodities, etf-funds, esg, technical-indicators, senate, sec-filings, earnings, dcf, bulk
EXECUTION WORKFLOW:
1. DISCOVER: Use list_toolsets to see available toolset categories and their status
2. ENABLE: Use enable_toolset for required categories based on the user's query
3. VERIFY: Use list_tools to confirm the tools you need are available
4. EXECUTE: Call specific tools from enabled toolsets
5. CLEAN UP: Consider disabling unused toolsets when switching to different analysis types
FAILURE PROTOCOL:
If tools fail repeatedly or data is unavailable, state: "I cannot find the requested information with the available tools" and stop attempting.
Begin each analysis by enabling the appropriate toolsets for the user's request.
You are an expert financial analyst AI with access to comprehensive market data tools.
CORE RULES:
- Always use tools for current market data; never rely on outdated information or estimates
- Check conversation history to avoid redundant tool calls
- Provide concise, data-driven responses
- Always include: "This is not financial advice"
STATIC TOOLSET CONFIGURATION:
Your tools are pre-loaded and immediately available. All configured toolsets remain active throughout the session.
EXECUTION WORKFLOW:
1. IDENTIFY: Determine which tools from your available toolsets best address the user's query
2. EXECUTE: Call the appropriate tools directly - no toolset management needed
3. ANALYZE: Process the data and provide insights based on the results
TOOL CATEGORIES:
Your available tools span multiple categories including company profiles, financial statements, market quotes, technical analysis, news sentiment, and economic indicators. Use the most relevant tools for each analysis.
FAILURE PROTOCOL:
If tools fail repeatedly or data is unavailable, state: "I cannot find the requested information with the available tools" and stop attempting.
Proceed directly to analysis using your available tools based on the user's request.
This server provides a human-friendly prompt to list capabilities in one shot.
list_mcp_assetsServer Capabilities, Prompts, Tools (mode-aware), Resources (health snapshot), Quick Start# 1) Initialize (example: 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",
"params": { "protocolVersion": "2024-11-05", "clientInfo": {"name": "client", "version": "1.0.0"}, "capabilities": {} }
}'
# 2) List prompts
curl -X POST "http://localhost:8080/mcp?config=${CONFIG_BASE64}" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"prompts/list","params":{}}'
# 3) Get the capabilities prompt
curl -X POST "http://localhost:8080/mcp?config=${CONFIG_BASE64}" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":3,"method":"prompts/get","params":{"name":"list_mcp_assets","arguments":{}}}'
Notes:
Tools section adapts to the effective mode (Dynamic/Static/Legacy). In legacy mode, it summarizes categories instead of listing all 250+ tools.FMP_TOOL_SETS may request Static mode, but server-level configuration controls the final toolsets.Resources section includes a lightweight health snapshot (uptime, memory summary, version, mode).The server exposes a Model Context Protocol endpoint at /mcp that accepts JSON-RPC formatted requests. Each request can include optional session configuration via query parameters.
POST http://localhost:8080/mcp[?config=BASE64_ENCODED_CONFIG]
Content-Type: application/json
Accept: application/json, text/event-stream
mcp-client-id: <your-client-id>
IMPORTANT: This server uses the MCP Streamable HTTP transport, which requires session management via headers.
| Header | When Required | Description |
|---|---|---|
mcp-client-id |
All requests | Unique client identifier for session routing and caching |
mcp-session-id |
After initialize |
Session ID returned from initialize request |
Content-Type |
All requests | Must be application/json |
Accept |
All requests | Must include application/json, text/event-stream |
Critical: The
mcp-client-idheader is required for session persistence. Without it, each request creates an anonymous client that is NOT cached, causing "Session not found or expired" errors on subsequent requests.
First Request - Initialize:
# Generate a unique client ID (once per client instance)
CLIENT_ID="my-app-$(date +%s)"
curl -X POST "http://localhost:8080/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-client-id: $CLIENT_ID" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"clientInfo": {"name": "my-client", "version": "1.0.0"},
"capabilities": {}
}
}'
Server Response Includes:
mcp-session-id: <unique-session-id>Subsequent Requests - Include Both Session ID and Client ID:
curl -X POST "http://localhost:8080/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-client-id: $CLIENT_ID" \
-H "mcp-session-id: <session-id-from-initialize>" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}'
Required Headers: Both mcp-client-id and mcp-session-id
mcp-session-id headermcp-client-id for efficient bundle reuseIf you forget to include the required headers, you'll receive:
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Session not found or expired"
},
"id": null
}
Solution:
mcp-client-id for your client instancemcp-client-id in ALL requests (including initialize)mcp-session-id in all requests AFTER initializeSession configurations are passed as Base64-encoded JSON in the config query parameter.
When connecting to our hosted instance (directly or via MCP registries), you must provide your FMP API key:
# Configuration: {"FMP_ACCESS_TOKEN":"your_fmp_api_key_here"}
CONFIG_BASE64=$(echo -n '{"FMP_ACCESS_TOKEN":"your_fmp_api_key_here"}' | base64)
# Make request to our hosted instance
curl -X POST "https://financial-modeling-prep-mcp-server-production.up.railway.app/mcp?config=${CONFIG_BASE64}" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"client","version":"1.0.0"},"capabilities":{}}}'
Note: Our hosted instance runs in dynamic mode. Static/legacy mode configurations will be ignored.
Session configuration only supports FMP_ACCESS_TOKEN override. Server mode and toolsets are configured at server startup only.
API Key Override (if not set server-side):
# Configuration: {"FMP_ACCESS_TOKEN":"your_key"}
CONFIG_BASE64=$(echo -n '{"FMP_ACCESS_TOKEN":"your_key"}' | base64)
Note: Mode selection (DYNAMIC_TOOL_DISCOVERY, FMP_TOOL_SETS) must be configured at server startup via environment variables or CLI arguments, not per-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" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"clientInfo": {
"name": "my-client",
"version": "1.0.0"
},
"capabilities": {}
}
}'
Expected Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2024-11-05",
"capabilities": {
"tools": {
"listChanged": true
}
},
"serverInfo": {
"name": "fmp-mcp-server",
"version": "1.0.0"
}
}
}
CONFIG_BASE64=$(echo -n '{"DYNAMIC_TOOL_DISCOVERY":"true"}' | base64)
curl -X POST "http://localhost:8080/mcp?config=${CONFIG_BASE64}" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}'
Expected Response (Dynamic Mode):
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"tools": [
{
"name": "enable_toolset",
"description": "Enable a toolset by name",
"inputSchema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Toolset name"
}
},
"required": ["name"]
}
},
{
"name": "disable_toolset",
"description": "Disable a toolset by name (state only)"
},
{
"name": "list_toolsets",
"description": "List available toolsets with active status and definitions"
},
{
"name": "describe_toolset",
"description": "Describe a toolset with definition, active status and tools"
},
{
"name": "list_tools",
"description": "List currently registered tool names (best effort)"
}
]
}
}
CONFIG_BASE64=$(echo -n '{"DYNAMIC_TOOL_DISCOVERY":"true"}' | base64)
curl -X POST "http://localhost:8080/mcp?config=${CONFIG_BASE64}" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "enable_toolset",
"arguments": {
"toolset": "search"
}
}
}'
# Requires server started with search toolset enabled (static mode) or dynamic mode
curl -X POST "http://localhost:8080/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "searchSymbol",
"arguments": {
"query": "Apple"
}
}
}'
# Requires server started with quotes toolset enabled (static mode) or dynamic mode
curl -X POST "http://localhost:8080/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 5,
"method": "tools/call",
"params": {
"name": "getQuote",
"arguments": {
"symbol": "AAPL"
}
}
}'
clientId (from mcp-client-id header)clientId across requestsMcpServer/DynamicToolsetManager per clientIdFMP_ACCESS_TOKEN can be overridden per-session via query paramCommon error responses:
// Invalid configuration
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Bad Request: Invalid configuration"
},
"id": null
}
// Tool not available
{
"jsonrpc": "2.0",
"error": {
"code": -32601,
"message": "Tool not found: toolName"
},
"id": 1
}
// Missing required parameters
{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "Missing required parameter: symbol"
},
"id": 2
}
⚠️ Important: Mode Enforcement Behavior
Server-Level Configurations Override Session Configurations:
- When CLI arguments (
--dynamic-tool-discovery,--fmp-tool-sets) are used, they apply to ALL sessions- When environment variables (
DYNAMIC_TOOL_DISCOVERY,FMP_TOOL_SETS) are set, they apply to ALL sessions- Session-level configurations via query parameters are IGNORED when server-level modes are active
- This ensures consistent behavior across all sessions on a server instance
Configuration Precedence: CLI Arguments > Environment Variables > Session Configuration
Example: If server started with
--dynamic-tool-discovery, ALL sessions will use dynamic mode even if they request{"FMP_TOOL_SETS":"search,company"}in their session config.
This MCP provides the following tools for AI assistants to access financial data:
Important Note: All bulk endpoints return data in CSV format as raw strings rather than parsed JSON objects. This endpoint returns the response as a CSV file. The provided sample response represents an individual record. This design preserves the original FMP API format and provides better performance for large datasets.
To get a Financial Modeling Prep access token:
Financial Modeling Prep offers different pricing tiers with varying levels of data access and API call limits. For more information, visit the FMP Pricing page.
Contributions are welcome! Here's how you can contribute:
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Every pull request triggers a GitHub Actions workflow that verifies the build process.
# Clone the repository
git clone https://github.com/imbenrabi/Financial-Modeling-Prep-MCP-Server
cd Financial-Modeling-Prep-MCP-Server
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode with your API key
FMP_ACCESS_TOKEN=your_api_key npm run dev
# Or specify the API key directly via CLI argument
npm run dev -- --fmp-token=your_api_key
The development server will start on port 8080 by default. You can configure the port using the PORT environment variable:
PORT=4000 FMP_ACCESS_TOKEN=your_api_key npm run dev
Server-Level Static Mode (All Sessions Use Specific Toolsets):
# Environment variable approach
FMP_TOOL_SETS=search,company,quotes FMP_ACCESS_TOKEN=your_api_key npm run dev
# CLI argument approach (higher precedence)
npm run dev -- --fmp-token=your_api_key --fmp-tool-sets=search,company,quotes
Server-Level Dynamic Mode (All Sessions Start with Meta-Tools):
# Environment variable approach
DYNAMIC_TOOL_DISCOVERY=true FMP_ACCESS_TOKEN=your_api_key npm run dev
# CLI argument approach (higher precedence)
npm run dev -- --fmp-token=your_api_key --dynamic-tool-discovery
Session-Level Configuration (Default - No Server Enforcement):
# Start server without mode enforcement
npm run dev -- --fmp-token=your_api_key
# Dynamic mode - meta-tools for runtime toolset management
npm run dev -- --fmp-token=your_api_key --dynamic-tool-discovery
# Static mode - specific toolsets loaded at startup
npm run dev -- --fmp-token=your_api_key --fmp-tool-sets=search,company,quotes
# Legacy mode - all tools loaded (default)
npm run dev -- --fmp-token=your_api_key
# Start server without token
npm run dev
# Pass token per-session
CONFIG_BASE64=$(echo -n '{"FMP_ACCESS_TOKEN":"your_key"}' | base64)
curl -X POST "http://localhost:8080/mcp?config=${CONFIG_BASE64}" -d '...'
The project uses Vitest for testing. You can run tests in several ways:
# Run tests in watch mode (for development)
npm test
# Run tests once
npm run test:run
# Run tests with coverage report
npm run test:coverage
The coverage report will be generated in the coverage/ directory and displayed in the terminal. You can open coverage/index.html in your browser to view a detailed HTML coverage report.
If you encounter any bugs, have feature requests, or need help with the project, please open an issue on GitHub:
When reporting issues, please include:
This helps us understand and resolve issues more quickly.
This project is licensed under Apache License Version 2.0
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by stripe
Provides SDKs and tools to integrate Stripe's billing and API services with large language models, agent frameworks, and token‑metering for AI‑powered products and businesses.
by goat-sdk
Enables AI agents to send and receive payments, purchase goods and services, execute investment strategies, tokenize assets, and obtain financial insights by leveraging blockchains, stablecoins, and wallets.
by financial-datasets
Provides access to income statements, balance sheets, cash flow statements, stock prices, market news, and cryptocurrency data through MCP tools for AI assistants.
by alpacahq
Enables large language models to trade stocks and options, retrieve real‑time and historical market data, and manage portfolios using plain English commands through a local or remote MCP server.
by stefanoamorelli
Provides an MCP server that connects AI models to SEC EDGAR filings, enabling real‑time retrieval of company filings, financial statements, and insider‑trading data with exact XBRL precision and verifiable filing references.
by ariadng
Enables AI LLMs to execute trades on the MetaTrader 5 platform through the Model Context Protocol.
by XeroAPI
Provides a bridge between the Model Context Protocol and Xero's API, enabling standardized access to Xero accounting and business features.
by kukapay
Provides a comprehensive set of cryptocurrency technical analysis indicators and ready‑to‑use trading strategies through an MCP interface, enabling AI agents and applications to generate buy, hold, or sell signals.
by kukapay
Integrates the Freqtrade cryptocurrency trading bot with MCP, exposing its REST API as tools for AI agents to perform automated trading operations.
{
"mcpServers": {
"financial-modeling-prep-mcp": {
"command": "npx",
"args": [
"-y",
"financial-modeling-prep-mcp-server"
],
"env": {
"FMP_ACCESS_TOKEN": "<YOUR_API_KEY>"
}
}
}
}claude mcp add financial-modeling-prep-mcp npx -y financial-modeling-prep-mcp-server