
QuantContext
io.github.zomma-devPublished by GitHub account zomma-devv0.1.2Updated Oct 24, 2026
Deterministic stock screening, backtesting, and factor analysis for AI trading agents
Overview
Lets an assistant screen stocks, backtest trading strategies, and run factor analysis on real market data.
- What you can do
- QuantContext exposes three tools that chain into a research workflow: screen_stocks filters S&P 500, Nasdaq 100, or Russell 2000 names by fundamentals, momentum, quality, technical signals, or a multi-factor blend; backtest_strategy runs a rebalance-loop test and returns CAGR, Sharpe, max drawdown, an equity curve, and a trade log; factor_analysis decomposes returns into Fama-French factors with alpha, t-statistic, loadings, and R-squared. The same functions are importable from Python. Results are computed from market data rather than generated by a model.
- When to use it
- Useful when an assistant needs to answer quantitative equity questions: ranking stocks by a screen, checking how a rule-based strategy would have performed historically, or separating real alpha from factor exposure. It suits research and exploration, not live trading.
- Requirements
- Runs locally over stdio as a PyPI package (quantcontext-mcp), typically launched with uvx or installed with pip. No API keys or configuration are declared. It needs network access on first use to download prices, fundamentals, Fama-French factors, and index lists, which are then cached under ~/.cache/quantcontext; the first call takes roughly 10-30 seconds.
Installation
In SourceWeft
- Open QuantContext in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
QuantContext
QuantContext is an MCP server that turns plain-English strategy descriptions into executable quant research: screen stocks by any criteria, backtest over historical data, and run factor analysis to see where the returns come from. Every number is computed from real market data, not generated by an LLM. Results are fully reproducible.
Works with Claude, Codex, OpenCode, or any other MCP-compatible coding agent.
Install
Claude Code:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
No API keys. No configuration.
Tools
Three tools that compose into a full research workflow:
Sample Prompts
Stock screening:
Backtesting:
Full research workflow:
Screen Types
Use from Python
The tools are also importable directly — no agent required. Useful if you have an existing script and want to plug in backtesting or factor analysis.
Strategies are expressed using the built-in screen types from the table above. All functions are async and return JSON strings.
Data
All public data, no API keys required.
The first tool call downloads and caches data (10-30 seconds). All subsequent calls use the local cache: screening under 1s, backtesting 3-8s.
To skip the cold start, run once after install:
Links
License
MIT
Source: README.md at commit 00bc2e7
Tools
0Version history
1- v0.1.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts