YfinanceトレーダーMcpツール for Claudeデスクトップ
MCP(モデルコンテキストプロトコル)ツールは、yfinanceライブラリを使用して株式市場データと取引機能を提供し、特にClaude Desktopに適応されています。
概要
YFinance-Trader-MCP-ClaudeDesktopとは?
YFinance-Trader-MCP-ClaudeDesktopは、株式市場の愛好者やトレーダーのために設計された強力なツールです。yfinanceライブラリを利用して、リアルタイムの株式市場データと取引機能を提供します。このツールは特にClaude Desktopに適応されており、株式をシームレスに分析し取引するための使いやすく効率的なものです。
YFinance-Trader-MCP-ClaudeDesktopの特徴
- リアルタイムデータアクセス:株式市場データに瞬時にアクセスでき、価格、履歴データ、財務指標を含みます。
- 取引機能:アプリケーションを通じて直接取引を実行でき、リアルタイムデータに基づいて迅速な意思決定が可能です。
- ユーザーフレンドリーなインターフェース:使いやすさを考慮して設計されており、初心者と経験豊富なトレーダーの両方にアクセスしやすいインターフェースです。
- カスタマイズ可能なアラート:特定の株の動きや価格変動に対してアラートを設定し、市場の状況を把握できます。
- 包括的な分析:さまざまな指標や視覚化を用いて株式のパフォーマンスを分析し、情報に基づいた取引決定を行います。
YFinance-Trader-MCP-ClaudeDesktopの使い方
- インストール:公式リポジトリからYFinance-Trader-MCP-ClaudeDesktopアプリケーションをダウンロードしてインストールします。
- セットアップ:アカウント設定を構成し、取引プラットフォームに接続します。
- 機能を探索:ダッシュボードに慣れ、株式データを表示し、取引を実行し、アラートを設定します。
- 取引を開始:リアルタイムデータを使用して情報に基づいた取引決定を行い、アプリケーションから直接取引を実行します。
- パフォーマンスを監視:投資を追跡し、内蔵の分析ツールを使用してパフォーマンスを分析します。
よくある質問
Q: YFinance-Trader-MCP-ClaudeDesktopは無料で使用できますか?
A: はい、このツールはオープンソースであり、無料で利用できます。GitHubリポジトリからダウンロードできます。
Q: どのプラットフォームをサポートしていますか?
A: YFinance-Trader-MCP-ClaudeDesktopは特にClaude Desktop向けに設計されており、互換性と最適なパフォーマンスを保証します。
Q: アラートをカスタマイズできますか?
A: はい、ユーザーは特定の株の動きや価格変動に対してカスタマイズ可能なアラートを設定して、最新情報を受け取ることができます。
Q: 株式データはどのくらいの頻度で更新されますか?
A: アプリケーションはリアルタイムデータを提供し、ユーザーが取引決定に必要な最新情報を常に利用できるようにしています。
Q: サポートを受けたり、問題を報告したりするにはどこに行けばいいですか?
A: サポートや問題の報告は、GitHubリポジトリのイシュートラッカーを通じて行うことができ、コミュニティの議論や更新も見つけることができます。
詳細
YFinance Trader MCP Tool for Claude Desktop
An MCP (Model Context Protocol) tool that provides stock market data and trading capabilities using the yfinance library, specifically adapted for Claude Desktop.
Credit: This project was inspired by mcp-stocks by Luigi Ajah, which is a similar implementation for Cursor. This adaptation modifies the original concept to work with Claude Desktop.
Tutorial
For a detailed guide on setting up and using this tool, check out our Medium tutorial: Tutorial: Using Claude Desktop with YFinance Trader MCP Tool to Access Real-Time Stock Market Data
Features
- Real-time stock quotes
- Company information and financial metrics
- Historical price data
- Symbol search functionality
- Analyst recommendations
- Insider transaction tracking
Setup
-
Ensure you have Python 3.10 or higher installed
-
Install dependencies:
pip install -r requirements.txt
Integration with Claude Desktop
- Configure your MCP settings in Claude Desktop by adding the following to your MCP configuration:
{
"mcpServers": {
"yfinance-trader": {
"command": "py",
"args": ["-3.13", "path/to/your/main.py"]
}
}
}
- Replace the path with the full path to your main.py file
- Restart Claude Desktop if needed
Available Tools
1. get_stock_quote
Get real-time stock quote information:
{
"symbol": "AAPL",
"price": 150.25,
"change": 2.5,
"changePercent": 1.67,
"volume": 1234567,
"timestamp": "2024-03-20T10:30:00"
}
2. get_company_overview
Get company information and key metrics:
{
"name": "Apple Inc.",
"sector": "Technology",
"industry": "Consumer Electronics",
"marketCap": 2500000000000,
"peRatio": 25.4,
"forwardPE": 24.2,
"dividendYield": 0.65,
"52WeekHigh": 182.94,
"52WeekLow": 124.17
}
3. get_time_series_daily
Get historical daily price data:
{
"symbol": "AAPL",
"timeSeriesDaily": [
{
"date": "2024-03-20T00:00:00",
"open": 150.25,
"high": 152.30,
"low": 149.80,
"close": 151.75,
"volume": 12345678
}
// ... more data points
]
}
4. search_symbol
Search for stocks and other securities:
{
"results": [
{
"symbol": "AAPL",
"name": "Apple Inc.",
"type": "EQUITY",
"exchange": "NASDAQ"
}
// ... more results
]
}
5. get_recommendations
Get analyst recommendations for a stock:
{
"symbol": "AAPL",
"recommendations": [
{
"period": "2024-03-15T00:00:00",
"strongBuy": 15,
"buy": 20,
"hold": 8,
"sell": 2,
"strongSell": 0
}
// ... more periods
]
}
6. get_insider_transactions
Get insider trading information:
{
"symbol": "AAPL",
"transactions": [
{
"date": "2024-03-15T00:00:00",
"insider": "John Doe",
"position": "Director",
"transactionType": "Buy",
"shares": 1000,
"value": 150250.00,
"url": "https://finance.yahoo.com/...",
"text": "Purchase of 1000 shares",
"startDate": "2024-03-15",
"ownership": "Direct"
}
// ... more transactions
]
}
Sample Queries
You can ask Claude Desktop questions like:
- "What is the current stock price and daily change for AAPL?"
- "Can you give me a company overview for Microsoft (MSFT)?"
- "Show me the historical price data for Tesla (TSLA) over the last 3 months."
- "Search for stocks related to 'NVDA'."
- "What are the analyst recommendations for Amazon (AMZN)?"
- "Have there been any recent insider transactions for Google (GOOGL)?"
Cryptocurrency Support
Limited cryptocurrency data is available using special ticker formats:
- BTC-USD for Bitcoin
- ETH-USD for Ethereum
- DOGE-USD for Dogecoin
Error Handling
All tools include proper error handling and will return an error message if something goes wrong:
{
"error": "Failed to fetch quote for INVALID_SYMBOL"
}
Troubleshooting
If the MCP server is not working in Claude Desktop:
- Make sure the server is running - you should see output when you start the script
- Verify the path in your settings is correct and absolute
- Make sure Python 3.10+ is in your system PATH
- Check that all dependencies are installed
- Try restarting Claude Desktop
- Check logs for any error messages
Differences from the original mcp-stocks project
- Uses the MCP library directly instead of FastAPI
- Adapted for Claude Desktop instead of Cursor
- Modified error handling and response formats
- Updated configuration approach
License
MIT License
サーバー設定
{
"mcpServers": {
"yfinance-trader-mcp-claude-desktop": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--saintdoresh--yfinance-trader-mcp-claudedesktop--yfinance-trader-mcp-claude-desktop",
"python main.py"
],
"env": {}
}
}
}