Skip to main content
Glama
FinanceExpert

FinanceExpert

by geddamsatish

mcp-stock-server (FinanceExpert)

FastMCPで構築された小さなModel Context Protocolサーバーです。Yahoo Financeの市場データ(yfinance経由)を公開し、アシスタントが株価、CSV形式の履歴、およびプレーンテキストのUnicode価格チャートを取得できるようにします。

要件

  • Python 3.11+

  • uv(推奨)、またはpyproject.tomlから依存関係をインストールするその他の方法

Related MCP server: Yahoo Finance MCP Server

セットアップ

cd mcp-stock-server
uv sync

実行 (stdio)

このサーバーはstdio経由でMCPと通信します(mcp.run()のデフォルト):

uv run python server.py

MCPサーバーとして追加 (Cursor)

  1. Cursor設定 → MCPを開きます(またはMCP JSON設定を編集します。macOS/Linuxでは通常 ~/.cursor/mcp.json です)。

  2. 作業ディレクトリがこのリポジトリであり、コマンドが server.py で始まる stdio サーバーを登録します。

オプション A — uv run (推奨)

/absolute/path/to/mcp-stock-server を、リポジトリをクローンした実際のパスに置き換えてください。

{
  "mcpServers": {
    "FinanceExpert": {
      "command": "uv",
      "args": ["run", "python", "server.py"],
      "cwd": "/absolute/path/to/mcp-stock-server"
    }
  }
}

uv syncの後、これは uv.lock からロックされた依存関係を使用します。

オプション B — プロジェクトの仮想環境 (virtualenv) Python

MCPクライアントから uv を呼び出したくない場合は、これを使用してください:

{
  "mcpServers": {
    "FinanceExpert": {
      "command": "/absolute/path/to/mcp-stock-server/.venv/bin/python",
      "args": ["server.py"],
      "cwd": "/absolute/path/to/mcp-stock-server"
    }
  }
}

最初にvenvを作成します(リポジトリのルートから): uv sync (依存関係を .venv にインストールします)。

  1. 設定を保存し、Cursorを再起動(またはMCPをリロード)します。MCPパネルに、ツール get_stock_analysis、get_historical_prices、および get_stock_price_chart を備えた FinanceExpert が表示されるはずです。

他のMCPクライアント(Claude Code、MCPをサポートするエディタなど)も同じ考え方を使用します。stdioサーバーには command + args + cwd を設定してください。

ツール

ツール

説明

get_stock_analysis

スナップショットテキスト: 現在の価格、50日平均、アナリスト推奨キー(Ticker.infoより)。

get_historical_prices

days 暦日(period=f"{days}d")の期間における、日次終値列のCSV。デフォルトは days=30。

get_stock_price_chart

ボックス描画されたASCII/Unicodeチャート: エリア塗りつぶし、価格軸、時間軸上の開始/終了日、および8ステップのスパークライン。

get_stock_price_chart パラメータ

  • ticker — シンボル(例: INTU, AAPL)。

  • days — period が省略された場合に使用されます: Yahooの範囲 Nd(暦日)。デフォルトは 30。

  • period — オプションのYahoo期間文字列。設定すると days を上書きします。例: 10y, 5y, 1y, 6mo, ytd, max。

例:

  • 直近1ヶ月のセッション(暦日単位): days=30

  • 直近10暦年(Yahooウィンドウ): period="10y"

市場データはYahooからyfinanceを通じて取得されます。セマンティクスは yfinance history(period=...) に準拠しています。

免責事項

株価や履歴は情報提供のみを目的としており、投資助言ではありません。Yahooのデータは遅延したりエラーが含まれたりする可能性があるため、意思決定の際は独自に確認してください。

Available Tools

3 tools
get_historical_pricesC

Fetches historical closing prices for chart generation.

Inputs: ticker (required), days. Returns: result

get_stock_analysisA

Fetches real-time stock price, 50-day average, and analyst recommendations.

Inputs: ticker (required). Returns: result

get_stock_price_chartA

Plain-text Unicode chart. Pass period (e.g. 10y, 5y, 1y) for calendar ranges, or use days alone.

Inputs: ticker (required), days, period. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 3 tools

    Disambiguation4/5

    Tools are mostly distinct: get_historical_prices provides raw data for charts, get_stock_analysis gives real-time price and fundamentals, and get_stock_price_chart returns a visual chart. However, get_historical_prices and get_stock_price_chart both relate to historical data, causing slight overlap.

    Naming Consistency5/5

    All tools use a consistent get_verb_noun pattern (get_historical_prices, get_stock_analysis, get_stock_price_chart). Naming is clear and predictable.

    Tool Count5/5

    With 3 tools covering historical data, real-time analysis, and charting, the set is appropriately scoped for a finance assistant. No tool feels unnecessary.

    Completeness3/5

    The tools cover basic stock data retrieval and charting but lack fundamental operations like search, comparison, or portfolio management. Gaps exist for a fully comprehensive finance tool.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables querying Yahoo Finance data including stock prices, historical data, financial statements, dividends, news, analyst recommendations, and company information through the yfinance library.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to retrieve stock market data and financial information from Yahoo Finance using the yfinance Python library. Supports querying stock prices, historical data, and other financial metrics through natural language.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables retrieval of comprehensive financial data from Yahoo Finance, including stock prices, company info, financial statements, options, and news, for stock analysis and market research.
      9
      372
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Provides access to Yahoo Finance data including real-time stock quotes, historical prices, financial statements, company info, symbol search, and news.
      6
      41 npm
      1
      MIT