Modular FastAPI weather server with Docker support for live weather data from OpenWeatherMap
The Weather MCP Server is a modular, FastAPI-based service that seamlessly integrates live weather data from OpenWeatherMap into AI workflows and applications through Model Context Protocol (MCP). This server serves as an essential component in building robust AI environments by providing consistent access to external data sources. The core integration value of the Weather MCP Server lies in its ability to work with various AI applications, ensuring seamless connectivity with different tools while maintaining backward compatibility across multiple platforms.
TheWeather MCP Server is designed to support a wide range of functionalities and integrate seamlessly into diverse AI ecosystems through Model Context Protocol (MCP). Key features include:
Live Weather Integration: Utilizes the OpenWeatherMap API to fetch up-to-date weather data, ensuring that developers can access real-time environmental information.
Docker Support for Deployment: The server is Dockerized, making it easy for users to containerize and deploy the application locally or on cloud services.
Optional Cloud Deployment: Supports deployment on platforms like Render, Heroku, providing flexibility in choosing the right environment based on specific requirements.
MCP (Model Context Protocol) serves as a universal adapter that allows AI applications such as Claude Desktop, Continue, Cursor, and more to connect with external data sources and tools through standard communication protocols. The Weather MCP Server's implementation of MCP ensures compatibility across these clients by adhering to the established protocol for seamless integration.
The architecture of the Weather MCP Server places emphasis on modularity and scalability, allowing developers to easily extend its functionality as needed. Key architectural elements include:
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
Imagine a scenario where an AI application needs to provide real-time weather forecasts for users. By integrating the Weather MCP Server, developers can easily fetch current and historical weather data from OpenWeatherMap and present it within their applications, enhancing user experience.
graph TD
A[OpenWeather API] -->|Requests| B[MCP Server]
B --> C[Data Cache]
C --> D[AI Application]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
To get started, follow these steps:
Create Environment Variables: Create a .env
file and specify your OpenWeatherMap API key.
OPENWEATHER_API_KEY=your_api_key_here
Build the Docker Image:
docker build -t weather-mcp .
Run the Application:
docker run -p 8000:8000 weather-mcp-server
Access Weather Data: Use a browser or API client to access the live weather data.
http://localhost:8000/weather?city=Tokyo
Personalized Notifications and Alerts: Implement custom notifications for users based on real-time weather conditions (e.g., extreme temperature alerts, storm warnings).
Enhanced Smart Home Devices: Integrate the Weather MCP Server with smart home devices to provide context-aware functionalities (e.g., adjusting HVAC settings based on external temperature).
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
The Weather MCP Server is fully compatible with Claude Desktop, Continue, and Cursor, offering real-time weather data to enhance the functionality of these applications. However, it does not support prompt-based interactions for Cursor.
The performance and compatibility matrix illustrates the Weather MCP Server's capabilities:
Feature | Status |
---|---|
Real-time Data Fetching | ✅ |
Cross-platform Support | ✅ |
{
"mcpServers": {
"weather-server": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-weather"],
"env": {
"API_KEY": "your-api_key_here"
}
}
}
}
Can the Weather MCP Server be deployed using Render or Heroku?
/docs
directory.Is the Weather data always accurate?
How frequently is the weather data updated?
What if I need additional tools besides OpenWeatherMap?
What about integrating with other AI applications beyond those listed in the matrix?
Contributions to this project are welcome. To contribute:
For more information on the Model Context Protocol (MCP) and related resources, visit:
The Weather MCP Server is a powerful tool for developers building AI applications that require real-time weather data integration. By leveraging its modular design and adherence to the Model Context Protocol (MCP), this server enhances the capabilities of various AI tools, providing robust and flexible solutions for a wide range of use cases.
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Build a local personal knowledge base with Markdown files for seamless AI conversations and organized information.
Integrate AI with GitHub using MCP Server for profiles repos and issue creation
Python MCP client for testing servers avoid message limits and customize with API key
Explore MCP servers for weather data and DigitalOcean management with easy setup and API tools