Yahoo Finance MCP Server
📈 A Model Context Protocol (MCP) server that lets your AI interact with Yahoo Finance - get comprehensive stock market data, news, financials, and more.
✨ Features
- 📊 Stock Data - Get comprehensive ticker information including company details, financials, and trading metrics
- 📰 News Feed - Fetch recent news articles related to specific stock symbols
- 🔍 Search - Find stocks, ETFs, and other financial instruments with news results
- 🏆 Top Entities - Get top performing companies, ETFs, and mutual funds by sector
- 📈 Price History - Fetch historical price data with customizable periods and intervals
- ⚡ Options Chain - Get option chain data for stocks including calls and puts
- 💰 Earnings - Access earnings data including upcoming earnings dates
- 🌐 Proxy Support - Works with HTTP/HTTPS/SOCKS proxies
- 🚀 Fast & Async - Non-blocking operations using asyncio
- 🔧 Easy Integration - Standard MCP protocol for AI assistants
🚀 Quick Start
Prerequisites
- Python 3.11 or higher
- pip or uvx package manager
- (Optional) Proxy server for better reliability
Installation
Using uvx (Recommended)
# Install with namespace
uvx yahoo-finance-server
Using pip
pip install yahoo-finance-server
From source
git clone https://github.com/AgentX-ai/AgentX-mcp-servers.git
cd AgentX-mcp-servers/yahoo_finance_server
pip install -e .
Configuration
Proxy Setup (Recommended)
For better reliability and to avoid rate limiting, set up a proxy:
# HTTP/HTTPS proxy
export PROXY_URL="http://proxy.example.com:8080"
# SOCKS proxy with auth
export PROXY_URL="socks5://user:pass@127.0.0.1:1080/"
Running the Server
# Basic run
yahoo-finance-server
# Run with proxy
PROXY_URL="http://127.0.0.1:7890" yahoo-finance-server
🛠️ API Reference
Available Tools
1. get-ticker-info
Get comprehensive stock information including company details, financials, and trading metrics.
{
"name": "get-ticker-info",
"arguments": {
"symbol": "AAPL"
}
}
2. get-ticker-news
Get recent news articles for a stock symbol.
{
"name": "get-ticker-news",
"arguments": {
"symbol": "AAPL",
"count": 10
}
}
3. search
Search for stocks, ETFs, and other financial instruments with related news.
{
"name": "search",
"arguments": {
"query": "Apple Inc",
"count": 10
}
}
4. get-top-entities
Get top performing entities in a sector.
{
"name": "get-top-entities",
"arguments": {
"entity_type": "companies", // Options: "etfs", "mutual_funds", "companies", "growth_companies", "performing_companies"
"sector": "technology", // See supported sectors below
"count": 10
}
}
Supported sectors:
- basic-materials
- communication-services
- consumer-cyclical
- consumer-defensive
- energy
- financial-services
- healthcare
- industrials
- real-estate
- technology
- utilities
5. get-price-history
Get historical price data with customizable periods and intervals.
{
"name": "get-price-history",
"arguments": {
"symbol": "AAPL",
"period": "1y", // Options: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
"interval": "1d" // Options: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo
}
}
6. ticker-option-chain
Get option chain data for stocks.
{
"name": "ticker-option-chain",
"arguments": {
"symbol": "AAPL",
"option_type": "call", // Options: "call", "put", "both"
"date": "2024-01-19" // Optional: YYYY-MM-DD format
}
}
7. ticker-earning
Get earnings data including historical and upcoming earnings.
{
"name": "ticker-earning",
"arguments": {
"symbol": "AAPL",
"period": "annual", // Options: "annual", "quarterly"
"date": "2023-12-31" // Optional: YYYY-MM-DD format
}
}
🧪 Testing
Using MCP Inspector
npx @modelcontextprotocol/inspector yahoo-finance-server
Manual Testing
python -c "
import asyncio
from yahoo_finance_server.helper import get_ticker_info
async def test():
info = await get_ticker_info('AAPL')
print(f'✅ Stock: {info[\"longName\"]}')
asyncio.run(test())
"
📋 Requirements
- Python 3.11+
- yfinance==0.2.62
- requests>=2.31.0
- pandas>=2.0.0
- mcp>=1.9.3
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
📄 License
MIT License - see LICENSE file for details.
🔗 Links
- Homepage: GitHub Repository
- Issues: Report Issues
- MCP Documentation: Model Context Protocol
Made with ❤️ for the finance community
Metadata
Release files for iflow-mcp_agentx-ai_yahoo-finance-server 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iflow_mcp_agentx_ai_yahoo_finance_server-0.1.1.tar.gz | 16.3 kB | Without provenance | Details for iflow_mcp_agentx_ai_yahoo_finance_server-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iflow_mcp_agentx_ai_yahoo_finance_server-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for iflow_mcp_agentx_ai_yahoo_finance_server-0.1.1-py3-none-any.whl |
Total release size: 34.7 kB
Release files / iflow_mcp_agentx_ai_yahoo_finance_server-0.1.1.tar.gz
| Download URL | iflow_mcp_agentx_ai_yahoo_finance_server-0.1.1.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ca7211ae3c368e11c66f8282cdf4d8397a53ceba479b31542078c282c164804
|
|
BLAKE2b-256 checksum How to use checksums |
2dc5262a33de0be5bb3ff1cdb232acec5ef57a0a261887827567eb92ef32f8d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / iflow_mcp_agentx_ai_yahoo_finance_server-0.1.1-py3-none-any.whl
| Download URL | iflow_mcp_agentx_ai_yahoo_finance_server-0.1.1-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d188d8f13035692ddec3f44d02dff75f13166a6687532c2d61dd9a005b165fbc
|
|
BLAKE2b-256 checksum How to use checksums |
e7896d78f7db0516245b1727dffe2d1b4cb11de913df70d0b92dde2aa13c4cf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for iflow-mcp_agentx-ai_yahoo-finance-server 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.