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
-
get_stock_info(ticker: str)- Get basic information about a stock
- Example:
get_stock_info("AAPL")
-
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
-
get_recommendations(ticker: str)- Get analyst recommendations for a stock
-
get_multiple_tickers(tickers: list[str], period: str = "1d")- Get data for multiple stocks at once
- Example:
get_multiple_tickers(["AAPL", "GOOGL"])
-
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
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a pull request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_server_yfinance-0.1.0.dev36.tar.gz.
File metadata
- Download URL: mcp_server_yfinance-0.1.0.dev36.tar.gz
- Upload date:
- Size: 38.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45a4ba49b4fd95b87509c49029c3af5c0010b216c18e2bba6ca0fa9bb093d2ff
|
|
| MD5 |
eaf56483df79a5cb40ce31f8c288d2e5
|
|
| BLAKE2b-256 |
c49d7185963001127e90e7153930c0e019e08b5b987aeeeebfce43c67f8b9f85
|
File details
Details for the file mcp_server_yfinance-0.1.0.dev36-py3-none-any.whl.
File metadata
- Download URL: mcp_server_yfinance-0.1.0.dev36-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
312fc78a8180a44d517abb15c50ffb278e001ab6cba6aff12d8fd9621c9b723b
|
|
| MD5 |
b864dc69118deedc03fade161d8cb7da
|
|
| BLAKE2b-256 |
d6680e8a221cd3d747b4ed4b15ea4b5ec3872acd5cf383f4e56bcf707d4e771a
|