Logo van MCP Yfinance Server

MCP Yfinance Server

Community
Adity-star

Real-time stock API with Python, MCP server example, yfinance stock analysis dashboard

UitgeverAdity-star
Repositorymcp-yfinance-server
TaalPython
Forks
20
Sterren
54
Beschikbare tools
0
Transporttypestdio
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    MCP Yfinance Server biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    54 sterren en 20 forks in de gekoppelde repository.

MseeP.ai Security Assessment Badge

💹 MCP YFinance Stock Server

Python MCP License Listed on Spark Install via Spark

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

image


🪙 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:

bash
# 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:

bash
#  Run 
uv pip install -e .

🚀 Step 2: Running the MCP Server

Once your environment is ready, start the stock server:

bash
uv 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


🛠️ 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 NameDescription
add_to_watchlistAdd a stock ticker to your personal watchlist.
analyze_stockPerform a 1-month technical trend analysis (RSI, MACD, MAs)..
get_technical_summaryGenerate a comprehensive technical summary including indicators & signals..
get_watchlist_pricesFetch the most recent prices for all watchlisted tickers.
get_trend_analysissAnalyze recent trend shifts, patterns, and divergences..
get_stock_priceRetrieve the current price for a given ticker symbol.
get_volatility_analysisCalculate historical volatility and ATR metrics..
compare_stocksCompare 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:

bash
$ mcp dev source/yf_server.py

This launches an interactive UI to:

  • 🧰 View all available tools and resources
  • 📥 Test input/output for each tool
  • 📡 Monitor real-time responses from your server

image


⚙️ Step 4: Configure Your MCP Server

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.


🔁 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

FeatureOutcome
✅ Stock AnalysisAnalyse stock giving price, OHLC, returns, volume, insights and data.
📈 Technical AnalysisAccess indicators like RSI, MACD, MA, and a complete technical summary.
📉 Volatility ReportsAnalyze stock risk with ATR and volatility metrics.
🔍 Trend AnalysisDetect trend shifts and divergence using price movement analysis.
🧠 Visualisations18+ tools ready to power AI agents or dashboards to visualise stock.
📋 Technical ChartsAnalyse and monitor technical indicators for stocks in real-time.
🖼️ Visual InsightsGenerate 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...

  • 🌟 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!
  • 🔗 Connect with me on LinkedIn

📜 License

MIT © 2025 Ak Aditya.


🚀 Let’s build better tools together.

If you’d like a tweet thread, carousel, or launch post for this — I’ve got your back 😎

Gebruik MCP Yfinance Server MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra MCP Yfinance Server is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg MCP Yfinance Server toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van MCP Yfinance Server.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "mcp-yfinance-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van MCP Yfinance Server in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van MCP Yfinance Server in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je MCP Yfinance Server gebruiken om me hiermee te helpen?
MCP Yfinance Server
Zeker. Ik heb het gelezen.
Dit vond ik met MCP Yfinance Server.

Veelgestelde vragen

Waarvoor wordt de MCP-server MCP Yfinance Server gebruikt?

MCP Yfinance Server is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik MCP Yfinance Server MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je MCP Yfinance Server gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom MCP Yfinance Server MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als MCP Yfinance Server verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik MCP Yfinance Server MCP met TypingMind?

MCP Yfinance Server werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt MCP Yfinance Server MCP in TypingMind?

MCP Yfinance Server biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om MCP Yfinance Server MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als MCP Yfinance Server authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