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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for mcp_server_yfinance-0.1.0.dev36.tar.gz
Algorithm Hash digest
SHA256 45a4ba49b4fd95b87509c49029c3af5c0010b216c18e2bba6ca0fa9bb093d2ff
MD5 eaf56483df79a5cb40ce31f8c288d2e5
BLAKE2b-256 c49d7185963001127e90e7153930c0e019e08b5b987aeeeebfce43c67f8b9f85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_yfinance-0.1.0.dev36-py3-none-any.whl
Algorithm Hash digest
SHA256 312fc78a8180a44d517abb15c50ffb278e001ab6cba6aff12d8fd9621c9b723b
MD5 b864dc69118deedc03fade161d8cb7da
BLAKE2b-256 d6680e8a221cd3d747b4ed4b15ea4b5ec3872acd5cf383f4e56bcf707d4e771a

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