npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gabriel3615/claude-stock-analysis-mcp

v1.5.6

Published

Claude MCP服务器,提供股票分析功能

Downloads

71

Readme

Stock Analysis MCP Server

This is a Model Context Protocol (MCP) server that provides stock analysis tools for Claude Desktop. The server integrates existing stock analysis features, including chip distribution analysis, pattern analysis, trend reversal detection, and market scanning capabilities.

  • Stock data query: Yahoo Finance
  • Company fundamental data query: Requires FMP API_KEY (https://site.financialmodelingprep.com/)

Features

  • Fully compatible with Claude Desktop's MCP interface
  • Provides various stock analysis tools:
    • get-stock-analysis: Analyze specific stocks
    • company-fundamental: Query company fundamental data
    • start-bull-bear-scan: Scan the market for bullish and bearish signals (asynchronous task)
    • start-strong-signal-scan: Scan the market for strong momentum stocks (asynchronous task)
    • start-hot-stock-scan: Scan the market for top trending stocks (asynchronous task)
    • get-task-status: Query the status and results of asynchronous tasks
    • market-performance: Today's market performance, query stocks with biggest gains/losses and highest volume
  • Support for long-running asynchronous analysis tasks
  • Integration of comprehensive stock analysis functions
  • Generation of detailed trading plan reports

Installation and Configuration

Prerequisites

  • Node.js >= 16.0.0
  • npm >= 7.0.0
  • Claude Desktop

Local Installation and Running

  1. Clone the repository:

    git clone https://github.com/yourusername/claude-stock-mcp.git
    cd claude-stock-mcp
  2. Install dependencies:

    npm install
  3. Test the server in development mode:

    npm run dev

    Or use MCP Inspector:

    npm run inspect
  4. Build the project:

    npm run build
  5. Start the server:

    npm start

Configure Claude Desktop

  1. Create or edit the Claude Desktop configuration file:

    # macOS
    open -a "TextEdit" ~/Library/Application\ Support/Claude/claude_desktop_config.json
  2. Add the server configuration:

    {
      "mcpServers": {
        "stock-analysis": {
        "command": "npx",
        "args": [
          "@gabriel3615/claude-stock-analysis-mcp@latest"
         ],
         "env": {
          "FMP_API_KEY": "KEY_HERE",
          "APLPVANTAGE_API_KEY": "KEY_HERE"
         }
        }
      }
    }

    Note: You must use absolute paths and replace "yourusername" with your actual username.

  3. Save the configuration file and restart Claude Desktop.

Usage

Once the server is configured, you can access the stock analysis features in Claude Desktop using the following approaches:

Analyze Stocks

Example questions:

  • "Please analyze Apple's stock performance"
  • "I want to understand the trading signals for Tesla stock (TSLA)"
  • "Help me analyze entry points and stop-loss levels for NVDA"

Claude will use the get-stock-analysis tool to analyze specific stocks.

Using Asynchronous Market Scanning Features

Example questions:

  • "Please scan the market for bullish signal stocks currently at support levels"
  • "Help me find the strongest momentum stocks in the market"
  • "Scan and list recent hot stocks"

Claude will use the appropriate asynchronous task tools, such as start-bull-bear-scan, and return a task ID. You can use this ID to query task status and results.

How to use asynchronous tasks:

  1. Start an asynchronous scan task and get a task ID
  2. Use get-task-status to check the task status
  3. When the task is complete, retrieve the analysis results

This asynchronous approach can handle complex market analyses that run for an extended period, avoiding request timeout issues.

Development Testing

fastmcp provides two convenient ways to test:

  1. Using command line mode:

    npm run dev
  2. Using web interface:

    npm run inspect

These commands will start the respective test environments, allowing you to interact directly with the MCP server without requiring Claude Desktop.

Project Structure

claude-stock-mcp/
├── src/
│   ├── index.ts                # MCP server main file
│   ├── analysis/               # Stock analysis related code
│   │   ├── IntegratedAnalysis.ts
│   │   ├── IntegratedAnalysisTypes.ts
│   │   ├── chip/               # Chip distribution analysis
│   │   ├── patterns/           # Pattern analysis
│   │   └── trendReversal/      # Trend reversal analysis
│   ├── finance/                # Financial data related
│   │   ├── Conditions.ts
│   │   ├── Evaluator.ts
│   │   ├── FMPQuery.ts         # Financial Modeling Prep API query
│   │   ├── MarketQuery.ts      # Market data query
│   │   └── __tests__/          # Test files
│   ├── strategy/               # Strategy analysis
│   │   ├── BreakoutDetector.ts
│   │   ├── BullOrBearDetector.ts
│   │   └── StrategyAnalysisAgent.ts
│   ├── types.ts                # Type definitions
│   ├── config.ts               # Configuration file
│   └── util/                   # Utility functions
│       ├── TaskManager.ts      # Asynchronous task management
│       ├── Logger.ts           # Log handling
│       └── util.ts             # Common utility functions
├── dist/                       # Compiled output
├── logs/                       # Log file directory
├── package.json
└── tsconfig.json

Logging System

To avoid console output interfering with Claude Desktop, the project uses a custom logging system:

  • All console outputs are redirected to log files
  • Log files are located in the logs/ directory
  • Silent mode is enabled in the Claude Desktop environment, preventing all console output

License

MIT