Provides comprehensive stock analysis tools using Python-based AKShare API, enabling real-time stock data retrieval, historical data analysis, technical indicator calculations (MA, MACD, RSI), market sentiment analysis, stock search, and financial news aggregation for Chinese stock markets.
股票分析MCP工具
基于fastmcp和AKShare API构建的股票分析MCP服务器,支持CherryStudio的SSE标准协议。
功能特性
🚀 核心功能
- 实时行情: 获取股票实时价格、涨跌幅、成交量等数据
- 历史数据: 支持日线、周线、月线历史数据查询
- 技术指标: 计算MA、MACD、RSI等常用技术指标
- 市场情绪: 分析市场整体情绪和资金流向
- 股票搜索: 根据股票名称或代码搜索股票信息
- 新闻资讯: 获取股票相关新闻和市场资讯
🔧 技术特性
- 基于fastmcp框架,支持MCP协议
- 集成AKShare API,数据来源可靠
- 内置缓存机制,提高响应速度
- 支持CherryStudio的SSE标准协议
- 异步处理,高性能并发
安装配置
1. 安装依赖
2. 启动服务器
3. 配置CherryStudio
在CherryStudio中添加MCP服务器配置:
工具使用说明
1. 获取实时行情
symbol
: 股票代码,如 "000001"(平安银行)
2. 获取历史数据
symbol
: 股票代码period
: 数据周期 ("daily", "weekly", "monthly")start_date
: 开始日期 (YYYYMMDD格式)end_date
: 结束日期 (YYYYMMDD格式)
3. 计算技术指标
symbol
: 股票代码indicators
: 指标列表,支持 ["ma", "macd", "rsi", "boll", "kdj"]
4. 获取市场情绪
5. 搜索股票
keyword
: 搜索关键词(股票名称或代码)
6. 获取新闻资讯
数据说明
实时行情数据字段
- 股票代码、股票名称
- 最新价、涨跌幅、涨跌额
- 成交量、成交额、振幅
- 最高价、最低价、开盘价、昨收价
技术指标说明
- MA: 移动平均线 (5日、10日、20日、60日)
- MACD: 指数平滑移动平均线
- RSI: 相对强弱指标 (14日)
市场情绪指标
- 上涨/下跌股票数量和比例
- 主力资金净流入情况
- 北向资金流向数据
注意事项
- 数据来源: 数据来自AKShare API,请遵守相关使用条款
- 缓存机制: 内置5分钟缓存,避免频繁请求
- 错误处理: 包含完善的错误处理和日志记录
- 性能优化: 限制返回数据量,避免内存溢出
开发扩展
添加新的技术指标
在 calculate_technical_indicators
函数中添加新的指标计算逻辑:
自定义缓存策略
修改 StockAnalyzer
类中的缓存参数:
许可证
MIT License
贡献
欢迎提交Issue和Pull Request来改进这个项目!
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables real-time stock market analysis through AKShare API integration. Supports retrieving live stock prices, historical data, technical indicators (MA, MACD, RSI), market sentiment analysis, stock search, and financial news.
Related MCP Servers
- AsecurityAlicenseAqualityDeliver real-time investment research with extensive private and public market data.Last updated -1190960JavaScriptMIT License
- -securityFlicense-qualityProvides real-time access to global stock market data including current prices, historical charts, and company financial information through a Model Context Protocol (MCP) server for AI assistants.Last updated -TypeScript
- -securityFlicense-qualityEnables users to create, manage, and analyze investment portfolios with real-time market data, personalized recommendations, and visual representations of asset allocation.Last updated -3Python
Twelve Data MCP Serverofficial
AsecurityAlicenseAqualityProvides integration with Twelve Data API to access financial market data including historical time series, real-time quotes, and instrument metadata for stocks, forex pairs, and cryptocurrencies.Last updated -3521PythonMIT License