AI-Kline MCP Server

AI-Kline MCP Server

MCP server for A-share stock technical analysis and AI prediction, enabling LLM-based interaction to analyze stocks.

Category
Visit Server

README

AI看线 - 股票技术分析与AI预测工具(AI-Kline - Stock Technical Analysis and AI Prediction Tool)

<div align="center"> <!-- Keep these links. Translations will automatically update with the README. --> <a href="README_EN.md">English</a> | <a href="README.md">中文</a>

</div>

项目简介

AI看线是一个基于Python的A股分析工具,结合了传统技术分析和人工智能预测功能。利用K线图,技术指标,财务数据,新闻数据对股票进行全面分析及预测。该工具可以:

  1. 获取A股股票的历史量价数据并计算各种技术指标
  2. 生成专业的K线图和技术指标可视化图表
  3. 获取股票相关的财务数据和新闻信息
  4. 使用openai api分析整合数据并预测股票未来走势

功能特点

  • 数据获取:使用AKShare获取A股股票的历史交易数据、财务数据和新闻信息
  • 技术分析:计算多种技术指标,包括MA、MACD、KDJ、RSI、布林带等
  • 可视化:生成静态和交互式K线图及技术指标图表
  • AI分析:利用多模态AI分析股票数据并预测未来走势
  • Web界面:提供简洁美观的Web界面,方便用户输入股票代码查看分析结果
  • MCP SERVER:提供MCP SERVER支持,支持通过LLM交互,随时分析股票

安装说明

环境要求

  • Python 3.8+
  • 依赖包:见requirements.txt

安装步骤

  1. 克隆或下载本项目到本地

  2. 安装依赖包

pip install -r requirements.txt
  1. 创建.env文件,添加API密钥
API_KEY=your_api_key_here
BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
MODEL_NAME=qwen-vl-max

注意:需使用多模态模型

使用方法

命令行使用

python main.py --stock_code 000001 --period 1年 --save_path ./output

参数说明:

  • --stock_code:股票代码,必填参数
  • --period:分析周期,可选值:"1年"、"6个月"、"3个月"、"1个月",默认为"1年"
  • --save_path:结果保存路径,默认为"./output"

Web界面使用

启动Web服务:

python web_app.py

然后在浏览器中访问 http://localhost:5000 即可使用Web界面:

  1. 在表单中输入股票代码(例如:000001)
  2. 选择分析周期
  3. 点击"开始分析"按钮
  4. 等待分析完成后查看结果

Web界面包括以下内容:

  • 股票基本信息
  • K线图和技术指标图表
  • AI分析结果文本

页面截图:

Web界面截图

MCP SERVER使用

启动mcp:

uv run  mcp_server.py

然后在mcp客户端中配置(streamable-http): http://localhost:8000/mcp

Cherry-Studio页面截图:

MCP界面截图 MCP界面截图

输出结果

程序运行后将在指定的保存路径下生成:

  1. K线图和技术指标图表(静态PNG图片和交互式HTML图表)
  2. AI分析结果文本文件

项目结构

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 # 分析结果文件

交流学习

加群

注意事项

  • 本工具仅供学习和研究使用,不构成任何投资建议
  • AI分析结果基于历史数据和当前信息,不能保证未来走势的准确性
  • 使用前请确保已正确配置Gemini API密钥
  • 股票数据获取依赖于AKShare库,可能受到网络和数据源的限制
  • 本项目为QuantML开源项目,转载或使用需注明出处,商业使用请联系微信号QuantML

免责声明

本工具提供的分析和预测仅供参考,不构成任何投资建议。投资有风险,入市需谨慎。用户应对自己的投资决策负责。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured