Stock-MCP

Stock-MCP

Enables AI assistants like GitHub Copilot to access live stock market data, company information, technical analysis, news, and portfolio analytics.

Category
Visit Server

README

šŸ“ˆ Stock-MCP

AI-Powered Stock Market MCP Server for GitHub Copilot

A production-ready Model Context Protocol (MCP) Server built with Python and FastMCP that enables GitHub Copilot Agent Mode to access live stock market data, company information, technical analysis, news, and portfolio analytics through intelligent AI tool calling.


šŸš€ Overview

Stock-MCP transforms GitHub Copilot into an intelligent financial assistant by exposing stock market capabilities as MCP tools.

Instead of relying on static knowledge, Copilot can invoke this server to fetch live financial information and perform real-time analysis.

Example:

User: What is the current stock price of Apple?

↓

GitHub Copilot

↓

MCP Server

↓

Yahoo Finance

↓

Live Price Returned

↓

Copilot explains the result.


✨ Features

  • šŸ“Š Live Stock Price Lookup
  • šŸ¢ Company Information
  • šŸ“° Latest Financial News
  • šŸ“ˆ Technical Analysis
  • šŸ’¼ Portfolio Valuation
  • šŸ“‰ Portfolio Performance Analysis
  • ⚔ FastMCP-based Tool Registration
  • šŸ¤– GitHub Copilot Agent Mode Integration
  • šŸ Pure Python Implementation
  • šŸ”§ Easily Extendable Architecture

šŸ— Architecture

                    User
                      │
                      ā–¼
            GitHub Copilot Agent
                      │
             Model Context Protocol
                      │
                      ā–¼
              Stock-MCP Server
                      │
      ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
      │               │                │
      ā–¼               ā–¼                ā–¼
 Stock Tool      Company Tool      News Tool
      │               │                │
      ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                      │
               Yahoo Finance API

šŸ“‚ Project Structure

Stock-MCP/

ā”œā”€ā”€ server.py
ā”œā”€ā”€ mcp_app.py
ā”œā”€ā”€ mcp.json
ā”œā”€ā”€ requirements.txt
ā”œā”€ā”€ README.md
│
ā”œā”€ā”€ tools/
│   ā”œā”€ā”€ ping.py
│   ā”œā”€ā”€ stock.py
│   ā”œā”€ā”€ company.py
│   ā”œā”€ā”€ news.py
│   ā”œā”€ā”€ technical.py
│   ā”œā”€ā”€ portfolio.py
│   └── prediction.py
│
ā”œā”€ā”€ services/
ā”œā”€ā”€ utils/
ā”œā”€ā”€ models/
ā”œā”€ā”€ config/
└── tests/

šŸ›  Tech Stack

Technology Purpose
Python 3.12+ Backend
FastMCP MCP Framework
MCP SDK Protocol Support
yfinance Stock Data
Pandas Data Processing
NumPy Numerical Computing
TA Technical Indicators
Pydantic Validation
GitHub Copilot MCP Client

šŸ“¦ Installation

Clone the repository

git clone https://github.com/Madhan-2096/Stock-MCP.git

cd Stock-MCP

Create a virtual environment

python -m venv .venv

Activate it

Windows

.venv\Scripts\activate

Linux / macOS

source .venv/bin/activate

Install dependencies

pip install -r requirements.txt

ā–¶ Running the MCP Server

python server.py

Expected Output

Starting MCP Server...

Transport: stdio

Waiting for requests...

šŸ”— Connecting with GitHub Copilot

Create an mcp.json configuration.

Example:

{
  "servers": {
    "stock-market-assistant": {
      "command": "python",
      "args": [
        "server.py"
      ]
    }
  }
}

Reload GitHub Copilot Agent Mode.

Your tools will automatically become available.


🧰 Available MCP Tools

Tool Description
ping Health check
get_stock_price Get latest stock price
get_company_info Company fundamentals
get_stock_news Latest market news
technical_analysis RSI, SMA, EMA, MACD
calculate_portfolio_value Portfolio valuation
get_portfolio_performance Portfolio return analysis

šŸ’¬ Example Prompts

Get Stock Price

What is the current price of AAPL?

Company Information

Tell me about Microsoft.

Technical Analysis

Perform technical analysis for TSLA.

News

Show today's news about NVIDIA.

Portfolio

Calculate my portfolio.

AAPL - 10

MSFT - 5

GOOGL - 8

šŸ“Š Current Capabilities

āœ… Live Stock Prices

āœ… Company Information

āœ… Technical Indicators

āœ… Financial News

āœ… Portfolio Valuation

āœ… Portfolio Performance

āœ… GitHub Copilot Integration


🚧 Roadmap

  • [ ] Real-Time WebSocket Stock Streaming
  • [ ] AI Investment Recommendations
  • [ ] Sentiment Analysis
  • [ ] Candlestick Pattern Detection
  • [ ] Portfolio Optimization
  • [ ] Stock Comparison Tool
  • [ ] PDF Report Generator
  • [ ] Alpha Vantage Integration
  • [ ] Finnhub Integration
  • [ ] Docker Support
  • [ ] GitHub Actions CI/CD

šŸ¤ Contributing

Contributions are welcome.

  1. Fork the repository

  2. Create a new feature branch

git checkout -b feature/new-feature
  1. Commit your changes
git commit -m "Added new feature"
  1. Push
git push origin feature/new-feature
  1. Open a Pull Request

šŸ“œ License

This project is licensed under the MIT License.


šŸ‘Øā€šŸ’» Author

Madhan J R

B.Tech Artificial Intelligence & Data Science

Meenakshi Sundararajan Engineering College

GitHub: https://github.com/Madhan-2096


⭐ Support

If you found this project useful,

please consider giving it a ⭐ on GitHub.

It helps others discover the project and motivates future development.


Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured