MCP Yahoo Finance Server and UI
@quartermaine
MCP Yahoo Finance Server and UI
Overview
What is MCP Yahoo Finance Server and UI?
The MCP Yahoo Finance Server is a tool that fetches real-time stock data, company information, and historical price data using the Yahoo Finance API. It integrates with the Multi-Client Protocol (MCP) framework and includes a web-based UI built with FastAPI and DaisyUI components for an intuitive user experience.
How to use MCP Yahoo Finance Server and UI?
Install the server by cloning the repository, creating a Python virtual environment with uv, and installing dependencies. Run the server with uv run yahoo_finance.py and start the UI with uvicorn main:app --reload. Alternatively, build and run a Docker image using the provided Dockerfile. Configure Azure OpenAI parameters in a .env file for natural language query processing. The server can also be integrated with GitHub Copilot via a .vscode/mcp.json file.
Key features of MCP Yahoo Finance Server and UI
- Fetches current stock prices for any stock symbol.
- Retrieves detailed company information (sector, industry, market cap).
- Gets historical stock price data for a date range.
- Built on the MCP framework for easy client integration.
- Powered by Azure OpenAI for natural language query processing.
- Includes a web UI using FastAPI and DaisyUI components.
Use cases of MCP Yahoo Finance Server and UI
- Query current stock price for a symbol like AAPL.
- Obtain company info including sector, market cap, and employees.
- Retrieve historical data (open, high, low, close, volume) for a date range.
- Integrate with GitHub Copilot for in-editor financial data queries.
- Deploy a lightweight web interface for interactive stock data exploration.
FAQ from MCP Yahoo Finance Server and UI
What runtime does the server require?
Python 3 with uv and pipx for environment management, plus dependencies like fastapi, jinja2, uvicorn, mcp, anthropic, openai, python-dotenv, and yfinance.
How is the server configured?
Configuration is done via a .env file that must include Azure OpenAI API version, endpoint, API key, and deployment model. The server uses python-dotenv to load these variables automatically.
Can I use it without Azure OpenAI?
No, the project is powered by Azure OpenAI for processing natural language queries; no other LLM provider is mentioned in the README.
Where does the data come from?
All stock data is fetched from the Yahoo Finance API using the yfinance Python library.
What transport protocol is used?
The server uses the MCP framework with a stdio transport, as shown in the GitHub Copilot integration example (type: "stdio").