FI

Financial Datasets MCP Server for Stock Market Data

Access real-time and historical stock market data via the Financial Datasets MCP server for reliable, searchable market insights and analytics.

Quick Install
npx -y @financial-datasets/mcp-server

Overview

The Financial Datasets MCP Server exposes real-time and historical stock market data through the Model Context Protocol (MCP). It acts as a local MCP provider that AI assistants (Claude, other MCP-enabled agents) can query to retrieve income statements, balance sheets, cash flow statements, stock prices, crypto prices, and company news. By running this server locally, you give your agent a reliable, searchable channel to fetch market data for analysis, reporting, or automated workflows.

This server is built to be lightweight and easy to run. It uses the Financial Datasets API as the backend data source and presents a set of MCP tools that map to common financial information needs. Developers can run the server locally, configure it for an MCP client (for example, Claude Desktop), and then use plain-language prompts or programmatic MCP calls to fetch structured market data.

Features

  • Provide structured financial statements: income statements, balance sheets, cash flows
  • Real-time and historical equity prices (per ticker)
  • Company-specific news feeds
  • Crypto tickers and price endpoints (current and historical)
  • Designed as an MCP server for seamless integration with MCP-enabled assistants
  • Simple install and run process; environment-based API key configuration

Installation / Configuration

Prerequisites:

  • Python 3.10+
  • uv package manager (used to create virtualenv and run the app)
  • A Financial Datasets API key

Clone repository and prepare environment:

git clone https://github.com/financial-datasets/mcp-server
cd mcp-server

Install uv (if not installed):

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
curl -LsSf https://astral.sh/uv/install.ps1 | powershell

Create virtual environment and install dependencies:

# create and activate venv (uv will create .venv)
uv venv
source .venv/bin/activate     # macOS/Linux
# .venv\Scripts\activate      # Windows PowerShell

# install required packages
uv add "mcp[cli]" httpx

API key configuration:

cp .env.example .env
# Edit .env and set:
# FINANCIAL_DATASETS_API_KEY=your-financial-datasets-api-key

Run the server:

uv run server.py

Connecting to an MCP client (example: Claude Desktop) requires adding the server command to the client configuration. Example Claude Desktop config (macOS path shown):

{
  "mcpServers": {
    "financial-datasets": {
      "command": "/path/to/uv",
      "args": [
        "--directory",
        "/absolute/path/to/financial-datasets-mcp",
        "run",
        "server.py"
      ]
    }
  }
}

Replace /path/to/uv with which uv and the directory path with the absolute path for your clone. Restart the MCP client after configuration.

Available Tools

The server exposes a set of MCP tools. Each tool returns structured JSON-style data that agents can consume.

Tool namePurpose
get_income_statementsRetrieve historical income statements for a company (by ticker)
get_balance_sheetsRetrieve historical balance sheets for a company
get_cash_flow_statementsRetrieve historical cash flow statements for a company
get_current_stock_priceFetch the latest market price for an equity ticker
get_historical_stock_pricesRetrieve historical prices over a date range for an equity
get_company_newsFetch recent news articles related to a company
get_available_crypto_tickersList available crypto tickers supported by the API
get_crypto_pricesFetch crypto price series (alias for historical prices)
get_historical_crypto_pricesRetrieve historical crypto prices over a date range
get_current_crypto_priceFetch the latest price for a crypto ticker

Each tool accepts standard identifiers (e.g., ticker symbol) and optional arguments such as date ranges, frequency, or pagination parameters.

Use Cases

  • Research: “Show me Apple’s income statements for the last 3 years” — agent uses get_income_statements to return structured growth metrics and yearly totals ready for analysis.
  • Portfolio monitoring: Periodically call get_current_stock_price for holdings to compute P&L or trigger alerts if prices cross thresholds.
  • Backtesting: Use get_historical_stock_prices to obtain daily prices for a ticker between two dates for use in backtesting strategies.
  • News-driven workflow: Combine get_company_news with sentiment analysis to flag companies with negative headlines before automatic position-sizing adjustments.
  • Crypto analysis: Use get_available_crypto_tickers to discover supported assets, then get_historical_crypto_prices to build price indicators.

Example natural-language prompts for an MCP-enabled assistant:

  • “Get historical prices for MSFT from 2024-01-01 to 2024-12-31.”
  • “What’s the current price for TSLA and show last 30 days of daily closes.”
  • “Fetch the latest income statement for GOOGL and list revenue and net income.”

Tips:

  • Specify tickers, date ranges, and frequency in your prompt to get precise results.
  • For programmatic access, invoke the appropriate MCP tool and handle the returned JSON payload for charting or analysis.

If you run into permission or API-key issues, verify FINANCIAL_DATASETS_API_KEY in .env and ensure network access to Financial Datasets endpoints.