Skip to main content
Glama
guobo2421-ui

StockMCP

by guobo2421-ui

StockMCP

AI-Powered Stock Market Analysis MCP Server

Badges

License Python MCP GitHub release GitHub stars

Related MCP server: MCP YFinance Stock Server

Introduction

StockMCP is an open-source Model Context Protocol (MCP) server that enables AI assistants such as Claude Desktop and Cursor to access real-time U.S. stock market data through a rich set of financial analysis tools.

StockMCP combines market data, SEC filings, company fundamentals, valuation metrics, analyst forecasts, options data, financial health analysis, and watchlist screening into one unified MCP server.

It is designed for AI-powered investment research using Claude Desktop, Cursor, and other MCP-compatible AI clients.

Current Version

StockMCP v1.0

Initial stable release including:

  • Financial analysis

  • Company reports

  • Watchlist screening

  • Forecasts

  • Options analysis

Highlights

  • Real-time U.S. stock market data

  • SEC financial statements (up to 8 quarters)

  • Comprehensive company reports

  • Financial ratio and TTM analysis

  • Profitability, liquidity, leverage, valuation and financial health scoring

  • Automated company comparison and ranking

  • Watchlist screening and ranking

  • Analyst forecasts

  • Options chain and implied volatility

  • AI-ready tools for Claude Desktop, Cursor and other MCP clients

Features

Market Data

  • Real-time stock prices

  • Historical price data

  • Company information

Financial Analysis

  • SEC quarterly financial statements

  • TTM income statement, balance sheet and cash flow

  • Financial ratios

  • Financial health scoring and analysis

Investment Research

  • Company reports

  • Stock comparison

  • Watchlist screening

  • Analyst forecasts

Options Analysis

  • Option expiration dates

  • Calls and puts

  • Implied volatility

  • Open interest analysis

Supported AI Clients

Client

Supported

Claude Desktop

โœ…

Cursor

โœ…

VS Code + MCP

Planned

Windsurf

Planned

Quick Start

Install

git clone https://github.com/guobo2421-ui/StockMCP.git
cd StockMCP

python -m venv .venv

# Windows
.venv\Scripts\activate

# macOS / Linux
source .venv/bin/activate

pip install -r requirements.txt

python server.py

Example AI Queries

Analyze Costco's financial health.

Financial Health Analysis

Compare Apple, Microsoft, Nvidia, Google and Broadcom.

Company Comparison

Generate a complete company report for Costco.

Company Report

Find the healthiest company in my watchlist.

Screening Companies

Rank these companies by financial quality.

Rank Companies

Show Tesla's nearest option expiration.

Option Expiration Analysis

Summarize Nvidia's latest news.

Summarize Company News

Evaluate Microsoft's financial health.

Evaluate Company Financial Health

Which company has the strongest balance sheet?

Find Strongest Balance Sheet

Forecast Amazon's revenue and earnings.

Revenue and Earnings Forecast

Documentation

