MCP server · 2026
Tearsheet
An MCP server that gives an LLM client a working set of quantitative finance tools (prices, fundamentals, ratios, technical indicators, strategy backtests and rendered charts) as callable functions.
- Tools exposed
- 14
- Transport
- stdio MCP
- Backtest metrics
- 4
return, Sharpe, drawdown, win rate
The problem
An LLM asked about a stock will happily invent a P/E ratio. The fix isn't a better prompt, it's giving the model real tools and a real data source, but tool design is the actual work. Too granular and the model burns turns stitching calls together; too coarse and it can't express what the user asked for.
Approach
01Fourteen tools at the right granularity
Grouped into price and corporate-action history, financial statements, computed ratios, technical indicators and chart rendering. Each returns structured data the model can reason over rather than prose it has to re-parse.
02Backtesting as a first-class tool
A moving-average crossover strategy runs server-side and returns total return, Sharpe ratio, max drawdown and win rate, so the model can compare strategies on numbers it didn't have to compute itself, which is exactly where LLMs go wrong.
03Charts as output
matplotlib and mplfinance render candlestick and indicator charts, letting a client surface a visual answer instead of a table of floats.
Results
Installs as a local stdio MCP server in Claude Desktop or Cursor, after which an ordinary conversational question resolves into a chain of real tool calls against real market data. Built with uv and linted with ruff.
What it doesn't do
- No test suite yet, which is the highest-value thing to add, given the surface area is 14 tools over an external API.
- Data comes from yfinance, which is unofficial and rate-limits under load. Fine for research, not for anything production-facing.
- The backtester implements one strategy family (MA crossover) with no transaction costs or slippage modelled, so results are illustrative rather than tradeable.
Next project
Three-Player Hexagonal Othello