Skip to main content

MCP server for yfinance

Project description

MCP Server YFinance

A Model Context Protocol (MCP) server that provides stock market data using YFinance.

Features

  • Get basic stock information (price, market cap, sector, etc.)
  • Fetch historical price data with customizable periods
  • Retrieve analyst recommendations
  • Download data for multiple stocks simultaneously
  • Access dividend history

Installation

pip install mcp-server-yfinance

Usage

Start the server:

python -m mcp_server_yfinance.server

Available Tools

  1. get_stock_info(ticker: str)

    • Get basic information about a stock
    • Example: get_stock_info("AAPL")
  2. get_historical_data(ticker: str, period: str = "1mo", interval: str = "1d")

    • Get historical price data
    • Periods: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
    • Intervals: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo
  3. get_recommendations(ticker: str)

    • Get analyst recommendations for a stock
  4. get_multiple_tickers(tickers: list[str], period: str = "1d")

    • Get data for multiple stocks at once
    • Example: get_multiple_tickers(["AAPL", "GOOGL"])
  5. get_dividends(ticker: str)

    • Get dividend history for a stock

VS Code Integration

Add the following to your VS Code settings.json:

"mcp.servers.yfinance": {
  "type": "stdio",
  "command": "uvx",
  "args": [
    "mcp-server-yfinance@latest"
  ]
}

License

AGPLv3+ License - see LICENSE for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a pull request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_yfinance-0.1.0.dev35.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_yfinance-0.1.0.dev35-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_yfinance-0.1.0.dev35.tar.gz.

File metadata

File hashes

Hashes for mcp_server_yfinance-0.1.0.dev35.tar.gz
Algorithm Hash digest
SHA256 c18620ba52115967fa30562043323e84e548ca1cde4e436fc7ab86f676a62901
MD5 a91839e4cb60a1102cc370a6c8147411
BLAKE2b-256 fb0f20e2267b8800cf72633b4bec1aaad15dbfa1c832f8c2e87b0fb04880a5b4

See more details on using hashes here.

File details

Details for the file mcp_server_yfinance-0.1.0.dev35-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_yfinance-0.1.0.dev35-py3-none-any.whl
Algorithm Hash digest
SHA256 d4958a7bd5f6a9d7a9af77cd6ccc2ac35097bd67428a6c3e3b815950c89582c2
MD5 fb6dac806f872878f156bd3effe507db
BLAKE2b-256 2387b6ebf8f2415d4a1d7227820a8d6baadd5b65e15a97363a6ca6a03bc50150

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page