Microsoft Qlib MCP Server

Microsoft Qlib MCP Server

qlib-mcp•bylsj210001

An MCP server that lets AI agents call Microsoft Qlib for quantitative data queries, factor analysis, and strategy backtesting.

License: Not specified•Runtime: Awaiting documentation review•Category: finance crypto

WHAT IT DOES

  • •Initializes the Qlib data environment as a required first step.
  • •Lists index constituents such as CSI300 and CSI500.
  • •Runs TopK momentum strategy backtests returning annualized return, Sharpe ratio, and maximum drawdown.
  • •Performs IC analysis and quantile returns to validate factor effectiveness.

BEST FOR

  • •Querying historical price and factor data for A-share and US stocks through Qlib expressions.
  • •Validating quantitative factors with IC analysis and quantile returns.
  • •Backtesting TopK momentum strategies on CSI300 constituents.

ABOUT QLIB-MCP

Microsoft Qlib MCP Server is cataloged as an MCP server attributed to lsj210001. An MCP server that lets AI agents call Microsoft Qlib for quantitative data queries, factor analysis, and strategy backtesting. It is categorized under finance crypto. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Microsoft Qlib MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which markets and constituent pools does qlib-mcp support?

It supports A-share pools including all, csi300, csi500, csi100, and sz50, plus US pools sp500 and nasdaq100.

What expression syntax can be used for factors and data queries?

Qlib expressions are supported, including momentum, technical indicators, and volume factors, with an operator list available via the expression help tool.

上游原版 README

在 GitHub 查看同一版本原文

README.md · f8c0f09f08d4 · 采集于 2026-11-13 11:30:12 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

qlib-mcp

全网首个 Microsoft Qlib 量化研究平台的 MCP Server — 让 AI Agent 直接调用 Qlib 做数据查询、因子分析和策略回测。

License: MIT Python MCP Qlib


功能概览

工具说明
qlib_init初始化 Qlib 数据环境(必须首先调用)
qlib_download_data获取 A 股/美股数据集下载命令
qlib_list_instruments查询 CSI300/CSI500 等指数成分股列表
qlib_get_data查询历史价格与因子数据(支持 Qlib 表达式)
qlib_backtest_topkTopK 动量策略回测,返回年化收益/夏普/最大回撤
qlib_factor_analysisIC 分析 + 分位数收益,快速验证因子有效性
qlib_expression_help表达式语法帮助(算子列��� / Alpha158 说明)

安装

前置依赖

# Python 3.10+(推荐 3.12)
pip install pyqlib mcp

下载 Qlib 数据(A 股日线,约 500MB)

python -m qlib.run.get_data qlib_data \
  --target_dir ~/.qlib/qlib_data/cn_data \
  --region cn

注册到 MCP 客户端

Claude Desktop / mcporter / Cursor:

{
  "mcpServers": {
    "qlib": {
      "command": "python",
      "args": ["/path/to/qlib-mcp/server.py"],
      "description": "Microsoft Qlib 量化研究平台"
    }
  }
}

请将 python 替换为你实际的 Python 路径(如 /Users/你/.pyenv/versions/3.12.12/bin/python)


使用示例

1. 初始化

调用 qlib_init,data_path = "~/.qlib/qlib_data/cn_data",region = "cn"

2. 查询 CSI300 成分股

调用 qlib_list_instruments,market = "csi300",start_date = "2024-01-01"

3. 获取平安银行近 60 日收盘价

调用 qlib_get_data,symbols = "SZ000001",fields = "$close,$volume",start_date = "2024-10-01"

4. 20 日动量因子 IC 分析

调用 qlib_factor_analysis,factor_expr = "$close / Ref($close, 20) - 1"

5. TopK 策略回测(CSI300,2020-2023)

调用 qlib_backtest_topk,market = "csi300",topk = 50,signal_field = "$close / Ref($close, 20) - 1"

Qlib 表达式语法速查

# 价格动量
$close / Ref($close, 20) - 1      # 20 日动量

# 技术指标
EMA($close, 12) - EMA($close, 26) # MACD
($close - Mean($close, 20)) / Std($close, 20)  # 布林带位置

# 成交量因子
$volume / Mean($volume, 20)        # 相对成交量
Corr($close, $volume, 10)          # 价量相关性(聪明钱)

完整算子列表:调用 qlib_expression_help(topic="operators")


受支持的市场

区域常用成分股池
A 股(cn)all, csi300, csi500, csi100, sz50
美股(us)sp500, nasdaq100

许可证

MIT License


相关链接

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Microsoft Qlib MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/qlib-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related finance crypto MCP Servers

Alternative and complementary servers in the same category

View all in finance crypto →
USA Spending MCP Server
usaspending-mcp-server•thsmale

A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

Repository stats unavailable
Finance & Analytics
Fortnox MCP server — More AI
more-ai-chatgpt-claude-mcp-fortnox•amor3

A hosted, remote MCP server for Fortnox that lets AI assistants answer questions from a company's bookkeeping and propose changes for approval before writing them.

0
Finance & Analytics

OptimistFi is a read-only remote MCP server that provides perpetual futures market data, perps prop firm rules and pricing, and US equity investment research.

Repository stats unavailable
Finance & Analytics