Get the FREE Ultimate OpenClaw Setup Guide →

mcp-stock-analysis

多指标下结合最新新闻智能诊断股票的mcp

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio 6loong188186-mcp-stock-analysis-server npx -y mcp-stock-analysis-server \
  --env NEWS_API_KEY="api_key"

How to use

The mcp-stock-analysis server is a Node.js-based stock analysis toolkit that fetches market data, computes a suite of technical indicators, analyzes news sentiment, and forecasts stock trends. When you run the server via the MCP launcher, it exposes a StockAnalysis interface that accepts a symbol and optional parameters to return a holistic view of a stock’s current data, technical indicators (BOLL, EMA, SAR, MACD, OBV, RSI, volume), sentiment-driven news analysis, and a trend prediction with direction and confidence. The toolkit integrates data from Yahoo Finance by default and uses News API for sentiment analysis. To use the server, provide your News API key (via the NEWS_API_KEY environment variable) and call analyzeTrend with a stock symbol and options to tailor the analysis (e.g., period and whether to include news).

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to npm and internet to fetch the MCP package
  • News API key for sentiment analysis

Step-by-step:

  1. Install Node.js (if not already installed)

    • macOS: brew install node
    • Windows: download from nodejs.org and run the installer
    • Linux: use your distribution’s package manager (e.g., sudo apt-get install nodejs npm)
  2. Ensure you have an API key for News API. Sign up at https://newsapi.org/register and obtain the API key.

  3. Run the MCP server using npx as described in the README (no local install required): npx -y mcp-stock-analysis-server

  4. Alternatively, if you prefer installing the package locally, run: npm i -g mcp-stock-analysis-server mcp-stock-analysis-server

  5. Provide the required environment variable (NEWS_API_KEY) when starting the server: NEWS_API_KEY=your_newsapi_key npx -y mcp-stock-analysis-server

  6. Confirm the server is running by checking logs and accessing the available methods (e.g., analyzeTrend) via your MCP client.

Additional notes

Tips:

  • Ensure your News API key has access rights for sentiment analysis; note that free plans have usage limits.
  • The tool supports both US and China stock data; verify symbol formats accepted by the data provider you’re using.
  • If you encounter rate limits, consider increasing the period or reducing the number of concurrent requests.
  • The environment variable NEWS_API_KEY is required for news sentiment analysis; without it, news-related results may be omitted or degraded.
  • The API exposes a comprehensive indicators object, so you can build custom dashboards or alerts based on Bollinger Bands, EMA, MACD, RSI, OBV, and volume patterns.
Sponsor this space

Reach thousands of developers