- Explore MCP Servers
- Advanced-Stock-Market-Analysis-MCP-Server
Advanced Stock Market Analysis Mcp Server
What is Advanced Stock Market Analysis Mcp Server
The Advanced-Stock-Market-Analysis-MCP-Server is a powerful and extensible server designed for advanced stock market analysis and insights. It utilizes the Model Context Protocol (MCP) and yfinance to provide tools for retrieving, analyzing, and comparing stock data, as well as conducting sector and market sentiment analysis.
Use cases
Use cases include analyzing stock trends for investment decisions, comparing the performance of different stocks, assessing market sentiment for trading strategies, and retrieving news for informed decision-making.
How to use
To use the Advanced-Stock-Market-Analysis-MCP-Server, clone the repository from GitHub, install the required dependencies, and start the server using the command ‘uv run mcp install main.py’. After that, you can access various stock analysis features through the server.
Key features
Key features include retrieving stock information, fetching historical stock data, performing technical analysis, analyzing stock risk metrics, comparing multiple stocks, assessing sector performance, evaluating market sentiment, and scraping the latest stock news.
Where to use
The Advanced-Stock-Market-Analysis-MCP-Server is applicable in finance, investment analysis, stock trading, and market research, making it suitable for individual investors, financial analysts, and institutions.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Advanced Stock Market Analysis Mcp Server
The Advanced-Stock-Market-Analysis-MCP-Server is a powerful and extensible server designed for advanced stock market analysis and insights. It utilizes the Model Context Protocol (MCP) and yfinance to provide tools for retrieving, analyzing, and comparing stock data, as well as conducting sector and market sentiment analysis.
Use cases
Use cases include analyzing stock trends for investment decisions, comparing the performance of different stocks, assessing market sentiment for trading strategies, and retrieving news for informed decision-making.
How to use
To use the Advanced-Stock-Market-Analysis-MCP-Server, clone the repository from GitHub, install the required dependencies, and start the server using the command ‘uv run mcp install main.py’. After that, you can access various stock analysis features through the server.
Key features
Key features include retrieving stock information, fetching historical stock data, performing technical analysis, analyzing stock risk metrics, comparing multiple stocks, assessing sector performance, evaluating market sentiment, and scraping the latest stock news.
Where to use
The Advanced-Stock-Market-Analysis-MCP-Server is applicable in finance, investment analysis, stock trading, and market research, making it suitable for individual investors, financial analysts, and institutions.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Advanced Stock Market Analysis Server
A powerful, extensible server for advanced stock market analysis and insights, built using the Model Context Protocol (MCP) and yfinance. This project provides a suite of tools for retrieving, analyzing, and comparing stock data, as well as sector and market sentiment analysis.
Features
- Get Stock Info: Retrieve basic information about any stock (name, price, market cap, P/E, etc.).
- Get Stock History: Fetch historical price and volume data for any stock, with robust error handling and retry logic.
- Analyze Stock Trend: Technical analysis using moving averages, RSI, MACD, Bollinger Bands, and volatility.
- Analyze Stock Risk: Quantitative risk metrics (volatility, Sharpe ratio, beta, VaR, drawdown, etc.).
- Compare Stocks: Compare multiple stocks on key metrics and performance.
- Sector Performance: Analyze the performance of major market sectors using sector ETFs.
- Market Sentiment: Assess overall market sentiment using major indices and the VIX.
- Get Stock News: Scrape and retrieve the latest news headlines and URLs for any stock from Finviz, with a recommended agent prompt for sentiment analysis and summary.
Technology Stack
- Python 3.8+
- yfinance for stock data
- fastapi (required by MCP server)
- requests and beautifulsoup4 for web scraping
- MCP (Model Context Protocol) for tool-based server architecture
Installation
- Clone the repository:
git clone https://github.com/edenmargolis/Advanced-Stock-Market-Analysis-MCP-Server cd Advanced-Stock-Market-Analysis-MCP-Server - Install dependencies:
uv pip install -r requirements.txt
Usage
To start the server:
uv run mcp install main.py
You can then interact with the server using any MCP-compatible client or integration (such as Claude, Cursor, or other AI agents that support MCP tool calls).
Example Tool Calls
- Get stock info:
{ "ticker": "AAPL" } - Get stock history:
{ "ticker": "MSFT", "period": "1y" } - Analyze stock risk:
{ "ticker": "GOOGL" } - Compare stocks:
{ "tickers": [ "AAPL", "MSFT", "GOOGL" ] } - Get stock news:
{ "ticker": "TSLA", "count": 4 }
Project Structure
main.py— Main server implementation and tool definitionsrequirements.txt— Python dependenciesREADME.md— Project documentation
Notes
- All stock data is fetched live from Yahoo Finance via yfinance.
- News headlines and URLs are scraped from Finviz for the
get_stock_newstool. - Error handling and retry logic are built-in for robust operation.
Agent Prompt for News Sentiment Analysis
When using the get_stock_news tool, use the following prompt for best results with an LLM agent:
Get the latest news of {{ticker}} stock. For each article, read the full content, assess whether the sentiment is positive, negative, or neutral, and then write a summary of the overall sentiment and your conclusions about {{ticker}} based on these articles.
For questions or contributions, please open an issue or pull request on GitHub.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










