FactorHub MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FactorHub MCP Server list available factors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FactorHub MCP Server
中文
A 股量化数据 MCP 服务器 —— 让 Claude、Cursor 等 AI 工具直接查询因子数据、行情、估值、回测。
功能列表
工具 | 说明 |
| 设置你的 API Key(可选,不设置使用免费体验额度) |
| 因子列表(分类、搜索) |
| 因子评分指标(年化收益、夏普、IC等) |
| 因子净值曲线 |
| 个股日线行情(OHLCV) |
| 指数日线(上证、沪深300等) |
| 估值指标(PE、PB、PS、股息率) |
| 个股基本信息 |
| 股票筛选 |
| 交易日历 |
| 量化策略回测 |
快速开始
方式一:免费体验(无需注册)
使用托管服务器,无需 API Key,自带免费额度(10 次/天)。
Claude Desktop —— 编辑 claude_desktop_config.json:
{
"mcpServers": {
"factorhub": {
"command": "npx",
"args": ["-y", "@smithery/cli@latest", "run", "factorhub"]
}
}
}或直接远程连接:
https://factorhub.cn/mcp/sse方式二:安装到本地(使用自己的 API Key)
注册 factorhub.cn,在 API Key 管理页 生成 Key,获得更高额度。
pip install factorhub-mcpClaude Desktop —— 编辑 claude_desktop_config.json:
{
"mcpServers": {
"factorhub": {
"command": "factorhub-mcp",
"env": {
"FACTORHUB_API_KEY": "fh_你的密钥"
}
}
}
}Cursor —— 编辑 .cursor/mcp.json,格式同上。
Claude Code —— 运行:
claude mcp add factorhub -- env FACTORHUB_API_KEY=fh_你的密钥 factorhub-mcpOpenClaw —— 添加到技能配置:
providers:
factorhub:
type: mcp
command: factorhub-mcp
env:
FACTORHUB_API_KEY: "fh_你的密钥"方式三:通过 Smithery 安装
在 Smithery 一键安装,自动配置到你的 AI 客户端。
使用示例
配置完成后,直接对你的 AI 助手说:
"查看 FactorHub 有哪些因子"
"获取动量因子的历史表现"
"帮我查一下贵州茅台最近一年的行情"
"用低估值策略回测沪深300成分股"
"对比动量因子和价值因子的夏普比率"
也可以在对话中设置自己的 Key 来获得更多额度:
"用我的 API Key fh_xxx 登录 FactorHub"
定价
方案 | API 调用/天 | 回测/天 | 价格 |
Free | 20 | 3 | ¥0 |
Pro | 10,000 | 20 | ¥99/月 |
Pro Max | 40,000 | 100 | ¥199/月 |
Ultra | 不限 | 不限 | ¥899/月 |
升级方案:factorhub.cn/pricing
架构
本 MCP 服务器是一个轻量客户端,通过 HTTPS 调用 FactorHub 公开 API,不直接访问数据库,不包含任何私有逻辑。
AI 助手 → MCP 协议 → factorhub-mcp → HTTPS → factorhub.cn/api/v1安全
API Key 存储在环境变量中,不会硬编码
所有通信使用 HTTPS 加密
本地不存储任何用户数据
服务端强制频率限制
Related MCP server: AI-Kline MCP Server
English
China A-share market data for AI agents. Query factor scores, market quotes, valuations, and run strategy backtests — all through the Model Context Protocol (MCP).
Features
Tool | Description |
| Set your API key (optional, defaults to free trial quota) |
| List factors with category/search filters |
| Factor metrics: annual return, Sharpe, max drawdown, IC, etc. |
| Factor NAV curve for trend analysis |
| Stock daily OHLCV data |
| Index daily data (SSE, CSI 300, CSI 500, etc.) |
| Valuation metrics: PE, PB, PS, dividend yield |
| Stock basic info |
| Stock screening by exchange/industry |
| Trading calendar |
| Strategy backtesting |
Quick Start
Option 1: Try Free (No Registration)
Use the hosted server directly — no API key needed, includes free trial quota (10 calls/day).
Claude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"factorhub": {
"command": "npx",
"args": ["-y", "@smithery/cli@latest", "run", "factorhub"]
}
}
}Or connect directly via SSE:
https://factorhub.cn/mcp/sseOption 2: Install with Your API Key
For higher quotas, register at factorhub.cn and get your API key at the API Keys page.
pip install factorhub-mcpClaude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"factorhub": {
"command": "factorhub-mcp",
"env": {
"FACTORHUB_API_KEY": "fh_your_api_key_here"
}
}
}
}Cursor — add to .cursor/mcp.json (same format as above).
Claude Code — run:
claude mcp add factorhub -- env FACTORHUB_API_KEY=fh_your_api_key_here factorhub-mcpOpenClaw — add to your skill config:
providers:
factorhub:
type: mcp
command: factorhub-mcp
env:
FACTORHUB_API_KEY: "fh_your_api_key_here"Option 3: Smithery
Install via Smithery for automatic setup with any MCP client.
Usage Examples
Once configured, ask your AI assistant:
"List all available factors on FactorHub"
"Show momentum factor performance"
"Get Kweichow Moutai stock data for the past year"
"Backtest a low-valuation strategy on CSI 300"
"Compare Sharpe ratios of momentum vs value factors"
Set your own API key mid-conversation for higher quotas:
"Set my FactorHub API key to fh_xxx"
Pricing
Plan | API Calls/Day | Backtest/Day | Price |
Free | 20 | 3 | ¥0 |
Pro | 10,000 | 20 | ¥99/mo |
Pro Max | 40,000 | 100 | ¥199/mo |
Ultra | Unlimited | Unlimited | ¥899/mo |
Upgrade at factorhub.cn/pricing.
Architecture
This MCP server is a thin client that calls the FactorHub public API. It does not access any database directly or contain proprietary logic.
AI Agent → MCP Protocol → factorhub-mcp → HTTPS → factorhub.cn/api/v1Security
API key is stored in environment variables, never hardcoded
All communication uses HTTPS
No user data is stored locally
Rate limiting is enforced server-side
License
MIT
Available Tools
11 toolsget_factor_scoresB
获取单个因子的详细评分指标:年化收益、夏普比率、最大回撤、波动率、Alpha、Beta、IC均值等。
Inputs: code (required), start_date, end_date. Returns: result
get_index_dailyC
获取指数日线行情。常用:000001.SH(上证)、399001.SZ(深证)、000300.SH(沪深300)、000905.SH(中证500)。
Inputs: ts_code, start_date, end_date. Returns: result
get_market_dailyB
获取个股日线行情数据(OHLCV + 涨跌幅)。ts_code 如 000001.SZ、600519.SH。
Inputs: ts_code (required), start_date, end_date. Returns: result
get_stock_infoB
获取单只股票基本信息:名称、行业、上市日期、市场板块等。
Inputs: ts_code (required). Returns: result
get_stock_listC
按条件筛选股票列表。可按交易所(SSE/SZSE)、行业筛选。
Inputs: exchange, industry, page, page_size. Returns: result
get_trade_datesB
获取交易日历,查询指定时间段内的交易日列表。
Inputs: start_date, end_date. Returns: result
get_valuationC
获取股票估值指标:PE、PB、PS、股息率、总市值、流通市值、换手率等。
Inputs: ts_code, trade_date. Returns: result
list_factorsA
获取因子列表。支持按分类和关键词搜索。返回因子代码、名称、分类、年化收益、夏普比率等。
Inputs: category, search, page, page_size. Returns: result
run_backtestB
执行量化策略回测。内置策略:limit_up_first_board(涨停首板)、low_valuation(低估值)、momentum(动量)、mean_reversion(均值回归)。返回年化收益、夏普比率、最大回撤等。
Inputs: strategy_type, strategy_params, universe, start, +2 more. Returns: result
set_api_keyA
设置你的 FactorHub API Key。注册获取:https://factorhub.cn/api-keys。设置后本次会话将使用你的专属额度。
Inputs: api_key (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 11 tools
Each tool targets a distinct aspect of financial data analysis: factor performance vs scores, index vs stock data, stock info vs list, valuation, backtesting, and configuration. No two tools serve the same purpose.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., get_factor_nav, list_factors, run_backtest). The conventions are uniform across all 11 tools.
With 11 tools, the server covers core operations for factor analysis, stock data, index data, backtesting, and configuration. The count is well-scoped without being overwhelming or insufficient.
The tool set covers essential CRUD-like operations for factor data, stocks, indices, and backtesting. Minor gaps exist, such as lack of bulk data retrieval or more customizable backtest parameters, but the core workflows are well-supported.
Maintenance
Related MCP Connectors
China A-share market data for research, backtesting and AI agents via MCP.
MCP server for real-time China A-share stock quotes, indices and market data.
China A-share data for AI agents: 57 read-only tools plus 6 tools for your own watchlist.
China A-share market data over MCP: 22 tools for quotes, K-line, financials, money flow, top-trader boards, sectors, macro, convertible bonds and factor screening. Five tools need no API key, so you can connect and try it immediately.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for the Microsoft Qlib quantitative research platform that enables AI agents to perform financial data queries, factor analysis, and strategy backtesting. It supports A-share and US stock markets through Qlib expressions and built-in analytical tools.3MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for A-share stock technical analysis and AI prediction, enabling LLM-based interaction to analyze stocks.345-
- AlicenseAqualityDmaintenanceAn MCP server that gives AI assistants direct, structured access to China A-share market data.3Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP server providing 29 A-share analysis skills including real-time data, capital flow, limit-up tracking, technical/fundamental analysis, backtesting, risk control, and Xueqiu portfolio tracking, enabling AI agents to execute market research and strategy tasks.Apache 2.0