Empower Your AI Agents with Institutional-Grade Financial Data
We are excited to announce that Financial Modeling Prep (FMP) now supports the Model Context Protocol (MCP). This new integration allows you to connect FMP's 70,000+ stock data points directly into AI agents (like Claude, Cursor, or custom bots) without writing a single line of API wrapper code.
What is the Model Context Protocol (MCP)?
Think of MCP as a "USB-C port" for Artificial Intelligence.
Before MCP, if you wanted an AI to access a specific dataset (like your calendar, a database, or stock prices), you had to write custom code to "glue" them together. This created a messy web of unique integrations for every new tool.
MCP changes that. It is an open standard (introduced by Anthropic) that provides a universal way for AI applications ("Clients") to connect to external data sources ("Servers").
- Standardized: Once a data source speaks "MCP," any AI agent can instantly understand how to use it.
- Discoverable: The AI automatically learns what tools are available (e.g., "Get Stock Price," "Get Balance Sheet") without you needing to paste API documentation into the chat.
Why is This Valuable?
For developers and financial analysts, MCP solves three critical problems:
- Zero "Glue Code": You don't need to write Python scripts to fetch data, parse JSON, and feed it to the LLM. The MCP server handles the data fetching automatically.
- Smarter Agents: Instead of hallucinating financial data, your AI agent has a direct, real-time line to FMP's database. It can "call" the right tool exactly when it needs to answer a question.
- Token Efficiency: You no longer need to paste massive API documentation into the prompt to teach the AI how to use FMP. The protocol handles the tool definitions efficiently, saving your context window for actual analysis.
Introducing the FMP MCP Server
Our new MCP Server wraps all of our traditional REST API endpoints into ready-to-use AI tools.
When you connect your AI agent to FMP's MCP server:
- Instant Tool Access: The AI instantly gains the ability to "pull" real-time prices, historical statements, and technical indicators.
- Seamless Integration: Each request made by the AI simply counts toward your existing API limits—no new accounts or complex billing required.
- Context-Aware: The AI knows exactly which parameters are required (e.g., "Ticker," "Date," "Period") because the MCP server provides strict definitions.
Step-by-Step Connection Guide
The FMP MCP server is a remote server, so there is nothing to install or host. Use an official connector in Claude or ChatGPT where you can; any other MCP client connects with the Connection URL and your API key.
Prerequisites
- An active FMP API Key (Get one here).
- An MCP-compatible client (e.g., Claude Desktop, Cursor, or a custom script).
Official Connectors
FMP has official connectors for Claude and ChatGPT. Add FMP from each product's connector directory (search for Financial Modeling Prep) and sign in with your FMP account; no API key is pasted. To connect with an API key instead, use the Connection URL below.
The server is also an OAuth 2.0 protected resource, which is how the official connectors sign in. OAuth clients must be registered with us in advance, either by client ID or by Client ID Metadata Document (CIMD) URL; there is no open dynamic client registration. If you want to use OAuth in your own application, contact us with your client details and we will add you to the allowlist.
The Connection URL
This is the "magic link" you will need for all integrations:
Clients that let you set headers can instead connect to https://financialmodelingprep.com/mcp and send X-API-Key: YOUR_API_KEY. Prefer this where you can, since it keeps the key out of URLs and logs.
A key that is still a template placeholder (for example ${FMP_API_KEY} or <your-key>) is rejected with a 401 at connect time, rather than opening a session whose every call fails.
Connection Details
- Transport: Streamable HTTP only.
- Sessions expire after 15 minutes idle; a request on an expired session gets a
404, and the client should initialize again (most clients do this automatically). - Timeouts: tool calls longer than 25 seconds return an error. Narrow the query (fewer symbols, a shorter date range, a lower
limit) and retry.
A. How to Connect to Claude (Online and Desktop)
- Open Settings and select the Connectors section.
- Select Add custom connector and paste the FMP Connection URL into the "Remote MCP Server URL" field. Enter a name of your choice in the "Name" field and select Add.
- Start a new Claude chat, and FMP's tools will be readily available. You can simply ask: "Compare the P/E ratio of Apple and Microsoft over the last 5 years."
B. How to Connect to Cloudflare Workers AI
- Navigate to the Cloudflare Workers AI Playground.
- Locate the MCP Servers section on the left sidebar.
- Paste the FMP Connection URL (from above) into the "Server URL" field.
- Click Add.
- The available FMP tools will appear in the list. You can now prompt the AI: "Use the FMP tool to find the latest earnings for NVDA."
C. How to Connect via Python
If you are building a custom agent using Python, you can use standard MCP libraries. Here is a simple example using FastMCP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import asyncio
from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport
transport = StreamableHttpTransport(
"https://financialmodelingprep.com/mcp",
headers={"X-API-Key": "YOUR_API_KEY"},
)
async def main():
async with Client(transport) as client:
tools = await client.list_tools()
print([t.name for t in tools])
# ['ESG', 'analyst', 'calendar', 'chart', 'company', ...]
result = await client.call_tool("quote", {"endpoint": "quote", "symbol": "AAPL"})
print(result.content[0].text)
# [{"symbol": "AAPL", "name": "Apple Inc.", "price": ..., ...}]
asyncio.run(main())Tool Structure
Tools are grouped by data category rather than one tool per endpoint, which keeps the tool list compact and under limits from some common client applications. There are up to 28 tools, depending on your plan, such as quote, statements, company, calendar, secFilings, technicalIndicators and news, and each covers a set of related Stable API endpoints.
Every tool takes the same shape of input:
- endpoint (required): the endpoint within the category to call, as an enum. For example,
quoteacceptsquote,quote-short,batch-quote,aftermarket-quoteand others;statementsacceptsincome-statement,balance-sheet-statement,cashflow-statementand others. - Endpoint parameters (optional in the schema): the union of the parameters of every endpoint in the tool, such as
symbol,from_date,to_date,periodandlimit.from_dateandto_dateare the RESTfromandtoparameters. Because one schema serves several endpoints, the tool description lists each endpoint with the parameters it requires, marked with*. - limit: when an endpoint supports
limitand none is passed, it defaults to 50, or to your plan's cap if that is lower.
Example tools/call arguments:
1
2
3
4
5
6
7
8
9
{
"name": "statements",
"arguments": {
"endpoint": "income-statement",
"symbol": "AAPL",
"period": "annual",
"limit": 5
}
}- Plan-aware tool list:
tools/listreturns only the endpoints your key can call, and omits tools with none. A plan change takes effect on your next session. - Results: the endpoint's JSON response, returned as a single text content block. An empty result is not an error: it comes back as
[], or as anot_foundobject when you passed an identifier such assymbol. - Errors: returned as tool results with
isError: trueand a message naming the tool, and the endpoint where relevant: a missing required parameter, a plan restriction (with the plans that include the endpoint), a rate limit reached, a rejected API key, or a timeout.
Use Cases: What Can You Build?
- The "Junior Analyst" Chatbot: A standardized chat interface where portfolio managers can ask natural language questions ("Show me the debt-to-equity trend for Tesla vs. Ford") and get accurate, data-backed charts and answers.
- Automated Due Diligence: An agent that autonomously wakes up when a stock drops 5%, pulls the latest news and SEC filings via MCP, summarizes the cause, and emails you a report.
- Live Investment Research: Connect FMP to an IDE like Cursor to get live financial context right inside your code editor while building fintech apps.
Ready to get started?
Grab your API key and start building smarter financial agents today.