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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。