Skip to main content
Glama
finance-mcp

finance-mcp

by porkornrawee

finance-mcp

Real-time stock & crypto market data for LLMs, over the Model Context Protocol.

CI Python License: MIT Code style: ruff

finance-mcp is an MCP server that lets any MCP-compatible client (Claude Desktop, Cline, Continue, …) pull live equity and crypto quotes, historical candles, and common technical indicators — so the model can reason over real market data instead of hallucinating it.

┌──────────────┐   MCP (stdio)   ┌───────────────┐   HTTP   ┌──────────────┐
│  LLM client  │ ◀─────────────▶ │  finance-mcp  │ ◀──────▶ │  yfinance    │
│ (Claude etc.)│   tool calls    │    server     │          │  CoinGecko   │
└──────────────┘                 └───────────────┘          └──────────────┘

Demo

finance-mcp demo

The session above is illustrative; the JSON matches the real shape returned by compare_assets. Regenerate it any time with python scripts/make_demo.py.

Related MCP server: Yahoo Finance MCP Server

Features

  • get_stock_quote — latest price, day change, % change for any ticker (AAPL, SPY, …)

  • get_quotes — batch quotes for many tickers, fetched concurrently

  • get_stock_history — OHLCV candles over a configurable period/interval

  • get_crypto_price — live crypto quotes via CoinGecko (no API key needed)

  • analyze_stock — SMA(20/50), EMA(20), and RSI(14) computed in-process

  • compare_assets — rank a mix of stocks and crypto by their % move

  • Provider layer isolates each upstream API behind a small, fully unit-tested surface

  • Async throughout; blocking provider I/O is offloaded to worker threads

Install

git clone https://github.com/porkornrawee/finance-mcp.git
cd finance-mcp
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Use with Claude Desktop

Add this to your claude_desktop_config.json (see examples/):

{
  "mcpServers": {
    "finance": {
      "command": "finance-mcp",
      "args": []
    }
  }
}

Restart Claude Desktop, then ask things like:

"What's the RSI on NVDA over the last 6 months, and how does it compare to Bitcoin's 24h move?"

Tools

Tool

Arguments

Returns

get_stock_quote

symbol

price, change, %, currency

get_quotes

symbols

list of quotes (per-symbol errors isolated)

get_stock_history

symbol, period, interval

list of OHLCV candles

get_crypto_price

coin_id, vs_currency

price, 24h change

analyze_stock

symbol, period

latest close + SMA/EMA/RSI

compare_assets

stocks, crypto, vs_currency

assets ranked by % move + best/worst

Note: crypto uses CoinGecko ids (the slug), e.g. bitcoin, not BTC.

Development

ruff check .     # lint
mypy src         # type-check
pytest -q        # tests (network-free; CoinGecko is mocked with respx)

The indicator math in indicators.py is intentionally pure and dependency-free so it can be tested deterministically without hitting any API.

Disclaimer

This project is for informational and educational purposes only. It is not financial advice. Market data is provided by third parties on a best-effort basis and may be delayed or inaccurate.

License

MIT © porkornrawee — see LICENSE.

Available Tools

4 tools
analyze_stockA

Compute common technical indicators for a stock over a lookback window.

Args: symbol: Ticker symbol, e.g. AAPL. period: Lookback window (see get_stock_history). Defaults to 6 months.

Returns the latest close alongside SMA(20), SMA(50), EMA(20) and RSI(14). Indicators that lack enough history in the window are returned as null.

Inputs: symbol (required), period. Returns: object

get_crypto_priceA

Get the latest price for a cryptocurrency.

Args: coin_id: CoinGecko coin id (the slug, not the ticker): bitcoin, ethereum, solana. Note: use bitcoin, not BTC. vs_currency: Quote currency, e.g. usd, eur, thb.

Returns a quote with the current price and 24h change.

Inputs: coin_id (required), vs_currency. Returns: object

get_stock_historyA

Get historical OHLCV candles for a stock or ETF.

Args: symbol: Ticker symbol, e.g. AAPL. period: Lookback window. One of: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, max. interval: Candle size. One of: 1m, 5m, 15m, 1h, 1d, 1wk, 1mo.

Returns a list of candles ordered oldest-to-newest.

Inputs: symbol (required), period, interval. Returns: object

get_stock_quoteA

Get the latest price for a stock or ETF.

Args: symbol: Ticker symbol, e.g. AAPL, MSFT, SPY.

Returns a quote with the current price, day change, percent change, and currency.

Inputs: symbol (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct resource and operation: stock analysis, crypto price, stock history, and stock quote. No overlapping functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (analyze_stock, get_crypto_price, get_stock_history, get_stock_quote).

    Tool Count4/5

    4 tools is a reasonable count for a focused finance server covering basic stock and crypto data, though slightly on the lower side.

    Completeness3/5

    Covers stock history, quote, analysis and crypto price, but misses crypto history, forex, and fundamentals, leaving notable gaps.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time financial data from Yahoo Finance to Large Language Models through the Model Context Protocol, enabling AI models to access stock prices, historical data, and company information.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Provides access to real-time stock prices, financial statements, news, and options data via the Model Context Protocol. It enables AI assistants to retrieve comprehensive market data, including historical prices and analyst recommendations, through a standardized interface.
      9
      64 PyPI
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time stock data, news, company fundamentals, and technical indicators for AI assistants via the Model Context Protocol.
      MIT