Skip to main content
Glama
StockFlow MCP Server

StockFlow MCP Server

by twolven

StockFlow MCP Server

Ein Model Context Protocol (MCP)-Server, der Echtzeit-Aktiendaten und Optionsanalysen über Yahoo Finance bereitstellt. Ermöglicht LLMs den Zugriff auf Marktdaten, die Analyse von Aktien und die Bewertung von Optionsstrategien.

Funktionen

Aktiendaten

  • Echtzeit-Aktienkurse und wichtige Kennzahlen

  • Historische Kursdaten mit OHLC-Werten

  • Unternehmenskennzahlen und Finanzberichte

  • Marktindikatoren und Kennzahlen

Optionsanalyse

  • Vollständige Optionskettendaten

  • Griechen (Delta, Gamma, Theta, Vega)

  • Verfolgung von Volumen und offenem Interesse

  • Analyse von Optionsstrategien

Related MCP server: MCP Yahoo Finance

Installation

# Install dependencies
pip install mcp yfinance

# Clone the repository
git clone https://github.com/twolven/stockflow
cd stockflow

Verwendung

  1. Klonen Sie das Repository:

git clone https://github.com/twolven/mcp-stockflow.git
cd mcp-stockflow
  1. Installieren Sie die Abhängigkeiten:

pip install -r requirements.txt
  1. Fügen Sie zu Ihrer Claude-Konfiguration hinzu: Fügen Sie in Ihrer claude-desktop-config.json Folgendes zum Abschnitt mcpServers hinzu:

{
    "mcpServers": {
        "stockflow": {
            "command": "python",
            "args": ["path/to/stockflow.py"]
        }
    }
}

Ersetzen Sie "path/to/stockflow.py" durch den vollständigen Pfad zu der Stelle, an der Sie die Datei stockflow.py gespeichert haben.

Verwendungshinweis für Claude

Wenn Sie mit Claude arbeiten, können Sie diesen Hinweis verwenden, um ihm die verfügbaren Tools zu erklären:

"Ich habe die stockflow-Tools aktiviert, die Ihnen Zugriff auf Aktienmarktdaten geben. Sie können diese drei Hauptfunktionen verwenden:

  1. get_stock_data – Umfassende Aktieninformationen abrufen:

{
    "symbol": "AAPL",
    "include_financials": true,  # optional
    "include_analysis": true,    # optional
    "include_calendar": true     # optional
}
  1. get_historical_data – Kursverlauf und technische Indikatoren abrufen:

{
    "symbol": "AAPL",
    "period": "1y",        # 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
    "interval": "1d",      # 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo
    "prepost": false       # optional - include pre/post market data
}
  1. get_options_chain – Optionsdaten abrufen:

{
    "symbol": "AAPL",
    "expiration_date": "2024-12-20",  # optional - uses nearest date if not specified
    "include_greeks": true            # optional
}

Alle Antworten enthalten aktuelle Kursdaten, Fehlerbehandlung und umfassende Marktinformationen."

Server ausführen

python stockflow.py

Verwendung mit MCP-Client

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

server_params = StdioServerParameters(
    command="python",
    args=["stockflow.py"]
)

async def run():
    async with stdio_client(server_params) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            
            # Get current stock data
            result = await session.call_tool(
                "get-stock-data", 
                arguments={"symbol": "AAPL"}
            )
            
            # Get options chain
            options = await session.call_tool(
                "get-options-chain",
                arguments={
                    "symbol": "AAPL",
                    "expiration_date": "2024-12-20"
                }
            )

if __name__ == "__main__":
    import asyncio
    asyncio.run(run())

Verfügbare Tools

  1. get-stock-data

    • Aktueller Preis und Volumen

    • Marktkapitalisierung und KGV

    • 52-Wochen-Hoch/Tief

  2. get-historical-data

    • OHLC-Kurse

    • Konfigurierbare Zeiträume

    • Volumendaten

  3. get-options-chain

    • Calls und Puts

    • Ausübungspreise

    • Griechen und IV

    • Volumen und offenes Interesse

Verfügbare Ressourcen

  1. company-info://{symbol}

    • Unternehmensbeschreibung

    • Sektor und Branche

    • Mitarbeiterzahl

    • Website

  2. financials://{symbol}

    • Gewinn- und Verlustrechnung

    • Bilanz

    • Kapitalflussrechnung

Prompts

  1. analyze-options

    • Analyse von Optionsstrategien

    • Risiko-/Ertragsbewertung

    • Bewertung der Marktbedingungen

Anforderungen

  • Python 3.12+

  • mcp

  • yfinance

Einschränkungen

  • Die Daten stammen von Yahoo Finance und können Verzögerungen aufweisen.

  • Die Verfügbarkeit von Optionsdaten hängt von den Marktzeiten ab.

  • Es gelten Ratenbegrenzungen basierend auf den Einschränkungen der Yahoo-Finance-API.

Mitwirken

Beiträge sind willkommen! Sie können gerne einen Pull Request einreichen.

Lizenz

Dieses Projekt ist unter der MIT-Lizenz lizenziert – siehe die Datei LICENSE für Details.

Autor

Todd Wolven – Leitender KI-Softwareentwickler und Open-Source-GenAI-Ingenieur

Danksagungen

  • Erstellt mit dem Model Context Protocol (MCP) von Anthropic

  • Daten bereitgestellt von Yahoo Finance

  • Entwickelt für die Verwendung mit Claude von Anthropic

Available Tools

3 tools
get_historical_data_v2C

Get unadjusted/repaired price history and technical indicators.

Inputs: period (required), symbol (required), prepost, interval. Returns: data, success, provider, warnings, +1 more

get_options_chain_v2B

Get an option chain and optionally add theoretical European Black-Scholes Greeks.

Inputs: symbol (required), include_greeks, expiration_date. Returns: data, success, provider, warnings, +1 more

get_stock_data_v2B

Get stock metadata and optional statements, analysis and calendar data.

Inputs: symbol (required), include_analysis, include_calendar, include_financials. Returns: data, success, provider, warnings, +1 more

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool targets a clearly distinct data domain: metadata/statements, historical prices/indicators, and options chains. There is no functional overlap between the three tools, so an agent can reliably select the correct one.

    Naming Consistency5/5

    All tool names follow the exact same get_<resource>_v2 pattern, with consistent snake_case and a uniform version suffix. This makes the naming scheme highly predictable and easy to navigate.

    Tool Count4/5

    Three tools is a modest but reasonable scope for a focused stock data server. The count is on the lower end, but each tool covers a substantial area, so it does not feel overly thin.

    Completeness4/5

    The main investment data workflows—current company data, historical prices, and options—are all covered. Minor gaps such as ticker search or news endpoints exist, but they are not critical dead ends for typical stock analysis use cases.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables LLMs to analyze options chains, calculate Greeks, and evaluate basic options strategies through Yahoo Finance data.
      1
      41
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      A Model Context Protocol server that enables interaction with Yahoo Finance to retrieve stock pricing, company information, and historical financial data through natural language queries.
      21
      888 PyPI
      29
      MIT
    • A
      license
      C
      quality
      Not graded
      maintenance
      A Model Context Protocol server that provides tools for interacting with Yahoo Finance, allowing users to retrieve stock prices, company information, and perform financial data comparisons.
      11
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      A Model Context Protocol server providing comprehensive financial data from Yahoo Finance, allowing users to retrieve detailed stock information, financial statements, options data, and market news.
      34
      MIT