Skip to main content
Glama
MCP-Quant Financial Research

MCP-Quant Financial Research

by art3mis-xo

MCP-Quant Financial Research

An MCP server that gives LLM clients (Claude Desktop, VS Code, etc.) three deterministic financial tools. The LLM decides which tool to call; the server fetches daily prices from Yahoo Finance and computes the numbers with pandas/numpy, so no figure in the output is generated by a language model.

Every response includes where the data came from, when it was retrieved, and basic data-quality counts.

Tools

Tool

Input

Returns

get_price_history

symbols, start_date, end_date (ISO dates)

{"prices": [{"Date": ..., "<SYMBOL>": price, ...}], "provenance": {...}}

calculate_risk_metrics

symbols, start_date, end_date

{"metrics": [...], "provenance": {...}}, one metrics object per symbol

research

query (free text, e.g. "Compare TSLA and NVDA over the last year")

A report with the parsed plan, metrics, provenance and a one-paragraph summary

There is also one resource, research://capabilities, which returns a short text description of the server.

Inputs are validated with Pydantic before any data is fetched: 1–10 symbols (upper-cased), and end_date must be after start_date.

Metrics

Computed per symbol from adjusted daily closes in analytics.py:

Metric

Definition

Cumulative return

last price / first price − 1

Annualized return

(1 + cumulative)^(252 / trading days) − 1

Annualized volatility

sample std of daily returns × √252

Sharpe ratio

mean / std of daily returns × √252, risk-free rate 0; null if returns have zero variance

Maximum drawdown

worst fall from a running peak

Beta

cov(symbol, SPY) / var(SPY) on date-aligned daily returns

Provenance

source, retrieved_at (UTC), symbols, start_date, end_date, and quality: rows, missing_rows, duplicate_rows, first_date, last_date, adjusted_prices.

Related MCP server: MCP Financial Analyst

Setup

Requires Python 3.12+.

python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env   # no keys are required today

Run

Smoke test (one live query, prints the report):

python main.py

Start the MCP server over stdio:

python -m financial_mcp.server

VS Code picks it up from .vscode/mcp.json.

Test and lint

pytest -q
ruff check src tests main.py

The tests replace Yahoo Finance with fixed prices, so they run offline. They cover the metric calculations and each tool's output.

Roadmap

Next: LLM-based query planner with an evaluation against the current rule-based parser.


For research and education only. Not investment advice.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      Not graded
      maintenance
      Enables LLMs to retrieve, analyze, and visualize stock prices and financial report data for quantitative trading research and investment analysis. Provides real-time and historical stock data, financial statement analysis, key metric calculations, and trading signal visualization.
      13
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables financial analysis by fetching real market data from Yahoo Finance, computing moving averages, returns, and volatility, and generating price charts.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides tools to research crypto trading strategies via backtesting, walk-forward validation, and paper trading, with a deflated-Sharpe overfitting check. Enables natural-language-driven analysis and interpretation of strategy performance.
      2
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables querying stock quotes and computing portfolio risk/return metrics such as Sharpe ratio, drawdown, volatility, and correlations, as well as historical summaries and asset comparisons.
      4
      MIT