yfinance-mcp-server

yfinance-mcp-server

0

This project is a server that utilizes the Model Context Protocol to provide stock market data, compatible with MCP clients like Claude Desktop. It offers features for querying stock prices, company information, and current date/time data in various formats and timezones.

Stock Data MCP Server

This server utilizes the Model Context Protocol (MCP) to allow users to retrieve stock market data. It is compatible with MCP clients like Claude Desktop and provides real-time stock information and date/time data.

Key Features

1. Stock Price Data Retrieval

  • Query stock prices for specific periods.
  • Flexible start and end date specification.
  • Defaults to the current date if no date is specified.

2. Stock Information Retrieval

  • Provides basic company information such as company name, sector, and industry.
  • Offers financial data such as market capitalization and stock prices.
  • Includes company overview and description.

3. Current Date/Time Information

  • Provides current date and time information for various time zones.
  • Offers date/time data in multiple formats (ISO, Korean, Unix timestamp).

Installation Instructions

Requirements

  • Python 3.10 or higher

Installation and Usage per OS

Mac/Linux
  1. Open terminal and install dependencies.
  2. Run the server.
  3. Install on Claude Desktop.
Windows
  1. Run Command Prompt or PowerShell as administrator.
  2. Install dependencies.
  3. Run the server.
  4. Install on Claude Desktop.

Development and Testing

To test the server during development, use MCP development commands.

Usage Example with Claude Desktop

  • Stock Price Retrieval: Ask for the recent stock prices of Apple or specific date ranges for Tesla.
  • Stock Information Retrieval: Request basic information about Microsoft.
  • Current Date/Time Information: Query the current date or time in New York.

Notes

  • The yfinance library uses unofficial APIs and may be affected by changes in Yahoo Finance's terms of service.
  • There's a potential for rate limiting with high request frequencies.
  • Data may have slight delays compared to real-time.

License

MIT License.