Skip to main content
Glama
porkornrawee

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: Financial Data 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYes
periodNo6mo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses the computed indicators (SMA20, SMA50, EMA20, RSI14) and explains that insufficient history results in null values, providing clear behavioral expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured, using a docstring format with dedicated Args and Returns sections. It front-loads the main purpose and every sentence provides value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (not shown), the description still explains the return values in detail, including the closing price, three moving averages, RSI, and handling of nulls. It covers the lookback window and default behavior, making it complete for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so parameter documentation relies entirely on the description. The description adds meaning to both parameters: symbol is explained with an example (AAPL), and period is described as a lookback window with default '6mo' and a cross-reference to get_stock_history for more details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Compute common technical indicators for a stock over a lookback window,' which uses a specific verb and resource, and clearly distinguishes from sibling tools like get_stock_history (raw history) and get_stock_quote (current quote).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use (when needing technical indicators) and references get_stock_history for period details, but does not explicitly state when not to use or contrast alternatives. Sibling tools are distinct, so some guidance is present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
coin_idYes
vs_currencyNousd

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries full burden. It discloses the output format (current price and 24h change) and the external dependency (CoinGecko) through the parameter description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args and Returns sections, but it is slightly verbose. The key information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, the description explains parameters and return values, and an output schema exists. No gaps are apparent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description fully compensates by explaining both parameters: coin_id is the slug (not ticker) with examples, and vs_currency is the quote currency with examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it gets the latest cryptocurrency price, with specific examples. The sibling tools are for stocks, so it distinguishes well.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the tool name and sibling context (crypto vs stocks), but no explicit when-to-use or when-not-to-use guidance is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYes
periodNo1mo
intervalNo1d

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the output format (list of candles ordered oldest-to-newest) and parameter constraints. No contradictions; it is a read-only tool without side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loading the main purpose, then listing parameters with examples in a clean formatted style. Every sentence adds value without unnecessary fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and presence of an output schema (though not shown), the description adequately covers parameter usage and return format. It does not mention data source or rate limits, but these are not critical for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining symbol as 'Ticker symbol, e.g., AAPL', period as 'Lookback window', interval as 'Candle size', and provides example values. This is effective but could be slightly more detailed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves historical OHLCV candles for stocks or ETFs, distinguishing it from sibling tools like get_stock_quote (current price) and analyze_stock (analysis). The verb 'Get' and resource 'historical OHLCV candles for a stock or ETF' are specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear parameter guidance (symbol, period, interval) with examples, but does not explicitly state when to use this tool versus alternatives like analyze_stock or get_stock_quote. The context is implied for historical data retrieval.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It mentions the return fields (price, day change, percent change, currency) but does not disclose data source, latency, real-time vs delayed data, error handling, or rate limits. The description is adequate but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two short sections: a clear one-line purpose followed by parameter and return details. It is front-loaded and contains no extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, the description covers the main purpose and return values. An output schema exists, so return details may be further documented there. However, it lacks mention of error cases, prerequisites, or any prerequisites for use, which would enhance completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% coverage, so the description must compensate. It explains the 'symbol' parameter as a ticker symbol with examples (AAPL, MSFT, SPY), adding meaning beyond the schema's bare type definition. Could be slightly more precise about case sensitivity or exchange, but overall helpful.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get the latest price for a stock or ETF', specifying the verb and resource. The tool distinguishes itself from siblings like 'get_crypto_price' (crypto) and 'get_stock_history' (historical data) by focusing on current price retrieval for stocks and ETFs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus siblings. The description implies it's for stocks/ETFs but does not mention when not to use it or suggest alternatives like 'analyze_stock' for deeper analysis.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 4 tool updatesv0.1.0
    • First observedanalyze_stock
    • First observedget_crypto_price
    • First observedget_stock_history
    • First observedget_stock_quote

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

ActivityMaintained
ResponsivenessNo 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
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that provides financial tools for retrieving real-time stock data, analyst recommendations, financial statements, and web search capabilities for a LangGraph-powered ReAct agent.
    1
    -
  • 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
    34 PyPI
    1
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides real-time and historical cryptocurrency market data using ccxt, enabling price tracking and alerts through the Model Context Protocol.
    1
    -