Architecture Diagram

                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚   AI Clients        โ”‚
                         โ”‚ Claude / Cursor     โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                                    โ–ผ
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚     server.py       โ”‚
                         โ”‚  MCP Server Entry   โ”‚
                         โ”‚                     โ”‚
                         โ”‚  imports tools/*    โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
                                    โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚              tools/                    โ”‚
              โ”‚          MCP Tool Layer                โ”‚
              โ”‚                                        โ”‚
              โ”‚  stock.py        company.py            โ”‚
              โ”‚  financials.py   forecast.py           โ”‚
              โ”‚  market.py       news.py               โ”‚
              โ”‚  options.py      screening.py          โ”‚
              โ”‚  watchlist.py                          โ”‚                           
              โ”‚                                        โ”‚
              โ”‚  @mcp.tool()                           โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚             services/                    โ”‚
              โ”‚          Business Logic Layer            โ”‚
              โ”‚                                          โ”‚
              โ”‚  yahoo.py           market_data.py       โ”‚
              โ”‚  financial_data.py  financial_ttm.py     โ”‚
              โ”‚  forecast_data.py   sec_financial_data.pyโ”‚
              โ”‚                                          โ”‚
              โ”‚  Data retrieval                          โ”‚
              โ”‚  Calculations                            โ”‚
              โ”‚  Financial analysis                      โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ–ผ            โ–ผ            โ–ผ
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ”‚ Yahoo    โ”‚ โ”‚ SEC      โ”‚ โ”‚ Other    โ”‚
             โ”‚ Finance  โ”‚ โ”‚ Company  โ”‚ โ”‚ API      โ”‚
             โ”‚          โ”‚ โ”‚ Facts    โ”‚ โ”‚          โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Data Sources

StockMCP uses:

  • Yahoo Finance for market data and price information

  • SEC CompanyFacts API for financial statements

  • Analyst estimates for forecasts

  • Options market data for derivatives analysis

Configuration

Some advanced features may require API configuration depending on the selected data providers.

See:

  • docs/INSTALL.md

  • docs/DEVELOPMENT.md

for environment variables and setup details.

Development

See the Development Guide for:

  • Project structure

  • Adding new MCP tools

  • Extending financial analysis modules

  • Running tests

Roadmap

Completed

  • โœ… Real-time market data

  • โœ… Company fundamentals

  • โœ… SEC financial statements

  • โœ… Financial ratios

  • โœ… Financial health analysis

  • โœ… Company reports

  • โœ… Watchlist screening and financial ranking

  • โœ… Analyst forecasts

  • โœ… Options analysis

Planned

  • Technical indicators

  • Portfolio analysis

  • ETF analysis

  • Dividend analysis

  • Economic indicators

  • Insider trading analysis

License

StockMCP is released under the MIT License.

Related MCP Connectors

  • Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.

  • US stock market data for AI agents: SEC filings, financials, insider trades, 13F, options, macro.

  • Your agent needs markets โ€” prices and fundamentals for listed companies, the filings behind them, crypto, and what the prediction markets put the odds at. **What you can ask for** โ€ข "Pull this company's income statement, cash flow and balance sheet for the last 8 quarters." โ€ข "What did insiders buy or sell, and when?" โ€ข "Snapshot prices for these 50 tickers, then the OHLC history for the three that moved." โ€ข "What are the current odds on this event across Kalshi and Polymarket?" โ€ข "Screen for companies matching these financial criteria." **How to use it** Point any MCP client at https://mcp.aisa.one/finance/mcp and sign in with OAuth โ€” there is no key to create or paste. 49 tools: prices and snapshots, income statements, balance sheets and cash flows, metrics and ratios, earnings and analyst estimates, filings and line-item search, insider trades, macro interest rates, news, a screener; CoinGecko spot prices, market tables, OHLC, per-venue tickers and trending; Kalshi and Polymarket markets and trades; plus EDINET filings for Japan. **Why this rather than the source** Equities, crypto and event markets behind one account, so a cross-asset question is one conversation. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Read the number here, then ask the same agent what X is saying about the ticker today โ€” without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/marketpulse/mcp ยท /crypto-market-data/mcp ยท /prediction-market-data/mcp ยท /stock-pulse/mcp for one slice each.

  • Your agent needs company financials it can compute on โ€” statements, ratios, earnings, estimates, filings and insider activity as structured data, not a PDF. **What you can ask for** โ€ข "Give me 8 quarters of income statement, balance sheet and cash flow for this ticker." โ€ข "What do analysts estimate for next quarter, and how did the last four surprise?" โ€ข "Find this exact line item across every filing." โ€ข "Who bought or sold as an insider in the last 90 days?" โ€ข "Screen for profitable companies under this valuation with growing revenue." **How to use it** Point any MCP client at https://mcp.aisa.one/marketpulse/mcp and sign in with OAuth โ€” there is no key to create or paste. 21 tools: prices and snapshots, income statements, balance sheets, cash-flow statements, financial metrics and snapshots, earnings, analyst estimates, company facts, filings and filing items, line-item search, a screener, insider trades, macro interest rates, news, plus EDINET documents and filing digests for Japanese issuers. **Why this rather than the source** Statements as fields you can compute on, and a screener in the same place. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Read the fundamentals here, then ask the same agent what social is saying about the ticker โ€” without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/finance/mcp for equities, crypto and prediction markets in one place.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to access real-time financial data, historical stock prices, company information, financial statements, options data, market news, and analyst recommendations through Yahoo Finance. Built with FastMCP v2 for efficient HTTP streaming and comprehensive market analysis tools.
    3
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to retrieve real-time stock data, manage watchlists, and perform comprehensive technical analysis using Yahoo Finance API. Provides 18+ tools for stock price tracking, trend analysis, volatility assessment, and financial indicators through MCP integration.
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Provides financial data from Yahoo Finance via MCP, enabling AI agents to access real-time stock info, historical prices, financial statements, and market analysis.
    10
    14
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to access Yahoo Finance data including stock information, news, price history, options, and earnings via MCP tools.
    53
    MIT