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.dev34.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.dev34-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for mcp_server_yfinance-0.1.0.dev34.tar.gz
Algorithm Hash digest
SHA256 e85803162b97a8bf0d7fabb0ab8cfc7b622c2f9627035aa15038a199d8f7ec0c
MD5 d2db0c24cc948a7df1f89271c9f3d085
BLAKE2b-256 64a7f90ddd2b62014bdf7bf493548c719a3bd15fa373f1dd374cc7c1af19615d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_yfinance-0.1.0.dev34-py3-none-any.whl
Algorithm Hash digest
SHA256 9d9f394da4d579bdccb2d183b4333714934529ed40883e7401d0c1479dc2e41a
MD5 678b4b1a1e62233d28fcfe95cf5ad415
BLAKE2b-256 116ada8d2b9ab97b375f721df0fae70512405679b3f89b6dcdde58720fe9a7f8

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