Weather and Stock Information MCP Server

Weather and Stock Information MCP Server

An MCP server that provides real-time weather alerts, forecasts, stock market data, and news information through various API integrations.

Category
Visit Server

README

MCP Server - Weather and Stock Information Service

This MCP (Model Control Protocol) server provides real-time weather alerts, forecasts, stock market data, and news information through various API integrations.

Features

  • Weather Alerts: Get active weather alerts for US states
  • Weather Forecast: Get detailed weather forecasts for specific locations
  • Stock Market Data: Access top gainers and losers in the US stock market
  • Stock News and Sentiments: Get news and sentiment analysis for specific stocks
  • General News: Search for news articles by keyword and date

Prerequisites

  • Python 3.x
  • uv package manager
  • API Keys for:
    • Alpha Vantage (for stock data)
    • News API (for news data)

Setup

  1. Clone the repository:
git clone https://github.com/suraj2906/mcpServer
cd mcpServer
  1. Create a virtual environment and install dependencies:
uv venv
uv pip install -r requirements.txt
  1. Create a .env file in the project root with your API keys:
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_key
NEWS_API_KEY=your_news_api_key

Configuration

To use this MCP server with Claude, you need to add the following configuration to Claude's config file:

  1. Open Claude's settings
  2. Go to File > Settings > Developer > Edit Config
  3. Add the following configuration:
{
    "mcpServers": {
        "weatherAndStock": {
            "command": "uv",
            "args": [
                "--directory",
                "YOUR\\REPOSITORY\\PATH",
                "run",
                "mcp-server.py"
            ]
        }
    }
}

Note: Make sure to adjust the path (C:\\Users\\asus\\code\\mcpServer) to match your actual project location.

Available Tools

Weather Tools

  • get_weather_alerts(state): Get active weather alerts for a US state
    • Example: get_weather_alerts("CA")
  • get_forecast(latitude, longitude): Get weather forecast for a location
    • Example: get_forecast(37.7749, -122.4194)

Stock Market Tools

  • get_top_gainers_losers(): Get top gainers and losers in the US stock market
  • get_news_and_sentiments(ticker): Get news and sentiment analysis for a stock
    • Example: get_news_and_sentiments("AAPL")

News Tools

  • get_news_today(keyword, date): Get news articles for a keyword and date
    • Example: get_news_today("technology", "2024-03-20")

Error Handling

The server includes robust error handling for API requests and will return appropriate error messages if:

  • API keys are missing
  • API requests fail
  • Invalid parameters are provided
  • No data is found for the given criteria

Contributing

Feel free to submit issues and enhancement requests!

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