QuantForge MCP Server
Enables AI-driven quant research by exposing backtesting, portfolio optimization, and performance analytics tools through MCP, allowing iterative strategy refinement with built-in overfitting guardrails.
README
QuantForge — an AI-driven, polyglot quant research environment
A self-directed summer project: an open-source quant research pipeline (data → strategies → backtest → portfolio optimization → risk/perf analytics), driven by an AI research agent over MCP tools, with a snazzy interactive UI and a cloud-hosted, budget-capped demo.
This is an independent, open-source project. It uses only public data and open-source / personal tooling. It is not affiliated with or built on any employer's internal systems.
Why this exists
- Build something real and portfolio-worthy — recognizable quant workflows, implemented with rigor (no look-ahead/survivorship bias, transaction costs, out-of-sample evaluation), in code the author can defend line-by-line.
- Show the architecture, not just a toy — one
Engine/Strategyinterface, multiple compute backends, an AI agent that drives the whole thing through tools.
Architecture at a glance
data ingestion → strategies → backtest engine → portfolio optimization → risk/perf analytics → UI → cloud
▲ │
└── AI research agent (propose→backtest→read→refine) ◀── MCP tools
Polyglot by design. Every stage exchanges data via an Arrow/Parquet interchange contract, so each piece can use the best tool for the job:
| Stage | Tool | Status |
|---|---|---|
| Backtest engine | Python (custom vectorized) | core |
| Analytics / risk | R (tidyquant, PerformanceAnalytics, PortfolioAnalytics) | core |
| Visual workflow engine | KNIME | stretch |
| (future) comparison engine | — | future |
The compute engine sits behind a single interface (src/quantforge/engine/base.py), so a new engine
can drop in later without touching the rest of the app. See docs/architecture.md.
The AI layer
- MCP server exposes the pipeline as tools:
load_data,run_backtest,optimize_portfolio,get_metrics. - Research agent proposes a strategy, backtests it, reads its own metrics, and iterates — with
mandatory overfitting guardrails (train / validation / untouched holdout, iteration cap,
budget cap). See
src/quantforge/ai/. - Natural-language interface turns "backtest momentum on tech, 2015–2020, 10bps costs" into tool calls and explains the result in plain English.
Two distinct AI uses: the Claude API is a metered, budget-capped runtime feature of this app. Claude Code (a coding assistant) is a separate development tool used to build the repo.
Safety & cost control (read before deploying publicly)
A public URL that can trigger paid API calls will get hit by bots. This repo treats that as a hard
requirement — see src/quantforge/ai/guardrails.py and docs/architecture.md:
- Global server-side budget ledger (daily + total caps); graceful fallback to cached runs.
- Independent AWS Budgets alarm at the infra layer.
- Expensive AI paths gated (passcode); open traffic gets cached scenarios only.
- No LLM-generated code is executed on the public server — public mode is parameter-only.
Quickstart
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # add ANTHROPIC_API_KEY, set AI_BUDGET_USD
pytest # correctness + rigor + safety tests
streamlit run app/streamlit_app.py
R analytics layer:
Rscript analytics_r/tearsheet.R # reads the Parquet hand-off, emits a tearsheet
Repo layout
See docs/architecture.md for the full map. Start here:
docs/PROJECT_BRIEF.md (what to build) and
docs/TEN_WEEK_PLAN.md (the week-by-week checklist).
Status
Scaffold. Modules are stubs with docstrings + TODOs — the implementation is the project.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.