Skip to main content
Glama
stock-mcp-server

stock-mcp-server

by makiichikawa

Stock MCP Server

A Model Context Protocol (MCP) server that provides real-time stock price information and profitability analysis using Yahoo Finance API.

Features

  • Get real-time stock prices for individual symbols

  • Fetch multiple stock prices at once

  • Comprehensive financial data and fundamental analysis

  • Profitability turnaround analysis - Identify stocks that have turned from loss to profit

  • Profit turnaround screening - Screen multiple stocks for recent profitability improvements

  • Returns comprehensive stock data including price, change, volume, and market cap

  • Built with TypeScript and Zod for type safety

Related MCP server: Financial Data MCP Server

Installation

npm install
npm run build

Usage

Development

npm run dev

Production

npm start

Tools Available

get_stock_price

Get real-time stock price information for a single stock symbol.

Parameters:

  • symbol (string): Stock symbol (e.g., "AAPL", "GOOGL", "TSLA")

get_multiple_stock_prices

Get real-time stock price information for multiple stock symbols.

Parameters:

  • symbols (array): Array of stock symbols (e.g., ["AAPL", "GOOGL", "TSLA"])

get_financial_data

Get comprehensive financial data and fundamental analysis metrics for a stock.

Parameters:

  • symbol (string): Stock symbol (e.g., "AAPL", "GOOGL", "TSLA")

analyze_profitability_turnaround

Analyze whether a stock has turned from loss to profit in recent quarters.

Parameters:

  • symbol (string): Stock symbol (e.g., "TSLA", "UBER")

Returns:

  • turnAroundStatus: "profit_turnaround", "loss_turnaround", "continued_profit", or "continued_loss"

  • currentQuarterNetIncome: Latest quarter's net income

  • previousQuarterNetIncome: Previous quarter's net income

  • quarterlyChange: Percentage change in net income

  • Company and market data

screen_profit_turnaround_stocks

Screen multiple stocks to find those that have recently turned profitable.

Parameters:

  • symbols (array): Array of stock symbols to analyze

  • minMarketCap (number, optional): Minimum market capitalization filter

  • maxMarketCap (number, optional): Maximum market capitalization filter

Returns: Array of stocks with turnAroundStatus: "profit_turnaround", sorted by quarterly improvement percentage.

Testing

# Test profitability analysis functionality
node test_profitability.js

Configuration for Claude Desktop

Add the following to your Claude Desktop configuration file:

{
  "mcpServers": {
    "stock-server": {
      "command": "node",
      "args": ["/path/to/stock-mcp-server/dist/index.js"]
    }
  }
}

Project Structure

stock-mcp-server/
├── src/
│   ├── services/
│   │   └── stockService.ts    # Stock price service
│   ├── types/
│   │   └── schema.ts          # Zod schemas and types
│   └── index.ts               # MCP server entry point
├── dist/                      # Compiled JavaScript output
├── package.json
├── tsconfig.json
└── README.md

Dependencies

  • @modelcontextprotocol/sdk: MCP SDK for server implementation

  • yahoo-finance2: Yahoo Finance API client

  • zod: Runtime type validation and schema definition

Available Tools

12 tools
analyze_profitability_turnaroundC

Analyze whether a stock has turned from loss to profit in recent quarters

Inputs: symbol (required).

extract_local_pdfB

Extract text from a local PDF file

Inputs: symbol (required), country (required), filePath (required), documentType (required).

get_10k_earnings_guidanceA

Get detailed management guidance information specifically from 10-K filings (annual reports)

Inputs: symbol (required).

get_annual_earnings_forecastA

Get annual earnings forecast and analyst estimates for a stock

Inputs: symbol (required).

get_earnings_guidanceB

Get management guidance information from SEC filings and earnings calls

Inputs: symbol (required).

get_financial_dataC

Get comprehensive financial data and fundamental analysis metrics for a stock

Inputs: symbol (required).

get_market_environmentB

現在の市場環境とマクロ経済指標を取得 (金利、ドル円、NYダウ、VIX等)

Inputs: region (required), timeframe.

get_multiple_stock_pricesA

Get real-time stock price information for multiple stock symbols

Inputs: symbols (required).

get_quarterly_earnings_forecastB

Get quarterly earnings forecast and analyst estimates for a stock

Inputs: symbol (required).

get_stock_priceB

Get real-time stock price information for a given stock symbol

Inputs: symbol (required).

screen_profit_turnaround_stocksC

Screen multiple stocks to find those that have turned from loss to profit

Inputs: symbols (required), maxMarketCap, minMarketCap.

summarize_ir_informationC

Generate comprehensive IR summary from local PDF documents for Japanese and US stocks

Inputs: symbol (required), language, companyName, marketRegion, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 12 tools

    Disambiguation3/5

    Several tools target closely related concepts—earnings guidance vs. 10-K guidance, quarterly vs. annual forecasts, single vs. multiple stock prices, and PDF extraction vs. IR summarization—so an agent could select the wrong one. The descriptions provide enough qualifiers to disambiguate most pairs, but the boundaries are not always crisp.

    Naming Consistency4/5

    All tool names are snake_case and verb-first (get_, analyze_, screen_, summarize_, extract_), so there is no stylistic chaos. However, the set mixes many get_ tools with non-get analytical/utility actions and uses slightly inconsistent modifier forms like profitability_turnaround vs. profit_turnaround_stocks.

    Tool Count5/5

    12 tools is within the ideal 3-15 range and each tool maps to a distinct stock-research workflow: prices, fundamentals, forecasts, guidance, turnaround analysis, IR PDF handling, and macro context. The count feels intentionally scoped rather than bloated or thin.

    Completeness3/5

    For a broad stock server, the set covers prices, fundamentals, forecasts, guidance, screening, and IR files, but it lacks obvious common needs like historical price series, company profile or symbol lookup, and news/analyst data. These gaps are workable around but still noticeable for an agent trying to perform general stock analysis.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time stock market data and financial analysis through Yahoo Finance integration. Enables users to get quotes, historical prices, fundamentals, dividends, analyst forecasts, and growth projections for any stock symbol.
      4
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time stock data analysis, portfolio management, technical analysis with EMA/MACD indicators, and automated trading recommendations with confidence levels using Yahoo Finance API.
      -
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides real-time financial data from Yahoo Finance, enabling stock price lookups, historical data analysis, company information retrieval, and multi-stock comparisons through natural language queries.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Provides comprehensive financial analysis and real-time market data including stock information, options chains, technical indicators, financial statements, earnings calendars, and market sentiment indicators through integration with yfinance and other financial APIs.
      14
      MIT