Labsco
flying3615 logo

Stock Analysis

from flying3615

An MCP server for stock analysis, offering tools for chip distribution, pattern analysis, trend reversal detection, and market scanning.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

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.

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

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