mcp-yahoo-finance
MCP server for Yahoo Finance
claude mcp add --transport stdio leoncuhk-mcp-yahoo-finance uvx mcp-yahoo-finance
How to use
This MCP server provides tools to interact with Yahoo Finance data, including current and historical pricing, dividends, income statements, and visualization capabilities for market sentiment and portfolio analysis. The server exposes a set of data retrieval tools (e.g., get_current_stock_price, get_historical_stock_prices, get_dividends, get_income_statement) and visualization tools (e.g., generate_market_dashboard, generate_portfolio_report, generate_stock_technical_analysis) that can be invoked through MCP clients such as Claude Desktop, VS Code, Cursor, and other MCP-compatible interfaces. The visualization tools produce dashboards and reports suitable for monitoring market indices, tracking a portfolio, and performing technical analysis on individual stocks. To connect, configure an MCP client to run the server process (via uvx) and reference the server name yahoo-finance.
Once connected, you can request price data, financial statements, and news for specific tickers, as well as generate dynamic visualizations. The visualization tools are designed to produce outputs that help users interpret market sentiment, portfolio performance, and technical indicators. If you are using Claude Desktop or another MCP client, ensure the appropriate server entry is configured in your client’s mcp.json or equivalent configuration file as shown in the examples.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- Basic command line knowledge
- Internet access to install dependencies from PyPI
-
Clone the repository git clone https://github.com/leoncuhk/mcp-yahoo-finance.git cd mcp-yahoo-finance
-
(Optional) Create and activate a virtual environment python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows
-
Install Python dependencies pip install -r requirements.txt
If requirements.txt is missing, install core dependencies directly:
pip install mcp yfinance pandas matplotlib seaborn plotly kaleido numpy pillow base64io
-
Run or package the MCP server Since this server is intended to be run via MCP clients using uvx, you typically start it by configuring your MCP client to point to the server package name (mcp-yahoo-finance) as shown in the examples. The server package should be accessible in your Python environment when uvx runs it.
-
Verify installation
- Ensure the MCP client can connect to the yahoo-finance server entry as described in the README examples.
- Test basic data retrieval calls (e.g., get_current_stock_price for a symbol) to confirm the server responds correctly.
Additional notes
Tips and notes:
- The project extends an existing Yahoo Finance MCP server with added visualization capabilities; ensure you have the required visualization dependencies installed (matplotlib, seaborn, plotly, kaleido).
- If you encounter network or API rate limits from Yahoo Finance, consider setting up caching in your client or between requests.
- When configuring MCP clients, the server name is yahoo-finance and the command is uvx with the argument mcp-yahoo-finance, as shown in the README examples. If you switch to Docker, you can adapt the docker run command accordingly.
- For environment-specific issues, check that your Python path and virtual environment are correctly set, and that required fonts and rendering capabilities are available for visualizations (e.g., headless environments may need additional config).
- The available tools span data retrieval and visuals; if you’re automating prompts, you can combine data calls with visualization calls to generate dashboards programmatically.
Related MCP Servers
yahoo-finance
This is a Model Context Protocol (MCP) server that provides comprehensive financial data from Yahoo Finance. It allows you to retrieve detailed information about stocks, including historical prices, company information, financial statements, options data, and market news.
yfinance
MCP server from narumiruna/yfinance-mcp
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
cloudwatch-logs
MCP server from serkanh/cloudwatch-logs-mcp
servicenow-api
ServiceNow MCP Server and API Wrapper