MCP server providing Chinese A-share stock analysis and AI prediction capabilities with K-line charts, technical indicators, and financial data analysis
AI看线是一个基于Python的A股分析工具,结合了传统技术分析和人工智能预测功能。利用K线图,技术指标,财务数据,新闻数据对股票进行全面分析及预测。该工具可以:
requirements.txt
克隆或下载本项目到本地
安装依赖包
pip install -r requirements.txt
.env
文件,添加Gemini API密钥GEMINI_API_KEY=your_api_key_here
注意:获取Gemini API密钥需要在Google AI Studio注册并创建API密钥
python main.py --stock_code 000001 --period 1年 --save_path ./output
参数说明:
--stock_code
:股票代码,必填参数--period
:分析周期,可选值:"1年"、"6个月"、"3个月"、"1个月",默认为"1年"--save_path
:结果保存路径,默认为"./output"启动Web服务:
python web_app.py
然后在浏览器中访问 http://localhost:5000 即可使用Web界面:
Web界面包括以下内容:
页面截图:
启动mcp:
uv run mcp_server.py
然后在mcp客户端中配置(streamable-http): http://localhost:8000/mcp
Cherry-Studio页面截图:
程序运行后将在指定的保存路径下生成:
AI看线/
├── main.py # 主程序入口
├── web_app.py # Web应用入口
├── requirements.txt # 依赖包列表
├── .env # 环境变量配置(需自行创建)
├── modules/ # 功能模块
│ ├── __init__.py
│ ├── data_fetcher.py # 数据获取模块
│ ├── technical_analyzer.py # 技术分析模块
│ ├── visualizer.py # 可视化模块
│ └── ai_analyzer.py # AI分析模块
├── templates/ # Web模板目录
│ └── index.html # 主页模板
├── static/ # 静态资源目录
│ ├── css/ # CSS样式
│ │ └── style.css # 自定义样式
│ └── js/ # JavaScript脚本
│ └── main.js # 主要脚本
└── output/ # 输出结果目录(运行时自动创建)
├── charts/ # 图表目录
└── *_analysis_result.txt # 分析结果文件
本工具提供的分析和预测仅供参考,不构成任何投资建议。投资有风险,入市需谨慎。用户应对自己的投资决策负责。