StockMCP

by leogue

344 downloads Not rated yet
GitHub

About

A MCP server providing real-time stock market data and financial analysis through Yahoo Finance API. Built with FastAPI and designed for AI applications requiring comprehensive financial data access

Explore

- Real‑time quotes, fundamentals, and historical OHLCV data
- Dividend analysis with quality metrics and consistency scoring
- Analyst forecasts (price targets, consensus ratings, EPS)
- Forward growth projections (revenue, EPS, FCF with CAGR)
- Optional Alpha Vantage integration for enhanced earnings estimates
- Docker‑ready and supports custom port mapping

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name StockMCP
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

For immediate access, use this configuration in your claude_desktop_config.json:

``json
{
"mcpServers": {
"stock-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"https://stockmcp.leoguerin.fr/api/mcp",
"--header",
"--allow-http"
]
}
}
}
`

Configuration file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\\Claude\\claude_desktop_config.json

1. Get a free Alpha Vantage API key: Visit https://www.alphavantage.co/support/#api-key
2. Configure environment:


cp .env.example .env

cp .env.example .env

uv sync

StockMCP implements the Model Context Protocol (MCP) for seamless integration with AI applications. Once running, the server provides:

- Endpoint:
http://localhost:3001/api/mcp
- Protocol: JSON-RPC 2.0 over HTTP
- Discovery: Use
tools/list to get available tools
- Execution: Use
tools/call to execute tools with parameters

For detailed API examples and JSON schemas, access the interactive documentation at
http://localhost:3001/docs when the server is running.

bash

The container exposes the API on port 3001 by default. You can customize this:


docker run -p 3001:3001 -e LOG_LEVEL=DEBUG stockmcp

The server can be configured through environment variables:

-
LOG_LEVEL - Logging level (DEBUG, INFO, WARNING, ERROR)
-
HOST - Server host (default: 0.0.0.0)
-
PORT` - Server port (default: 3001)

get_realtime_quote

Retrieve current market data including price, volume, market cap, and key financial ratios

get_fundamentals

Access comprehensive financial statements (income, balance sheet, cash flow) and calculated ratios

get_price_history

Get historical OHLCV data with optional total return calculation including reinvested dividends

get_dividends_and_actions

Analyze dividend payment history and corporate actions with quality metrics and consistency scoring

get_analyst_forecasts

Get analyst price targets, consensus ratings (Buy/Hold/Sell), and EPS forecasts from professional analysts

get_growth_projections

Forward growth projections for revenue, earnings (EPS), and free cash flow with 1-year, 3-year, and 5-year CAGR estimates

| Tool Name | Description |
|-----------|-------------|
| get_realtime_quote | Retrieve current market data including price, volume, market cap, and key financial ratios |
| get_fundamentals | Access comprehensive financial statements (income, balance sheet, cash flow) and calculated ratios |
| get_price_history | Get historical OHLCV data with optional total return calculation including reinvested dividends |
| get_dividends_and_actions | Analyze dividend payment history and corporate actions with quality metrics and consistency scoring |
| get_analyst_forecasts | Get analyst price targets, consensus ratings (Buy/Hold/Sell), and EPS forecasts from professional analysts |
| get_growth_projections | Forward growth projections for revenue, earnings (EPS), and free cash flow with 1-year, 3-year, and 5-year CAGR estimates |

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "stockmcp": {
            "stock-mcp": {
                "command": "npx",
                "args": [
                    "mcp-remote",
                    "https://stockmcp.leoguerin.fr/api/mcp",
                    "--header",
                    "--allow-http"
                ]
            }
        }
    }
}

McpServers

{
    "stock-mcp": {
        "command": "npx",
        "args": [
            "mcp-remote",
            "https://stockmcp.leoguerin.fr/api/mcp",
            "--header",
            "--allow-http"
        ]
    }
}
> A comprehensive Model Context Protocol (MCP) server for real-time stock market data using Yahoo Finance Python 3.10+ FastAPI License: MIT Tests StockMCP provides a powerful, JSON-RPC 2.0 compliant interface for accessing comprehensive stock market data, built on the Model Context Protocol standard. Perfect for AI applications, financial analysis tools, and trading bots.

🌐 Free Hosted Endpoint

Use StockMCP immediately without any setup! We provide a free hosted endpoint at: - Endpoint: https://stockmcp.leoguerin.fr/api/mcp - No API key required - Just add to your MCP client configuration

Claude Desktop Configuration

For immediate access, use this configuration in your claude_desktop_config.json: ``json { "mcpServers": { "stock-mcp": { "command": "npx", "args": [ "mcp-remote", "https://stockmcp.leoguerin.fr/api/mcp", "--header", "--allow-http" ] } } } ` Configuration file locations: - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - Windows: %APPDATA%\\Claude\\claude_desktop_config.json

🛠️ Available Tools

| Tool Name | Description | |-----------|-------------| |
get_realtime_quote | Retrieve current market data including price, volume, market cap, and key financial ratios | | get_fundamentals | Access comprehensive financial statements (income, balance sheet, cash flow) and calculated ratios | | get_price_history | Get historical OHLCV data with optional total return calculation including reinvested dividends | | get_dividends_and_actions | Analyze dividend payment history and corporate actions with quality metrics and consistency scoring | | get_analyst_forecasts | Get analyst price targets, consensus ratings (Buy/Hold/Sell), and EPS forecasts from professional analysts | | get_growth_projections | Forward growth projections for revenue, earnings (EPS), and free cash flow with 1-year, 3-year, and 5-year CAGR estimates |

🚀 Quick Start

API Key Setup

1. Get a free Alpha Vantage API key: Visit https://www.alphavantage.co/support/#api-key 2. Configure environment:
`bash # Copy the example environment file cp .env.example .env # Edit .env and add your API key ALPHAVANTAGE_KEY=your-actual-api-key-here `

Using Docker (Recommended)

``bash
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.