Get the FREE Ultimate OpenClaw Setup Guide →

YFinance-Trader -ClaudeDesktop

An MCP (Model Context Protocol) tool that provides stock market data and trading capabilities using the yfinance library, specifically adapted for Claude Desktop.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio saintdoresh-yfinance-trader-mcp-claudedesktop py -3.13 path/to/your/main.py

How to use

YFinance Trader MCP Tool for Claude Desktop provides real-time stock quotes, company overviews, historical price data, symbol search, analyst recommendations, and insider transactions using the yfinance library. It is adapted for Claude Desktop, allowing you to query stock information and finance metrics through a set of dedicated tools. To use it, configure Claude Desktop to launch the MCP server defined in your settings and then invoke the available tools (get_stock_quote, get_company_overview, get_time_series_daily, search_symbol, get_recommendations, get_insider_transactions) to retrieve structured JSON data for your desired symbols. The tools return concise, structured responses suitable for conversational agents and automated workflows.

Available tools include:

  • get_stock_quote: Retrieve real-time price, change, and volume for a symbol.
  • get_company_overview: Fetch company name, sector, industry, market cap, P/E ratios, dividend yield, and 52-week highs/lows.
  • get_time_series_daily: Obtain historical daily price data for a symbol.
  • search_symbol: Search for stocks and other securities by keyword.
  • get_recommendations: Get analyst recommendations for a symbol across periods.
  • get_insider_transactions: Return recent insider trading activity for a symbol.

These tools can be used individually or composed into prompts to gather the data you need for trading decisions, research, and analysis within Claude Desktop.

How to install

Prerequisites:

  • Python 3.10 or higher
  • Internet access to install dependencies

Step-by-step installation:

  1. Ensure Python is installed and accessible from your PATH.

  2. Create a project directory and navigate to it.

  3. Install dependencies listed in requirements.txt:

    pip install -r requirements.txt

  4. Place your main Python script at the path you will reference in the MCP config (path/to/your/main.py).

  5. Set up Claude Desktop to point to the MCP server configuration:

    • In Claude Desktop, add the MCP config block for the yfinance-trader server (as shown in mcp_config).
  6. Start Claude Desktop and ensure the MCP server launches correctly, then test each tool endpoint to verify responses.

Additional notes

Tips and considerations:

  • The integration uses py to run the Python script; ensure the specified path to main.py is correct in your Claude Desktop MCP settings.
  • Keep your Python environment consistent (Python 3.10+ as recommended) to avoid compatibility issues with dependencies.
  • If you upgrade dependencies, re-run installation steps to ensure all packages are properly installed.
  • For real-time data, ensure network access is available; some data points may depend on external services and availability.
  • If errors occur, check that the target main.py can handle the input payloads and returns properly formatted JSON for each tool.

Related MCP Servers

Sponsor this space

Reach thousands of developers