Simple MCP weather server API for real-time weather data integration with Node.js and Express
MCP Weather Server is a specialized Model Context Protocol (MCP) server designed to provide real-time weather data via an Express API, seamlessly integrating with various AI applications through the standardized Model Context Protocol. This server serves as a bridge between AI tools and external weather APIs, enabling developers to leverage accurate and up-to-date weather information in their applications.
MCP Weather Server enhances AI application capabilities by offering robust weather data access through MCP. Key features include:
This server supports multiple MCP clients, ensuring compatibility across different AI ecosystems. The following diagram illustrates the flow of an MCP protocol interaction:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[OpenWeatherMap API]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
The architecture of MCP Weather Server is built around the Model Context Protocol, ensuring seamless integration with various AI clients. Key implementation details include:
Imagine a scenario where an AI assistant needs to provide users with weather forecasts based on their location. With MCP Weather Server, this integration can be effortlessly achieved:
AI Application Sends Request:
MCP Server Processes Request:
User Receives Response:
Similar use cases exist for various applications such as smart home systems or travel planning tools where real-time weather updates are crucial.
Installing the MCP Weather Server is straightforward. Follow these steps to get it up and running:
Clone the Repository:
git clone https://github.com/mohaimenhasan/mcp-weather-server.git
cd mcp-weather-server
Install Dependencies:
npm install
Build TypeScript Sources:
npm run build
Integrate with VS Code (Optional):
launch.json
as follows:
"weather-mcp":
{
"type": "stdio",
"command": "node",
"args": [
"C:\\<PATH_TO_YOUR_REPO>\\mcp-weather-server\\dist\\index.js"
]
}
This MCP server enhances existing AI workflows by providing weather data, which can be integrated into various applications. Here are two practical use cases:
Imagine a smart home system that needs to adjust its climate settings based on the current outdoor temperature and humidity levels.
AI Application Sends Request:
MCP Server Fetches Data:
Data Processed & Sent Back:
A travel planning tool that needs to provide users with weather updates for their destination city before booking flights or hotels.
Request Weather Data:
Retrieve & Display Info:
User Receives Information:
MCP Weather Server supports integration with multiple AI clients, including:
The following table outlines the current status of support for different MCP clients:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
The performance of MCP Weather Server is optimized for fast and reliable data retrieval. It ensures compatibility with multiple clients by adhering to the Model Context Protocol standards.
graph TD
A[Performance] --> B[Fast Data Retrieval]
C[Compatibility] --> D[MCP Clients]
E[Fully Compatible]
B --> E
D --> E
style B fill:#b5e4a2
style C fill:#d3d9bb
style E fill:#66ccff
Configuring MCP Weather Server involves setting up environment variables and ensuring secure API key management.
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
export API_KEY=YOUR_API_KEY_FROM_OPENWEATHERMAP
Address common challenges and questions related to MCP weather server integration:
How do I integrate this with my AI application?
Can this server be used with any weather API?
What are the performance considerations?
How do I handle API key security?
Are there any limits on request frequency?
Contributing to MCP Weather Server involves setting up your development environment and understanding the project structure:
Set Up a Development Environment:
git clone https://github.com/mohaimenhasan/mcp-weather-server.git
cd mcp-weather-server
npm install
Run Dev Server:
npm run dev
File Issues and Pull Requests:
Explore more about the Model Context Protocol and its ecosystem:
This technical documentation positions MCP Weather Server as a valuable tool in integrating real-time weather data into various AI applications, ensuring compatibility, performance, and security.
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
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions
Analyze search intent with MCP API for SEO insights and keyword categorization
AI Vision MCP Server offers AI-powered visual analysis, screenshots, and report generation for MCP-compatible AI assistants