QuantGPT: alpha factor research for China A-shares
QuantGPT
MCP server for Claude Code: the agent designs alpha factors, backtests them on China A-shares and checks them for overfitting
- 510 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- In its autonomous loop the agent runs dozens of backtests and spends model tokens without confirming each step
- With credentials configured, formulas and logins go to WorldQuant BRAIN and the quant-gpt.com cloud, and the final submission is made in your account's name
Install
- Works in
Manual install
pip install -e .Run in the repository folder after git clone https://github.com/Miasyster/QuantGPT.git.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- In its autonomous loop the agent runs dozens of backtests and spends model tokens without confirming each step
- With credentials configured, formulas and logins go to WorldQuant BRAIN and the quant-gpt.com cloud, and the final submission is made in your account's name
This is third-party code. Review the repository files before installing.
What it does
QuantGPT is a factor research engine where the agent does the work and a human reads the final report. The quantgpt package runs as an MCP server and gives Claude Code and Claude Desktop a toolset. list_operators and list_universes show the allowed operators and stock universes, validate_expression checks formula syntax, run_backtest builds a report by stock groups, score_factor gives a 0–100 score with an A–D grade, and diagnose_factor explains why a factor failed. Factors are checked for overfitting by run_anti_overfit, which runs four tests, and run_rolling_validation, which walks through rolling windows. Formulas are written in a built-in expression language with more than 60 operators. Data comes from the free baostock and akshare, and the universes are hs300, csi500, csi1000, csi2000 and small_scale. The wq_brain_submit tool sends a finished factor to the WorldQuant BRAIN platform. The research loop runs as follows: a hypothesis, a batch of 10–20 formulas, concurrent backtests, analysis of results, findings written to a knowledge base, and a stop on convergence or a round limit.
Who it is for. Quant researchers and enthusiasts who look for factors on the China stock market and want an agent to handle the routine backtesting.
Good fit when
- You have a factor idea as a formula and want a quick score on the hs300 or csi500 universe
- A factor backtests well and you still need to rule out overfitting: IC stability tests and rolling validation
- The research spans several sessions and findings accumulate in a knowledge base, so refuted hypotheses are not repeated
- Formulas are being prepared for WorldQuant BRAIN: the wq mode accepts only the compatible subset of operators
- The agent should work through dozens of formula variants on its own and bring back the best ones with diagnostics
Not a fit when
- You need a market outside China: the documentation describes China A-share universes only
- You need proven strategy returns: a highly scored factor remains a hypothesis, and a historical backtest does not guarantee live-market results
- The agent has no network access: baostock and akshare data and the DeepSeek review are fetched online
Example request
Use score_factor to score the formula rank(close / ts_shift(close, 20) - 1) on the small_scale universe for 2024–2025 and tell me whether it passes the overfitting checks.MCP
- Transport
- stdio, http
- Authentication
- not required
Environment variables
LLM_API_KEYsecret- Key of an OpenAI-compatible model for natural-language requests, DeepSeek by default.
WQ_BRAIN_EMAIL- WorldQuant BRAIN account email, needed to submit factors.
WQ_BRAIN_PASSWORDsecret- WorldQuant BRAIN account password.
QUANTGPT_CLOUD_EMAIL- QuantGPT Cloud account email for independent factor validation.
QUANTGPT_CLOUD_PASSWORDsecret- QuantGPT Cloud account password.
Limitations
The server is installed from source only: clone the repository and run pip install -e . The documentation is in Chinese and English, with no Russian text.
Cross-review of conclusions runs on a separate MCP server, deepseek, which needs a DeepSeek key in the .env file. WorldQuant BRAIN credentials are needed only to submit factors, and quant-gpt.com cloud credentials only for independent validation.
The guide calls stdio the most reliable mode for Claude Code and describes HTTP and SSE as less stable.
How to disable. Remove the quantgpt block, and the deepseek block if you added it, from .mcp.json and restart Claude Code. The quantgpt.db database and research notes stay in the project folder and are deleted by hand.
FAQ
How do I connect QuantGPT to Claude Code?
Add a quantgpt block to the project's .mcp.json: type stdio, the absolute path to Python and an absolute cwd pointing at the repository root. After a restart, /mcp shows quantgpt: connected. An HTTP mode exists too, but the guide recommends stdio for Claude Code.
Are keys needed for local backtests?
No. Data comes from the free baostock and akshare, and AUTH_DISABLED=true in the example .env turns off login for local work. An LLM key is needed only for natural-language requests; without it, the formulas-only mode works.
What leaves my machine?
Only what is configured in .env. With WorldQuant BRAIN credentials, wq_brain_submit sends the formula to that platform. With cloud credentials, a class A factor is uploaded to quant-gpt.com for independent validation. Without these settings, calculations stay on your computer.
Does QuantGPT work with markets outside China?
The documentation does not describe it. The hs300, csi500, csi1000, csi2000 and small_scale universes are China A-shares, and the data comes from baostock and akshare.
How do I run the whole research cycle?
Open the project in Claude Code with quantgpt connected and give the agent the loop from the docs: a hypothesis, a batch of formulas, a backtest, analysis of results and findings written to the knowledge base. It stops on convergence or a round limit.
Discussion
No questions or reviews yet.
Related
MCP serversSkill for the QMT terminal: turns a strategy description or research PDF into a daily factor backtest script
An MCP server for agentic trading: backtesting, 462 prebuilt alphas, trade journal analysis and multi-agent research teams
Claude for Financial Services CN
claude-for-financial-services-cn
An unofficial set of 63 skills for Claude Code: DCF, comps, LBO, notes and decks for Chinese equities with Wind, iFind and AkShare data
A hosted MCP server for financial data: quotes, filings, macro statistics and FTShare's own factors, read-only
Thirteen skills for quantitative trading on China's A-share market: AKShare and BaoStock data, Backtrader and RQAlpha backtests, QMT and JoinQuant docs
A server feeds agents quotes for A-shares, Hong Kong and US stocks, indicators, funds, futures and options, plus four skills.
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| QuantGPT: alpha factor research for China A-shares (this card) | no | not required | 510 | |
| Finance Quant Skills | no | 485 | skills for Backtrader and RQAlpha backtests, with no MCP server for scoring and validating factors | |
| Alpha Vantage MCP Server | yes | OAuth | 227 | quotes and indicators over an API, with no backtests or factor search |
README in short
The project presents itself as a factor research engine where the agent makes the decisions: it picks a direction, writes formulas, runs checks and decides when to stop. A second model, DeepSeek Reasoner, reviews every conclusion, and on disagreement the more conservative one is taken. The core is in Python, part of the computation sits in a Rust engine, and a React web panel is used to watch tasks.