Skip to main content

MCP server for yfinance

Project description

MCP Server Markets

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": [
    "run",
    "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.dev27.tar.gz (25.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.dev27-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for mcp_server_yfinance-0.1.0.dev27.tar.gz
Algorithm Hash digest
SHA256 62c992a87f9e549aef410254509530ce10f54bd568bc43ff93851f610af6997d
MD5 67abc3b82477c7a323a365f61a4f345b
BLAKE2b-256 b1af9b49ab2f19c272486e6c0995a01eb49bbfedf880aa0af534aba6310a0128

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_yfinance-0.1.0.dev27-py3-none-any.whl
Algorithm Hash digest
SHA256 db5b678aeead275effe75d9d8a96d1f7e39e712fc3cb2180570f57119afa1b48
MD5 386a0c953cfed20576cd52293e6608bd
BLAKE2b-256 cb8cc0a522b920bd78110e53cda4b2cd041333cd69c8659d46c0883ac805ab6a

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