development
location
documentation
public
finance
MCP
What is MCP YFinance Stock Server for real-time stock data and analysis.?
This project sets up a stock Price server powered by the Yahoo Finance (YFinance) API and built for seamless integration with MCP (Multi-Agent Control Protocol). It allows AI agents or clients to retrieve real-time stock data, manage a watchlist, perform full stock analysis, run full technical indicators, and much more.
Documentation
\n\n# πΉ MCP YFinance Stock Server
This project sets up a stock Price server powered by the Yahoo Finance (YFinance) API and built for seamless integration with MCP (Multi-Agent Control Protocol).
It allows AI agents or clients to:
Retrieve real-time stock data
Manage a watchlist
Perform full stock analysis
Run full technical indicators
And much more
\n\n## πͺ Start Simple: Build a Crypto Price Tracker First
Before diving into the full-blown stock server, I recommend starting with this simple crypto tracker built with Python + MCP π
\n\n## π¦ Step 1: Set Up the Environment (with uv)
We use uv β a modern, ultra-fast Python package manager β to manage our project environment.
\n\n### π οΈ Installation & Setup
Run the following commands in your terminal:
\n\n# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
\n\n# Create and navigate to your project directory
mkdir mcp-yfinance-server
cd mcp-yfinance-server
\n\n# Initialize a new project
uv init
\n\n# Create and activate the virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
\n\n## π₯ Install the project
Once your pyproject.toml is set up with dependencies, run:
\n\n# Run
uv pip install -e .
\n\n## π Step 2: Running the MCP Server
Once your environment is ready, start the stock server:
cp ../yf_serve.py .
uv run source/yf_server.py
π§ͺ Want a quick test first?
Try running the lightweight demo server:
β οΈ Replace /ABSOLUTE/PATH/TO/... with actual file paths.
π‘ Tip: Rename your server from crypto-price-tracker to yfinance-price-tracker for clarity.
\n\n## π Step 5: Restart Claude Desktop
Restart Claude Desktop (or any interface that uses MCP) to reload and activate your new YFinance tools.
This ensures the updated MCP configuration is recognized and all stock tracking tools are
ready to use.
\n\n## β Step 6: Testing the MCP Server with Claude Desktop
With everything installed and configured, you're ready to test your MCP server in Claude Desktop.
Use these example queries to test your MCP YFinance Server in action:
"Compare the stock prices of Tesla and Apple."
β π§ Uses compare_stocks
"Get the historical data for Tesla over the past month."
β π Uses get_stock_history
"Add Apple, Tesla, and Reliance to my watchlist."
β π Uses add_to_watchlist
"Show me a chart of Appleβs stock over the last 30 days."
β πΌοΈ Claude can fetch + visualize data using your server
Generate charts and visual summaries with Claude Desktop.
π Ready to build your stock-tracking bot or intelligent financial dashboard? This project has all the core pieces.
\n\n## π« Feedback & Contributions
Contributions are welcome! Whether you're fixing bugs, adding features, or improving documentation, your help makes this project better.
\n\n### π Reporting Issues
If you encounter bugs or have suggestions, please open an issue in the Issues section. Be sure to include:
β Steps to reproduce (if applicable)
π Expected vs. actual behavior
π· Screenshots or error logs (if relevant)
\n\n### π¬ Submit a Pull Request
Have a fix or improvement? Head over to the Pull Requests section and submit your PR. Weβll review and merge it ASAP!
\n\n## π¬ Spread the Word
If this project saved you from API rate limits or overpriced SaaS tools...
π Star the repo
π΄ Fork it and build your own crypto/stock tool
π² Tag me on X@AdityaAkuskar β Iβd love to see what you build!