Skip to main content

MCP协议的A股量化分析工具,为AI Agent提供股票推荐、行情分析、K线图绘制等功能

Project description

MCP-A股量化分析服务

基于MCP协议的A股量化分析工具,为AI Agent提供股票推荐、行情分析、K线图绘制等功能

功能特性

  • 📈 A股精选股票推荐
  • 📊 K线图绘制(支持MA5/MA10等技术指标)
  • 🔍 股票历史数据查询
  • 📉 技术指标计算(MACD, BOLL等)
  • 🧮 量化分析模型

快速开始

环境要求

  • Python 3.12+
  • 安装依赖库:
uv add "mcp[cli]" matplotlib 
uv add "mcp[cli]" pandas
uv add "mcp[cli]" tushare

运行服务

mcp dev server.py

MCP配置

"ashare_quant": {
    "command": "uv",
    "args": [
        "--directory",
        "path/mcp-servers/python/mcp-ashare-quant",
        "run", 
        "server.py"
    ],
    "disabled": false,
    "autoApprove": []
}

API说明

股票推荐

  • recommend_a_shares(): 推荐符合条件的A股股票
    • 参数: limit(数量), min_price(最低价), max_price(最高价)等
    • 返回: 股票列表及推荐理由

K线图绘制

  • plot_kline(): 绘制股票K线图
    • 参数: data(股票数据), indicators(技术指标)
    • 返回: 图表文件路径

数据获取

  • get_stock_data(): 获取股票历史数据
    • 参数: code(股票代码), count(数据条数)
    • 返回: OHLCV数据

技术指标

  • calculate_technical_indicators(): 计算技术指标
    • 参数: data(股票数据), indicators(指标列表)
    • 返回: 包含指标值的数据

使用示例

获取股票推荐

recommendations = recommend_a_shares(limit=15)

绘制K线图

data = get_stock_data(code="sh600519", count=20)
plot_kline(data, indicators=["MA5","MA10"])

注意事项

  • 使用前需配置Tushare API token
  • 图表功能需要matplotlib支持
  • 数据获取有频率限制,请合理使用

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_ashare_quant-0.1.5.tar.gz (12.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_ashare_quant-0.1.5-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_ashare_quant-0.1.5.tar.gz.

File metadata

  • Download URL: mcp_ashare_quant-0.1.5.tar.gz
  • Upload date:
  • Size: 12.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for mcp_ashare_quant-0.1.5.tar.gz
Algorithm Hash digest
SHA256 92a7fd27ce880509d7507f7b3c067034ee4001858fa83c03b454af654961d6cd
MD5 740e69cb02ed9051174ab70ec16c350a
BLAKE2b-256 e6dfe7e472e6374c1f18859e29df92ee38158c6b9c4c4dd804269f752d910ecf

See more details on using hashes here.

File details

Details for the file mcp_ashare_quant-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_ashare_quant-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b87a315a04b07a9e60ed4eb37c0b301ce5471064862de54073e3a7c089df927c
MD5 0eace6da630720ed8a269eab76382561
BLAKE2b-256 6cade1ef71919a703b72d17c96742447a5c7a778b5dd8b6bafa8950ace3dde16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page