πΉ MCP YFinance Stock Server
About
Real-time stock API with Python, MCP server example, yfinance stock analysis dashboard
Details
- License
- MIT
Explore
- Retrieve real-time stock prices
- Manage a personal watchlist (add, view prices)
- Perform 1-month technical trend analysis (RSI, MACD, MAs)
- Generate comprehensive technical summaries with indicators
- Analyze trend shifts, patterns, and divergences
- Compare stock prices for relative performance analysis
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
πΉ MCP YFinance Stock ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
We use uv β a modern, ultra-fast Python package manager β to manage our project environment.
Run the following commands in your terminal:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
Once your pyproject.toml is set up with dependencies, run:
Once your environment is ready, start the stock server:
bashuv run main.py
``
π§ͺ Want a quick test first?
Try checking the tools first:
`bash
python run test_server_fun.py
`
π Curious how the full server works?
Explore the source code here:
π yf_server.py βΊ GitHub
---
To integrate your YFinance MCP server, add the following entry to your mcp.config.json file:
`json
{
"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.
---
add_to_watchlist
Add a stock ticker to your personal watchlist.
analyze_stock
Perform a 1-month technical trend analysis (RSI, MACD, MAs)..
get_technical_summary
Generate a comprehensive technical summary including indicators & signals..
get_watchlist_prices
Fetch the most recent prices for all watchlisted tickers.
get_trend_analysiss
Analyze recent trend shifts, patterns, and divergences..
get_stock_price
Retrieve the current price for a given ticker symbol.
get_volatility_analysis
Calculate historical volatility and ATR metrics..
compare_stocks
Compare two stock prices (useful for relative performance analysis).
The server exposes many tools for AI agents and CLI users.
Here are some important tools, check out the complete tools list here:
| Tool Name | Description |
|-------------------------------|-----------------------------------------------------------------------------|
| add_to_watchlist | Add a stock ticker to your personal watchlist. |
| analyze_stock |Perform a 1-month technical trend analysis (RSI, MACD, MAs).. |
| get_technical_summary |Generate a comprehensive technical summary including indicators & signals.. |
| get_watchlist_prices | Fetch the most recent prices for all watchlisted tickers. |
| get_trend_analysiss | Analyze recent trend shifts, patterns, and divergences.. |
| get_stock_price | Retrieve the current price for a given ticker symbol. |
| get_volatility_analysis | Calculate historical volatility and ATR metrics.. |
| compare_stocks | Compare two stock prices (useful for relative performance analysis). |
> β
Total: 18 powerful tools to analyze and monitor stocks with precision.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"\ud83d\udcb9 mcp yfinance stock server": {
"mcp-yfinance-server": {
"command": "uv",
"args": [
"init"
]
}
}
}
}
McpServers
{
"mcp-yfinance-server": {
"command": "uv",
"args": [
"init"
]
}
}
πͺ 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/Adity-star/mcp-crypto-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 Projects
Explore more of my work: - GenAI-Learnings: A deep dive into Generative AI concepts, tools, and projects. - LangChain-Mastery: Everything you need to master LangChain for building powerful LLM applications. - Complete Data Science: A deep dive into Data Science AI concepts, tools, and projects and all the material for learning and interview preparation. - Reinforcement-Learning: Hands-on experiments and theory in Reinforcement Learning. - CompleteRAG: End-to-end implementation of Retrieval-Augmented Generation (RAG) systems. ---π 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/Adity-star/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: ```bashSign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



