Discover MCP Weather Server for real-time US weather alerts and forecasts via Node.js and National Weather Service API
The MCP Weather Server is a demonstration implementation of an MCP (Model Context Protocol) server tailored for fetching and providing weather-related data. It leverages Node.js to implement tools that enable AI applications to interact with the US National Weather Service API, ensuring up-to-date and accurate weather information. This server serves as a bridge between various AI tools like Claude Desktop, Continue, and Cursor, enhancing their ability to process and utilize real-world environmental data.
This MCP server focuses on two primary commands for interacting with weather-related APIs:
By implementing these features, the server adheres to the MCP protocol's standards, allowing seamless integration with various AI applications through the standardized communication interface. This ensures that developers using MCP can leverage the benefits of this project without having to worry about compatibility issues or setup complexities.
The architecture of the weather server is designed to be modular and scalable. It utilizes Node.js for its lightweight nature and efficient event-driven capabilities, making it well-suited for handling real-time data requests from AI applications. The core implementation incorporates the US National Weather Service API's endpoints, ensuring that the data returned is always relevant and up-to-date. MCP abstracts this interaction into a standardized format, allowing any compatible client to request weather information without needing direct access to these APIs.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
graph LR
subgraph Data Ingestion
WeatherData[Weather API Data]
ProcessingLayer{Data Processing Layer}
ForecastService --> [Transform Data] ProcessedData
AlertService --> [Extract Alerts] ProcessedData
end
subgraph MCP Integration
ServerInterface[MCP Interface]
ClientRequests --> ServerRequest
ServerRequest --> ProcessingLayer
ServerResponse <- ProcessingLayer
APIEndpoints[(US NWS API)]
end
To set up and run the weather server, follow these steps:
Clone the Repository:
git clone <repository-url>
cd weather
Install Dependencies:
pnpm install
Build the Project:
pnpm build
Configure MCP Client for Server Integration:
Update your settings.json
file in VSCode to include this MCP server configuration:
{
"mcpServers": {
"weather": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/build/index.js"
]
}
}
}
Imagine an AI application designed to monitor weather conditions for emergency response teams. By integrating the MCP Weather Server's get-alerts
tool, this application can promptly trigger alerts when severe weather conditions are detected in real-time. This integration ensures that emergency personnel receive immediate notifications to prepare or respond accordingly.
Consider a travel planning AI assistant that adapts its recommendations based on current and forecasted weather conditions. By leveraging the get-forecast
tool from the MCP Weather Server, this application can provide users with accurate travel advisories tailored to their destination's weather pattern. This enhances user experience by offering more relevant and actionable information.
The MCP Weather Server is compatible with several popular AI applications through its standardized protocol:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
The following matrix illustrates the integration status of different AI applications with the MCP Weather Server:
AI Application | Resource Management | Tool Integration | Prompt Generation | Integration Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
To ensure secure and efficient operation, configuration adjustments are recommended based on your specific environment:
settings.json
file with appropriate API keys and environmental variables.index.js
script for any custom modifications or security settings required.{
"mcpServers": {
"weatherServer": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/build/index.js"
],
"env": {
"API_KEY": "your-api-key-goes-here"
}
}
}
}
A1: While the server is currently compatible with Claude Desktop and Continue, integration with other clients can be attempted by following similar configuration steps.
A2: The server processes requests on a per-request basis. For large-scale operations, consider implementing batch processing or background tasks to manage load efficiently.
A3: The current setup supports unencrypted communication only but can be extended to support TLS/SSL for secure transmission of sensitive information.
A4: Yes, contributions are welcome. Fork the repository and submit pull requests with your modifications or new modules.
A5: Beyond API keys, consider implementing rate limiting, logging mechanisms for auditing purposes, and ensuring that all data is properly sanitized to prevent injection attacks.
Contributions are greatly appreciated! To contribute, follow these guidelines:
git checkout -b feature-branch
.feature-branch
to the main branch.For more information about MCP, explore these resources:
By leveraging the MCP Weather Server, developers can create highly functional and integrated AI workflows that benefit from real-time weather data. This server not only enhances the capabilities of existing AI applications but also opens up new possibilities for creating innovative solutions in fields such as emergency management, travel planning, and more.
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Python MCP client for testing servers avoid message limits and customize with API key
Discover easy deployment and management of MCP servers with Glutamate platform for Windows Linux Mac
Explore community contributions to MCP including clients, servers, and projects for seamless integration
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions