MCP.so
登录
Q

Qlib Mcp

@lsj210001

关于 Qlib Mcp

Microsoft Qlib MCP Server - 让 AI Agent 直接调用 Qlib 做量化研究。支持数据查询、因子分析、策略回测。

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "qlib-mcp": {
      "command": "python",
      "args": [
        "-m",
        "qlib.run.get_data",
        "qlib_data",
        "\\"
      ]
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is Qlib Mcp?

Qlib Mcp is an MCP server for the Microsoft Qlib quantitative research platform. It enables AI agents to perform data queries, factor analysis, and strategy backtesting by directly invoking Qlib functionalities.

How to use Qlib Mcp?

Install Python 3.10+, then install pyqlib and mcp. Download Qlib A‑share daily data (approx. 500 MB). Register the server with an MCP client (Claude Desktop, mcporter, Cursor) by adding a JSON configuration that points to the server.py script. After calling the qlib_init tool first, you can invoke tools for data, factors, and backtesting.

Key features of Qlib Mcp

  • Initialize the Qlib data environment (required first step)
  • Download A‑share or US stock dataset commands
  • Query index constituent stocks (CSI300, CSI500, etc.)
  • Retrieve historical price and factor data with Qlib expressions
  • Run TopK momentum strategy backtests with annualized return and Sharpe ratio
  • Perform IC analysis and quantile return for factor validation
  • Get expression syntax help for operators and Alpha158

Use cases of Qlib Mcp

  • Initializing the Qlib data environment for subsequent analysis
  • Listing CSI300 constituent stocks as of a specific date
  • Retrieving closing prices and volume for a specific stock over 60 days
  • Performing 20‑day momentum factor IC (information coefficient) analysis
  • Running a TopK momentum strategy backtest on CSI300 from 2020 to 2023

FAQ from Qlib Mcp

Which tool must be called first?

You must call qlib_init first to initialize the Qlib data environment before using any other tool.

What runtime dependencies are required?

Python 3.10+ (3.12 recommended), pyqlib, mcp, and Qlib 0.9+ with MCP 1.26+.

How do I get help on Qlib expression syntax?

Call qlib_expression_help with a topic parameter such as "operators" to retrieve the full operator list and Alpha158 documentation.

What markets and index pools are supported?

Two regions: A‑share (cn) with pools all, csi300, csi500, csi100, sz50; US (us) with sp500 and nasdaq100.

Where does the data live?

Data is downloaded to a local directory, by default ~/.qlib/qlib_data/cn_data for A‑share daily lines (about 500 MB).

常见问题

Which tool must be called first?

You must call qlib_init first to initialize the Qlib data environment before using any other tool.

What runtime dependencies are required?

Python 3.10+ (3.12 recommended), pyqlib, mcp, and Qlib 0.9+ with MCP 1.26+.

How do I get help on Qlib expression syntax?

Call qlib_expression_help with a topic parameter such as "operators" to retrieve the full operator list and Alpha158 documentation.

What markets and index pools are supported?

Two regions: A‑share (cn) with pools all, csi300, csi500, csi100, sz50; US (us) with sp500 and nasdaq100.

Where does the data live?

Data is downloaded to a local directory, by default ~/.qlib/qlib_data/cn_data for A‑share daily lines (about 500 MB).

评论

其他 分类下的更多 MCP 服务器