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.
To use this MCP server, you'll need to obtain a Financial Modeling Prep access token:
# 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
# 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
The server operates in three different modes that control how tools are loaded:
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
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
Loads all 253+ tools at session creation (default behavior):
# Just specify the token with no mode parameters
npm run dev -- --fmp-token=YOUR_TOKEN
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": {}
}
}'
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",...}'
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"
}
}
}'
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"
}
}
}'
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"
}
}
}'
When using dynamic mode, you can load and unload toolsets as needed:
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"
}
}
}'
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": {}
}
}'
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"
}
}
}'
The server provides tools organized into these categories:
You can also access this MCP server through these hosted platforms:
These platforms handle hosting and authentication, simplifying integration with AI assistants.
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.
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.
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}"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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