MCP ExplorerExplorer

Mcp Stock Analysis Server

@6loong188186on 10 months ago
2 MIT
FreeCommunity
AI Systems
# MCP for Intelligent Stock Diagnosis Combining Latest News Under Multiple Indicators

Overview

What is Mcp Stock Analysis Server

The mcp-stock-analysis-server is a powerful Node.js toolkit designed for stock analysis. It integrates multiple indicators and the latest news to intelligently diagnose stock trends.

Use cases

Use cases include analyzing stock trends for investment decisions, sentiment analysis of news articles related to stocks, and integrating with other APIs for enhanced financial data analysis.

How to use

To use the mcp-stock-analysis-server, run the command ‘npx mcp-stock-analysis-server’ in your terminal. Ensure you have set the environment variable ‘NEWS_API_KEY’ with your News API key.

Key features

Key features include fetching stock price data for US and Chinese stocks, calculating various technical indicators (BOLL, EMA, SAR, MACD, OBV, RSI, volume analysis), analyzing news sentiment related to stocks, and predicting stock trends based on combined technical and news analysis.

Where to use

The mcp-stock-analysis-server can be used in financial analysis, investment research, stock trading platforms, and by individual investors looking to make informed decisions based on data-driven insights.

Content

股票分析工具包

这是一个功能强大的股票分析Node.js工具包,可以获取股票数据、计算技术指标、分析新闻情感并预测股票趋势。

功能特点

  • 获取股票价格数据(支持美股和中国股票)
  • 计算多种技术指标:
    • 布林带(BOLL)
    • 指数移动平均线(EMA)
    • 抛物线转向指标(SAR)
    • MACD(9,21,7)
    • 能量潮指标(OBV)
    • RSI指标
    • 成交量分析
  • 分析股票相关新闻的情感倾向
  • 综合技术指标和新闻分析预测股票趋势
  • 模块化设计,易于扩展和集成其他API

快速开始

npx mcp-stock-analysis-serve

基本使用

{
  "mcpServers": {
    "mcp-stock-analysis-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-stock-analysis-server"
      ],
      "env": {
        "NEWS_API_KEY": "api_key"
      }
    }
  }
}

环境变量配置

NEWS_API_KEY=your_newsapi_key

News API

  1. 访问 News API官网
  2. 注册并获取API密钥

API文档

StockAnalysis 类

参数:

  • config (Object): 配置选项
    • apiKey (String): 股票数据API密钥
    • newsApiKey (String): 新闻API密钥
    • dataProvider (String): 数据提供商名称,目前默认使用雅虎财经

方法

analyzeTrend(symbol, options)

分析股票并预测趋势。

参数:

  • symbol (String): 股票代码或名称
  • options (Object): 分析选项
    • period (Number): 分析周期(天数),默认30
    • includeNews (Boolean): 是否包含新闻分析,默认true

返回值:

  • Promise: 包含以下属性的对象
    • symbol (String): 股票代码
    • name (String): 股票名称
    • lastPrice (Number): 最新价格
    • indicators (Object): 技术指标数据
      • boll (Object): 布林带指标
      • ema (Object): EMA指标
      • sar (Object): SAR指标
      • macd (Object): MACD指标
      • obv (Object): OBV指标
      • RSI (Object): RSI指标
      • volume (Object): 成交量指标
    • newsAnalysis (Object): 新闻分析结果
      • sentiment (String): 整体情感倾向
      • score (Number): 情感分数
      • articles (Array): 分析后的文章数据
      • keywords (Array): 热点关键词
    • prediction (Object): 趋势预测结果
      • direction (String): 趋势方向(上涨/下跌/震荡)
      • strength (String): 趋势强度
      • score (Number): 综合评分
      • conclusion (String): 预测结论

    注意事项

    • News API在免费计划中也有使用限制

    许可证

    Apache License 2.0

    感谢打赏

    alt text

    使用效果

    alt text