Weather and Stock Information MCP Server
Uses .ENV for secure API key management, storing Alpha Vantage and News API credentials needed for the server's data retrieval functions.
Provides repository access for downloading the MCP server code, allowing users to clone the server implementation from GitHub.
Leverages Python as the implementation language for all server functionality, requiring Python 3.x for operation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Weather and Stock Information MCP Server what's the forecast for New York City this weekend?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Node.js MCP Weather Server
Prerequisites
Python 3.x
uvpackage managerAPI Keys for:
Alpha Vantage (for stock data)
News API (for news data)
Setup
Clone the repository:
git clone https://github.com/suraj2906/mcpServer
cd mcpServerCreate a virtual environment and install dependencies:
uv venv
uv pip install -r requirements.txtCreate a
.envfile in the project root with your API keys:
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_key
NEWS_API_KEY=your_news_api_keyConfiguration
To use this MCP server with Claude, you need to add the following configuration to Claude's config file:
Open Claude's settings
Go to File > Settings > Developer > Edit Config
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 stateExample:
get_weather_alerts("CA")
get_forecast(latitude, longitude): Get weather forecast for a locationExample:
get_forecast(37.7749, -122.4194)
Stock Market Tools
get_top_gainers_losers(): Get top gainers and losers in the US stock marketget_news_and_sentiments(ticker): Get news and sentiment analysis for a stockExample:
get_news_and_sentiments("AAPL")
News Tools
get_news_today(keyword, date): Get news articles for a keyword and dateExample:
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!
Available Tools
5 toolsget_forecastC
Get the weather forecast for a specific location.
Args:
latitude: Latitude of the location
longitude: Longitude of the location
Inputs: latitude (required), longitude (required).
get_news_and_sentimentsB
Get the news and sentiments of a particular stock Args: ticker: Stock ticker/symbol (eg. AAPL)
Inputs: ticker (required).
get_news_todayB
Get the news headlines for a specific keyword and date Args: keyword: Keyword to search for in the news date: Date in YYYY-MM-DD format
Inputs: keyword (required), date (required).
get_top_gainers_losersB
Get the top gainers and losers in the US stock market Args: None
Inputs: no named parameters.
get_weather_alertsB
Get weather alerts for a US state.
Args:
state: Two-letter US state code (e.g., CA, NY)
Inputs: state (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Most tools have distinct purposes: weather forecasting vs. stock information vs. weather alerts. However, get_news_and_sentiments and get_news_today could cause confusion as both handle news retrieval, though one focuses on stock sentiment and the other on general keyword-based news. The descriptions help differentiate them, but overlap exists.
Tool names follow a consistent verb_noun pattern (e.g., get_forecast, get_news_and_sentiments), all using snake_case. There is a minor deviation with get_top_gainers_losers, which uses a compound noun without 'and' in the name, but overall the naming is predictable and readable.
With 5 tools, the count is reasonable for a server covering weather and stock information. It's slightly lean but manageable, as it includes core functions like forecasting, alerts, stock news, and market data. A few more tools might enhance coverage, but this is well-scoped for basic operations.
The tool surface has notable gaps. For weather, it covers forecasting and alerts but lacks current conditions or historical data. For stocks, it includes news, sentiment, and market movers but omits stock price quotes, historical data, or portfolio management. Agents can work around this, but the coverage is incomplete for a full weather and stock domain.
Maintenance
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
MCP server for weather with reasoning — umbrella advice, outdoor checks, city comparisons.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides real-time weather alerts, forecasts, stock prices, historical data, and stock-related news through an MCP interface.90 npm6MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides weather information like forecasts and alerts for US locations using the National Weather Service API.5MIT
- FlicenseBqualityDmaintenanceAn MCP server that provides weather information and alerts for US locations using the National Weather Service API, enabling retrieval of weather forecasts and active weather alerts.2-
- FlicenseCqualityDmaintenanceAn MCP server that provides weather alerts and forecasts using the National Weather Service API, with additional system tools for shell commands and process information.31-