Stonks

Stonks

Automates stock analysis and news updates in Google Sheets using AI-powered insights, enabling users to manage stock data and generate comprehensive analysis through natural language.

Category
Visit Server

README

Stock News Automation Service

An intelligent MCP (Model Context Protocol) server that automates stock analysis and news updates in Google Sheets using AI-powered insights.

šŸš€ Features

Core Capabilities

  • Google Sheets Integration: Seamlessly connects to your Google Sheets for real-time stock data management
  • AI-Powered Analysis: Uses Google Gemini to generate comprehensive stock analysis
  • Multi-Type Analysis: Supports 5 different analysis types for comprehensive coverage
  • Institutional Data Visualization: Creates charts for institutional ownership data
  • Automated News Updates: Fetches and summarizes latest stock news

Analysis Types Available

  1. šŸ“° News Analysis + Market Context (Column D)

    • Company-specific news and earnings
    • Broader market trends and economic factors
    • Geopolitical impact and industry disruption
  2. šŸ¤– AI-Powered Insights (Column E)

    • Predictive modeling and pattern recognition
    • Scenario analysis with probability assessments
    • Market timing indicators
  3. šŸ“Š Investor Insights (Column F)

    • Technical and fundamental analysis
    • Risk assessment and competitive analysis
    • Sector dynamics and catalyst calendar
  4. šŸ’° Quick Financials Overview (Column G)

    • Key financial metrics and ratios
    • Growth rates and profitability analysis
    • Liquidity and valuation metrics
  5. šŸ¢ Institutional Information (Column H)

    • Institutional ownership data
    • Hedge fund and mutual fund activity
    • Insider trading and analyst coverage

šŸ› ļø Setup Instructions

Prerequisites

  • Python 3.8+
  • Google Cloud Console account
  • Google Sheets API access

1. Google Sheets API Setup

Follow the official Google guide to set up API access: Google Sheets API Quickstart

2. Installation

# Clone the repository
git clone <your-repo-url>
cd stocks

# Create virtual environment
python -m venv stocks
source stocks/bin/activate  # On Windows: stocks\Scripts\activate

# Install dependencies
pip install -r requirements.txt

3. Configuration

  1. Download credentials.json from Google Cloud Console
  2. Place it in the project root directory
  3. Create .env file with:
GOOGLE_API_KEY=your_gemini_api_key
SPREADSHEET_ID=your_google_sheets_id
RANGE_NAME=Sheet1!A6:C9

4. Usage

Option A: Standalone Mode

# Start the MCP Server
python server.py

# Run the Client
python client.py server.py

Option B: MCP Client Integration

Add to your MCP client configuration:

{
  "mcpServers": {
    "stonks-server": {
      "command": "path to your python bin",
      "args": ["path to server.py"]
    }
  }
}

Note: Update the paths to match your actual installation directory.

šŸŽÆ How It Works

  1. Initialize: Authenticate with Google Sheets API
  2. Get Stocks: Retrieve stock data from your spreadsheet
  3. Analyze: Generate AI-powered analysis for each stock
  4. Update: Automatically populate analysis in designated columns
  5. Visualize: Create institutional ownership charts

šŸ“‹ Available MCP Tools

  • initialize(): Set up Google Sheets authentication
  • get_stocks(): Fetch stock data from spreadsheet
  • update(): Add analysis to specific cells with multiple analysis types
  • search_news(): Generate news summaries using Gemini AI
  • plot_institutional_chart(): Create ownership visualization charts

These tools are available through any MCP-compatible client (Claude Desktop, etc.)

šŸ”§ Technical Architecture

  • MCP Server: FastMCP framework for tool orchestration
  • AI Integration: Google Gemini for intelligent analysis
  • Data Visualization: Matplotlib for institutional charts
  • Authentication: OAuth2 for secure Google Sheets access
  • Client Interface: LangGraph with React agent for natural language interaction

šŸ“Š Sample Workflow

User: "Update all stocks with latest news and analysis"
↓
Agent: 
1. Initializes Google Sheets connection
2. Retrieves stock symbols from spreadsheet
3. Generates news analysis for each stock
4. Updates respective columns with AI insights
5. Creates institutional ownership charts

🚨 Important Notes

  • Analysis is based on last 10 days of data
  • Includes references to SeekingAlpha, TradingTerminal, and TradingView
  • Not financial advice - for informational purposes only
  • Requires valid Google API credentials

šŸ“ˆ Future Enhancements

  • Real-time data integration
  • Advanced charting capabilities
  • Portfolio performance tracking
  • Custom analysis templates
  • Multi-exchange support

Setup Guide: Google Sheets API Quickstart

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