Skip to main content

Quant Data MCP Server

MCP Server for Quant Data API.

让 Claude Desktop / Cursor 等 MCP 客户端能直接调 A 股数据。


✨ 功能

  • 📈 个股实时行情
  • 📊 个股 K 线
  • 📉 市场统计
  • 🏭 行业涨跌幅
  • 🔍 多条件选股
  • 💰 最新财务指标

📦 安装

pip install quant-data-mcp

或从源码:

git clone https://github.com/Zizhenghua/quant-data-mcp.git
cd quant-data-mcp
pip install -e .

🚀 配置

Claude Desktop

编辑配置文件:

  • Windows%APPDATA%\Claude\claude_desktop_config.json
  • Mac~/Library/Application Support/Claude/claude_desktop_config.json

内容:

{
  "mcpServers": {
    "quant-data": {
      "command": "python",
      "args": ["-m", "quant_data_mcp.server"],
      "env": {
        "QUANT_API_KEY": ""
      }
    }
  }
}

Cursor

在 Cursor 设置里加 MCP Server,或编辑 ~/.cursor/mcp.json

{
  "mcpServers": {
    "quant-data": {
      "command": "python",
      "args": ["-m", "quant_data_mcp.server"],
      "env": {
        "QUANT_API_KEY": ""
      }
    }
  }
}

🔑 用 API Key

默认匿名调用(10 次/分钟)。

想提高限额,在配置里填 QUANT_API_KEY

{
  "env": {
    "QUANT_API_KEY": "your_api_key_here"
  }
}

注册获取 API Key:https://zizhenghua.com


💬 示例

配好后,在 Claude Desktop / Cursor 里问:

  • "茅台现在多少钱?"
  • "帮我看看 600519 最近的 K 线"
  • "今天市场涨跌家数怎么样?"
  • "哪些行业今天涨得最好?"
  • "帮我筛选换手率大于 5% 的股票"
  • "600519 最新的财务指标是什么?"

AI 会自动调对应的工具。


🛠️ 可用工具

工具 说明
get_stock_realtime 个股实时行情
get_stock_kline 个股 K 线
get_market_stats 市场统计
get_sector_performance 行业涨跌幅
filter_stocks 多条件选股
get_fin_latest 最新财务指标

🧪 开发

# 1. Clone
git clone https://github.com/Zizhenghua/quant-data-mcp.git
cd quant-data-mcp

# 2. 虚拟环境
python -m venv .venv
.venv\Scripts\activate  # Windows
# source .venv/bin/activate  # Mac / Linux

# 3. 安装
pip install -e ".[dev]"

# 4. 测试
python -m quant_data_mcp.server

📚 相关项目


📄 License

MIT


⚠️ Disclaimer

数据仅供量化学习与策略回测研究之用,不构成任何投资建议。

Release files for zizhenghua-mcp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zizhenghua-mcp 1.0.0
File Size Uploaded
zizhenghua_mcp-1.0.0.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zizhenghua-mcp 1.0.0
File Interpreter ABI Platform
zizhenghua_mcp-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / zizhenghua_mcp-1.0.0.tar.gz

Download URL zizhenghua_mcp-1.0.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
49d6d208eccb4d212aebaef444b1e7d70c9522b147a3a3bfdeeaec90dcb77dc1
BLAKE2b-256 checksum
How to use checksums
8765e13c78ac6824b920c87f9a895610809e407e736abcba98cbebb1de568993
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / zizhenghua_mcp-1.0.0-py3-none-any.whl

Download URL zizhenghua_mcp-1.0.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32485878572a70c2d0bc6e7e0c134236fd2c1ce4aa02fb292fce752b5e241d87
BLAKE2b-256 checksum
How to use checksums
c4b49cdee7dfe31a6fc20598a4136d7d56e91324b50e5309eec6ecb8f99c1510
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page