Skip to main content
Glama
MCP Yahoo Finance

MCP Yahoo Finance

by leoncuhk

MCP ヤフーファイナンス

Yahoo!ファイナンスとの連携のためのモデルコンテキストプロトコル(MCP)サーバー。このサーバーは、価格や企業情報を取得し、財務データを視覚化するためのツールを提供します。

このプロジェクトは、視覚化機能が追加された、maxscheijen/mcp-yahoo-financeのフォークおよび拡張です。

特徴

  • 財務データ: 現在の株価、過去の株価、配当、損益計算書などを取得します

  • ビジュアル分析: 市場感情、ポートフォリオの追跡、テクニカル分析のための美しい視覚化を生成します

  • 簡単な統合: Claude Desktop、VS Code、Cursor、その他のMCPクライアントと連携

Related MCP server: Yahoo Finance MCP Server

セットアップ手順

1. リポジトリのクローンを作成する

このリポジトリをローカル マシンにクローンします。

git clone https://github.com/leoncuhk/mcp-yahoo-finance.git
cd mcp-yahoo-finance

2. 依存関係をインストールする

pip を使用して必要な依存関係をインストールします。

pip install -r requirements.txt

requirements.txt ファイルが見つからない場合は、依存関係を直接インストールできます。

pip install mcp yfinance pandas matplotlib seaborn plotly kaleido numpy pillow base64io

3. MCPクライアントを構成する

クロードデスクトップ

これをclaude_desktop_config.jsonに追加します (存在しない場合は作成します)。

  • macOS/Linux : ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows : %APPDATA%\Claude\claude_desktop_config.json

{
    "mcpServers": {
        "yahoo-finance": {
            "command": "uvx",
            "args": ["mcp-yahoo-finance"]
        }
    }
}

docker を使用することもできます:

{
    "mcpServers": {
        "yahoo-finance": {
            "command": "docker",
            "args": ["run", "-i", "--rm", "IMAGE"]
        }
    }
}

VSコード

これを.vscode/mcp.jsonに追加します:

{
    "servers": {
        "yahoo-finance": {
            "command": "uvx",
            "args": ["mcp-yahoo-finance"]
        }
    }
}

カーソル

カーソル MCP 構成に以下を追加します:

{
    "mcp-servers": {
        "yahoo-finance": {
            "command": "uvx",
            "args": ["mcp-yahoo-finance"]
        }
    }
}

4. MCPクライアントを再起動します

設定後、Claude Desktop またはお好みの MCP クライアントを再起動してサーバーをロードします。

利用可能なツール

基本財務データ

  • get_current_stock_price : シンボルの現在の株価を取得する

  • get_stock_price_by_date : 特定の日付の株価を取得する

  • get_stock_price_date_range : 日付範囲の株価を取得する

  • get_historical_stock_prices : カスタマイズ可能な期間の過去の株価データを取得する

  • get_dividends : 株式の配当情報を取得する

  • get_income_statement : 損益計算書データを取得する

  • get_cashflow : キャッシュフロー計算書データを取得する

  • get_earning_dates : 収益日情報を取得する

  • get_news : 株式の最新ニュースを取得する

視覚化ツール

  • generate_market_dashboard : リアルタイムのインデックスパフォーマンスを表示する市場感情ダッシュボードを作成する

  • generate_portfolio_report : ポートフォリオパフォーマンス追跡レポートを生成する

  • generate_stock_technical_analysis : 株式のテクニカル分析レポートを作成する

視覚化の例

市場センチメントダッシュボード

市場センチメントダッシュボード

ポートフォリオ追跡

ポートフォリオパフォーマンスの追跡

株式テクニカル分析

株価テクニカル分析

プロンプトの例

以下に、クロードに試していただきたいプロンプトの例を示します。

基本財務データ

  1. 「アップルの現在の株価はいくらですか?」

  2. 「AppleとGoogleの株価の差はどれくらいですか?」

  3. 「2025年1月1日から2025年3月31日の間にAppleの株価はどれくらい変化したでしょうか?」

視覚化リクエスト

  1. 「主要指数のパフォーマンスを示す市場感情ダッシュボードを生成します。」

  2. 「テクノロジー株 AAPL、MSFT、GOOGL、AMZN、NVDA のポートフォリオ追跡レポートを作成します。」

  3. 「移動平均とサポート/レジスタンスレベルを含むテスラ株のテクニカル分析チャートを見せてください。」

  4. 「S&P 500、ダウ・ジョーンズ、NASDAQ を使用して市場感情ダッシュボードを生成します。」

  5. 「エネルギー株(XOM、CVX、BP、COP、SLB)のポートフォリオレポートを作成できますか?」

  6. 「RSI とボリュームパターンを示す NVDA 株の詳細なテクニカル分析が必要です。」

テスト

視覚化機能をテストするには:

cd tests
python test_visualization.py

これにより、 examplesディレクトリにサンプルの視覚化画像が生成されます。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

謝辞

Available Tools

10 tools
get_cashflowC

Get cashflow for a given stock symbol.

Inputs: symbol (required), freq.

get_current_stock_priceC

Get the current stock price based on stock symbol.

Inputs: symbol (required).

get_dividendsC

Get dividends for a given stock symbol.

Inputs: symbol (required).

get_earning_datesC

Get earning dates.

Inputs: symbol (required), limit.

get_historical_stock_pricesC

Get historical stock prices for a given stock symbol.

Inputs: symbol (required), period, interval.

get_income_statementC

Get income statement for a given stock symbol.

Inputs: symbol (required), freq.

get_newsC

Get news for a given stock symbol.

Inputs: symbol (required).

get_recommendationsC

Get analyst recommendations for a given symbol.

Inputs: symbol (required).

get_stock_price_by_dateB

Get the stock price for a given stock symbol on a specific date.

Inputs: symbol (required), date (required).

get_stock_price_date_rangeC

Get the stock prices for a given date range for a given stock symbol.

Inputs: symbol (required), start_date (required), end_date (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools are clearly distinct, focusing on specific financial data types like cashflow, dividends, or news. However, there is some overlap between get_current_stock_price, get_stock_price_by_date, and get_stock_price_date_range, which could cause confusion about which to use for price queries, though their descriptions help clarify the differences.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with 'get_' prefix and snake_case, such as get_cashflow and get_historical_stock_prices. This predictability makes it easy for agents to understand and navigate the tool set without naming conflicts or inconsistencies.

    Tool Count5/5

    With 10 tools, the server is well-scoped for financial data retrieval, covering key aspects like prices, financial statements, news, and recommendations. Each tool serves a distinct purpose without being overly broad or sparse, fitting typical needs in this domain.

    Completeness4/5

    The tool set provides comprehensive coverage for retrieving financial data, including core elements like prices, statements, and news. A minor gap is the lack of tools for updating or managing data (e.g., no create or delete operations), but this is reasonable for a read-only finance server focused on data access.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time financial data from Yahoo Finance to Large Language Models through the Model Context Protocol, enabling AI models to access stock prices, historical data, and company information.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Provides access to real-time stock prices, financial statements, news, and options data via the Model Context Protocol. It enables AI assistants to retrieve comprehensive market data, including historical prices and analyst recommendations, through a standardized interface.
      9
      45 PyPI
      4
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Provides financial data tools including stock prices, news, forex, fundamentals, and corporate actions via the Tiingo API through the Model Context Protocol.
      11
      5
      -