Purpose
YFinance-Trader-MCP-ClaudeDesktop is an MCP (Model Context Protocol) tool designed to provide Claude Desktop with stock market data and trading capabilities. It is based on the yfinance library to obtain data, enabling users to query real-time stock information, company financial data, historical prices, analyst recommendations, and insider transactions, etc., through natural language.
Main Capabilities
This tool provides the following features:
- Real-time stock quotes: Obtain real-time quote information for stocks, including the current price and daily change.
- Company information and financial metrics: Obtain company overviews and key financial metrics.
- Historical price data: Obtain historical daily price data for specified stocks.
- Symbol search: Search for symbols of stocks and other securities.
- Analyst recommendations: Obtain analyst recommendations for stocks.
- Insider transaction tracking: Obtain insider transaction information.
In addition, it also supports limited cryptocurrency data, queried through special symbol formats (such as BTC-USD, ETH-USD, DOGE-USD).
How to Use
- Environment requirements: Ensure Python 3.10 or later is installed.
- Install dependencies: Install the required dependencies in the project directory.
- Integrate into Claude Desktop: Add a configuration entry in Claude Desktop's MCP configuration, replacing the path with the full absolute path to the main.py file.
- Restart Claude Desktop: If needed, restart Claude Desktop to load the configuration.
- Use the tools: Ask questions in natural language in Claude Desktop, for example:
- "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)?"
Available Tools
get_stock_quote: Obtain real-time stock quote information.get_company_overview: Obtain company information and key metrics.get_time_series_daily: Obtain historical daily price data.search_symbol: Search for stocks and other securities.get_recommendations: Obtain analyst recommendations.get_insider_transactions: Obtain insider transaction information.
Applicable Scenarios
Suitable for users who need to quickly query stock market data through Claude Desktop, such as investors, analysts, or individuals interested in financial markets. It can be used for real-time quote queries, company fundamental analysis, historical price lookups, stock symbol searches, and tracking analyst opinions and insider transaction activity.
Limitations
- Requires Python 3.10 or later.
- Cryptocurrency support is limited and only available for specific symbol formats.
- All tools include error handling; if an error occurs, an error message will be returned.
- If the MCP server does not work in Claude Desktop, refer to the troubleshooting steps: ensure the server is running, check whether the configuration path is correct and absolute, ensure Python 3.10+ is in the system PATH, check dependency installation, restart Claude Desktop, and review log error messages.
- Differences between this project and the original mcp-stocks project: it directly uses the MCP library instead of FastAPI, is adapted for Claude Desktop instead of Cursor, modifies error handling and response formats, and updates the configuration method.