MCP YFinance Stock Server
Provides stock analysis and monitoring capabilities for Apple stock, including price tracking, technical analysis, and watchlist management through Yahoo Finance data
Provides stock analysis and monitoring capabilities for Tesla stock, including price tracking, technical analysis, and watchlist management through Yahoo Finance data
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP YFinance Stock Serverget current price for AAPL and analyze its recent trend"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
πΉ 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 (Model 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
πͺ 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 π
π GitHub Repo: https://github.com/sauniket/mcp-yfinance-server
You'll learn how to:
Use MCP to expose crypto tools like get_price("BTC")
Build an API with FastAPI
Fetch real-time prices using the Alpaca API
Related MCP server: YFinance MCP Server
π Then Level Up: Build the yFinance Stock Server
Once you're familiar with the flow, move on to this more advanced stock tracker πΉ
π GitHub Repo: https://github.com/sauniket/mcp-yfinance-server
π Detailed Blog: π How I Built My Own Stock Server with Python, yFinance, and a Touch of Nerdy Ambition
Includes:
Watchlists
Real-time(ish) price updates
Technical summaries
A full-featured dashboard
Trend + momentum indicators
Watchlist management
π¦ Step 1: Set Up the Environment (with uv)
We use uv β a modern, ultra-fast Python package manager β to manage our project environment.
π οΈ Installation & Setup
Run the following commands in your terminal:
# 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 a new project
uv init
# Create and activate the virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
π₯ Install the project
Once your pyproject.toml is set up with dependencies, run:
# Run
uv pip install -e .
π Step 2: Running the MCP Server
Once your environment is ready, start the stock server:
uv run main.pyπ§ͺ Want a quick test first? Try checking the tools first:
python run test_server_fun.pyπ Curious how the full server works?
Explore the source code here:
π οΈ MCP Tool Reference
The server exposes many tools for AI agents and CLI users.
Here are some important tools, check out the complete tools list here:
π¦ Tool List
Tool Name | Description |
| Add a stock ticker to your personal watchlist. |
| Perform a 1-month technical trend analysis (RSI, MACD, MAs).. |
| Generate a comprehensive technical summary including indicators & signals.. |
| Fetch the most recent prices for all watchlisted tickers. |
| Analyze recent trend shifts, patterns, and divergences.. |
| Retrieve the current price for a given ticker symbol. |
| Calculate historical volatility and ATR metrics.. |
| Compare two stock prices (useful for relative performance analysis). |
β Total: 18 powerful tools to analyze and monitor stocks with precision.
π§ Use Cases
These tools are ideal for:
π Dynamic watchlist management
π Trend and momentum detection
π Deep-dive technical analysis for investment decisions
β οΈ Volatility-based risk assessment
π€ Powering stock-focused autonomous agents or dashboards
βοΈ Keep this reference handy for building intelligent financial applications with the MCP server.
π Step 3: Inspecting the MCP Server
Easily explore and test your MCP tools using the MCP Server Inspector. Run the following command in your terminal:
$ mcp dev source/yf_server.pyThis launches an interactive UI to:
π§° View all available tools and resources
π₯ Test input/output for each tool
π‘ Monitor real-time responses from your server
βοΈ Step 4: Configure Your MCP Server
To integrate your YFinance MCP server, add the following entry to your mcp.config.json file:
{
"mcpServers": {
"yfinance-price-tracker": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/YOUR/mcp-yfinance-server",
"run",
"main.py"
]
}
}
}β οΈ Replace /ABSOLUTE/PATH/TO/... with actual file paths. π‘ Tip: Rename your server from crypto-price-tracker to yfinance-price-tracker for clarity.
π 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.
β 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
π· Sample Chart: πΌ view Screenshot
π Live Claude Site: Open Demo on Claude.site
π§ͺ These tests ensure your MCP integration is working end-to-endβfrom data retrieval to real-time analysis and visualization.
π Results
βοΈ Outcomes You Can Expect
Feature | Outcome |
Analyse stock giving price, OHLC, returns, volume, insights and data. | |
π Technical Analysis | Access indicators like RSI, MACD, MA, and a complete technical summary. |
π Volatility Reports | Analyze stock risk with ATR and volatility metrics. |
π Trend Analysis | Detect trend shifts and divergence using price movement analysis. |
π§ Visualisations | 18+ tools ready to power AI agents or dashboards to visualise stock. |
π Technical Charts | Analyse and monitor technical indicators for stocks in real-time. |
πΌοΈ Visual Insights | 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.
π« Feedback & Contributions
Contributions are welcome! Whether you're fixing bugs, adding features, or improving documentation, your help makes this project better.
π 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)
π¬ 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!
π¬ Spread the Word
If this project saved you from API rate limits or overpriced SaaS tools...
If youβd like a tweet thread, carousel, or launch post for this β Iβve got your back π
This server cannot be deployed
Maintenance
Related MCP Connectors
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
Trade across 22+ exchanges and brokers from any MCP-capable AI agent, no install required.
Your agent needs markets β prices and fundamentals for listed companies, the filings behind them, crypto, and what the prediction markets put the odds at. **What you can ask for** β’ "Pull this company's income statement, cash flow and balance sheet for the last 8 quarters." β’ "What did insiders buy or sell, and when?" β’ "Snapshot prices for these 50 tickers, then the OHLC history for the three that moved." β’ "What are the current odds on this event across Kalshi and Polymarket?" β’ "Screen for companies matching these financial criteria." **How to use it** Point any MCP client at https://mcp.aisa.one/finance/mcp and sign in with OAuth β there is no key to create or paste. 49 tools: prices and snapshots, income statements, balance sheets and cash flows, metrics and ratios, earnings and analyst estimates, filings and line-item search, insider trades, macro interest rates, news, a screener; CoinGecko spot prices, market tables, OHLC, per-venue tickers and trending; Kalshi and Polymarket markets and trades; plus EDINET filings for Japan. **Why this rather than the source** Equities, crypto and event markets behind one account, so a cross-asset question is one conversation. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Read the number here, then ask the same agent what X is saying about the ticker today β without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/marketpulse/mcp Β· /crypto-market-data/mcp Β· /prediction-market-data/mcp Β· /stock-pulse/mcp for one slice each.
Your agent needs the two halves of a move at once β what people are posting about a ticker right now, and what the price and the news actually did. **What you can ask for** β’ "What is X saying about $NVDA today, and what did the stock do?" β’ "Show the chatter and the price move for these five tickers side by side." β’ "Which tickers are being talked about most right now?" β’ "Pull the news and the snapshot behind this spike." **How to use it** Point any MCP client at https://mcp.aisa.one/stock-pulse/mcp and sign in with OAuth β there is no key to create or paste. 4 tools: a combined stock-pulse call that joins X/Twitter chatter to the tickers mentioned, plus advanced tweet search, price snapshots and financial news. **Why this rather than the source** One call instead of four, with the join already done. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Spot the move here, then ask the same agent for the filings or the fundamentals behind it β without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/finance/mcp for equities, crypto and prediction markets in one place.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to access real-time financial data, historical stock prices, company information, financial statements, options data, market news, and analyst recommendations through Yahoo Finance. Built with FastMCP v2 for efficient HTTP streaming and comprehensive market analysis tools.3-
- FlicenseAqualityDmaintenanceProvides financial data from Yahoo Finance via MCP, enabling AI agents to access real-time stock info, historical prices, financial statements, and market analysis.1014-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to access Yahoo Finance data including stock information, news, price history, options, and earnings via MCP tools.51MIT
- AlicenseAqualityDmaintenanceEnables querying stock data, financial information, news, and historical prices from Yahoo Finance through a set of MCP tools.5MIT