FinanceExpert
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.pyMCPサーバーとして追加 (Cursor)
Cursor設定 → MCPを開きます(またはMCP JSON設定を編集します。macOS/Linuxでは通常
~/.cursor/mcp.jsonです)。作業ディレクトリがこのリポジトリであり、コマンドが
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 にインストールします)。
設定を保存し、Cursorを再起動(またはMCPをリロード)します。MCPパネルに、ツール
get_stock_analysis、get_historical_prices、およびget_stock_price_chartを備えた FinanceExpert が表示されるはずです。
他のMCPクライアント(Claude Code、MCPをサポートするエディタなど)も同じ考え方を使用します。stdioサーバーには command + args + cwd を設定してください。
ツール
ツール | 説明 |
| スナップショットテキスト: 現在の価格、50日平均、アナリスト推奨キー( |
|
|
| ボックス描画された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 toolsget_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
Scored across 3 tools
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.
All tools use a consistent get_verb_noun pattern (get_historical_prices, get_stock_analysis, get_stock_price_chart). Naming is clear and predictable.
With 3 tools covering historical data, real-time analysis, and charting, the set is appropriately scoped for a finance assistant. No tool feels unnecessary.
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
Related MCP Connectors
Scrape stock quotes, historical prices, and financial statements from Yahoo Finance.
Stock, ETF, index and crypto quotes, fundamentals and price history from Yahoo Finance.
Real-time Yahoo Finance stock/crypto quotes & options, Google Trends, News & Reddit/HN sentiment.
Yahoo Finance for AI agents: quotes, price history, options with Greeks, financials, news, movers.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables querying Yahoo Finance data including stock prices, historical data, financial statements, dividends, news, analyst recommendations, and company information through the yfinance library.-
- AlicenseNot gradedqualityDmaintenanceEnables 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
- AlicenseAqualityCmaintenanceEnables retrieval of comprehensive financial data from Yahoo Finance, including stock prices, company info, financial statements, options, and news, for stock analysis and market research.9372MIT
- AlicenseAqualityDmaintenanceProvides access to Yahoo Finance data including real-time stock quotes, historical prices, financial statements, company info, symbol search, and news.641 npm1MIT