mcp-yfinance
Real-time stock API with Python, MCP server example, yfinance stock analysis dashboard
claude mcp add --transport stdio adity-star-mcp-yfinance-server uv --directory /ABSOLUTE/PATH/TO/YOUR/mcp-yfinance-server run main.py
How to use
The MCP YFinance Stock Server exposes a set of tools to fetch real-time stock data, manage watchlists, and perform technical analysis using Yahoo Finance data. Once running, clients can query tools like get_stock_price to retrieve current prices, add_to_watchlist to curate a personal list, and analyze_stock or get_technical_summary for deeper insights into trends, indicators, and signals. The server is designed to integrate with MCP-enabled interfaces, enabling AI agents or dashboards to orchestrate stock data workflows, run simulations, or generate visualizations based on the tools exposed by the server.
How to install
Prerequisites:
- Python 3.10+ installed
- uv (Python package manager) installed or installable via provided setup steps
Step-by-step installation:
- Install uv and set up a project directory
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create and navigate to your project directory
mkdir mcp-yfinance-server
cd mcp-yfinance-server
- Initialize the project with uv and set up a virtual environment
uv init
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install the project in editable mode (from the repository you cloned or downloaded)
uv pip install -e .
- Ensure dependencies declared in pyproject.toml are installed as part of the install step, and place main.py (or your entry script) in the repository root as referenced by your MCP server configuration.
Note: The exact file names and paths may vary; update the mcp.config.json accordingly. You should have a working Python environment with the required dependencies installed before running the MCP server.
Additional notes
Tips and common issues:
- The server uses uv as the environment manager; ensure you run commands from within the project directory and that the virtual environment is active.
- Update the directory path in mcp.config.json to the absolute path of your mcp-yfinance-server installation.
- If you upgrade dependencies, re-install with uv pip install -e . to reflect changes.
- For Claude Desktop or other MCP clients, restart the UI after updating the mcp.config.json to ensure new tools are loaded.
- If you encounter import errors, verify that the pyproject.toml and requirements.txt (if present) are properly resolved in the virtual environment.
- You can customize environment variables in mcp.config.json under an env section if needed (e.g., API keys or rate limits).
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.
supermcp
🚀 SuperMCP - Create multiple isolated MCP servers using a single connector. Build powerful Model Context Protocol integrations for databases (PostgreSQL, MSSQL) with FastAPI backend, React dashboard, and token-based auth. Perfect for multi-tenant apps and AI assistants.
Vector-Knowledge-Base
A semantic search engine that transforms your documents into an intelligent, searchable knowledge base using vector embeddings and AI
github-second-brain
Providing tools to AI to explore github codebase like agent
mcp-raganything
API/MCP wrapper for RagAnything
gcp-storage
A Model Context Protocol (MCP) server that provides seamless integration with Google Cloud Storage, enabling AI assistants to perform file operations, manage buckets, and interact with GCS resources directly.