Financial Data MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Financial Data MCP Server Compare Apple, Microsoft, and Google stock metrics"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Financial Data MCP Server
A remote MCP (Model Context Protocol) server that exposes stock market and company financial data as tools, callable by any MCP client (Claude Desktop, Claude.ai, custom agents). Built to demonstrate MCP protocol design, remote HTTP transport, cloud deployment, and production concerns like caching and structured logging.
Live server: https://financial-data-server.fastmcp.app/mcp
(authenticated — see Authentication below)
Tech Stack
Language: Python 3.12, managed with uv
Framework: FastMCP 4.0.3
Data source: yfinance (Yahoo Finance)
Deployment: FastMCP Cloud
Transport:
streamable-http
Related MCP server: Yahoo Finance MCP Server
Architecture
The codebase is split into two layers with a single responsibility each:
data_fetcher.py— all yfinance calls, isolated from any MCP concern. Raises a singleDataFetchErrorfor any failure (invalid ticker, network issue, empty data) so the tool layer has one exception type to handle. Has zero dependency on FastMCP, so it can be reused standalone in another project without pulling in MCP at all.server.py— the MCP tool layer only: schemas (inferred from type hints), docstrings (what the client LLM reads to decide when to call a tool), and translatingDataFetchErrorinto a clean{"error": true, "message": ...}dict instead of letting a raw traceback reach the client.
This separation means the data-fetching logic could later be lifted straight into a different project (e.g. a RAG platform) that also needs stock data, with no MCP-specific code coming along for the ride.
Tools
Tool | Description |
| Resolve a company name to candidate ticker symbols |
| Current price, day change %, volume |
| Sector, industry, market cap, short description |
| P/E, EPS, ROE, debt-to-equity |
| Historical OHLC data for a given period |
| Revenue, net income, margins (annual/quarterly) |
| Side-by-side comparison of 2-3 tickers |
Every tool validates its input and never lets a raw exception reach the
client — failures come back as a structured {"error": true, "message": str}
so an LLM client can reason about what went wrong.
Local Setup
git clone https://github.com/Kanishka-dabas/financial-data-mcp-server.git
cd financial-data-mcp-server
uv syncRun locally with MCP Inspector
uv run fastmcp dev inspector server.pyOpens a browser UI to call each tool directly and inspect its schema/response.
Deployment
Deployed on FastMCP Cloud, which builds the
repo on every push to main and serves it over HTTPS with streamable-http
transport.
if __name__ == "__main__":
mcp.run(transport="streamable-http")FastMCP Cloud manages host/port binding at the platform level, so no hardcoded host/port is needed in the entrypoint.
Authentication
Access to the deployed server requires authentication via FastMCP Cloud's built-in (Horizon) auth layer — a client must log in and be a member of the hosting organization to connect.
Reliability & Performance
Caching: An in-memory TTL cache (60s) sits in front of the Yahoo Finance
.infocall, sinceget_stock_quote,get_company_overview, andget_financial_ratiosall read from the same underlying data. Measured ~2000x speedup on a cache hit (2s → <1ms) and reduces load against Yahoo's unofficial, rate-limit-sensitive endpoint. (Note: in-memory only — resets on restart and isn't shared across multiple replicas. A multi-instance production deployment would use a shared cache like Redis.)Structured logging: Every tool logs on call, success, and failure, with
INFOfor normal operation,WARNINGfor expected failures (e.g. invalid ticker), andERRORfor unexpected exceptions — keeping monitoring noise separate from real bugs.
Known Limitations
The in-memory cache is per-instance and non-persistent.
Authentication is enforced by FastMCP Cloud's platform-level auth rather than a custom OAuth provider wired into the server code.
What This Project Demonstrates
Designing MCP tools with clear schemas and LLM-readable docstrings
Separating protocol-layer code from business/data logic
Remote MCP transport (
streamable-http) vs local (stdio)Cloud deployment and debugging real build-time vs runtime environment differences (e.g. env vars not available during a build-time inspection step)
Practical reliability engineering: caching with measured impact, structured logging with intentional log-level discipline
Available Tools
7 toolscompare_stocks_toolCompare Stocks ToolA
Compare key metrics (price, change%, P/E, ROE, debt-to-equity) across 2-3 tickers.
Inputs: tickers (required). Returns: object
get_company_overview_toolGet Company Overview ToolA
Get a company profile overview for a ticker symbol.
Returns sector, industry, country, market cap, employee count, website, and a short (truncated) business description.
Inputs: ticker (required). Returns: object
get_financial_ratios_toolGet Financial Ratios ToolB
Get key financial ratios for a ticker: P/E, EPS, ROE, debt-to-equity.
Inputs: ticker (required). Returns: object
get_historical_prices_toolGet Historical Prices ToolA
Get historical OHLC (Open/High/Low/Close) price data for a ticker.
Inputs: ticker (required), period. Returns: object
get_income_statement_toolGet Income Statement ToolB
Get revenue, net income, and margins from a company's income statement.
Inputs: ticker (required), quarterly. Returns: object
get_stock_quote_toolGet Stock Quote ToolA
Get the current stock quote for a ticker symbol.
Returns live/latest price, previous close, day's change (absolute and percent), day high/low, volume, and market state (e.g. REGULAR, CLOSED, PRE).
Inputs: ticker (required). Returns: object
search_tickerSearch TickerA
Resolve a company name to its stock ticker symbol(s).
Use this first when you have a company name (e.g. "Apple", "Tata Motors") rather than an exact ticker. Returns up to 5 candidate matches with symbol, name, exchange, and security type, ranked by relevance.
Inputs: company_name (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct financial data aspect, but get_financial_ratios_tool and get_income_statement_tool could both be selected for fundamental analysis queries, and compare_stocks_tool overlaps with fields already covered by quotes and ratios. The descriptions help clarify boundaries, so the set is mostly unambiguous.
Most tools follow a predictable get_[resource]_tool pattern, while search_ticker and compare_stocks_tool use different verbs but still follow the verb_noun_tool convention. The snake_case style is consistent and readable, with only minor deviations from the dominant 'get_' prefix.
Seven tools is a well-scoped count for a financial data server, covering ticker resolution, quotes, company overview, financial ratios, historical prices, income statements, and cross-stock comparison. Each tool has a clear role and none feel redundant.
Core equity research workflows are covered: finding tickers, getting current prices, historical data, company profiles, key ratios, income statement data, and comparisons. Missing balance sheet/cash flow statements and batch quote retrieval are minor gaps that agents can work around.
Maintenance
Related MCP Connectors
Financial data MCP server for global quotes, news, financials, funds, bonds, IPOs and macro data.
Live stock quotes, a stock screener, crypto prices and FX rates as agent tools.
Hosted MCP server for Indian NSE/BSE stock research: 59 tools for quotes, financials and ratios, peers, shareholding and pledge, filings with extracted facts, screens, F&O and FII/DII context. Source and freshness on every answer; no buy/sell calls.
Financial data and research MCP for US/CN/JP equities: filings, statements, ownership, signals.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables querying real-time and historical financial market data for stocks, options, forex, and crypto, including quotes, trades, technical indicators, and reference data through a set of MCP tools.713MIT
- AlicenseAqualityDmaintenanceEnables querying stock data, financial information, news, and historical prices from Yahoo Finance through a set of MCP tools.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to retrieve US stock market OHLCV data, company fundamentals and financial statements, FRED macroeconomic indicators, market news, Reddit/StockTwits sentiment, and Polymarket prediction market probabilities via simple tools.MIT
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients to retrieve Tiingo financial data through tools for stock prices, news, forex, fundamentals, dividends, and splits.-