MCP Weather Server
@mohaimenhasan
Overview
What is MCP Weather Server?
MCP Weather Server is a simple Model Context Protocol (MCP) server that provides current weather data via an Express API. It integrates with OpenWeatherMap and is designed for developers who want to query weather information through MCP-compatible clients like VS Code.
How to use MCP Weather Server?
Clone the repository, run npm install, add an OpenWeatherMap API key in index.ts line 6, then build with npm run build. To use it in VS Code, add the server as a stdio MCP server with the command node and the argument pointing to the compiled dist/index.js. Once configured, you can ask questions about any city’s weather.
Key features of MCP Weather Server
- Provides current weather data via a single API endpoint.
- Uses the Model Context Protocol for AI tool integration.
- Built on Express, making it lightweight and easy to run.
- Configured as a stdio MCP server for use with VS Code.
- Pulls weather data from OpenWeatherMap (API key required).
Use cases of MCP Weather Server
- Ask an AI assistant in VS Code about the current weather in a city.
- Integrate weather queries into custom MCP-based tools or agents.
- Test or demo MCP server functionality with a real data source.
- Quickly prototype a weather-aware chatbot or coding assistant.
FAQ from MCP Weather Server
What weather data does MCP Weather Server provide?
It returns current weather data for a specified city via the GET /weather?location={city} endpoint.
How do I get an API key for OpenWeatherMap?
You can obtain an API key from openweathermap.org. The README also suggests contacting the author (@mohaimenhasan) if you need one.
How do I integrate the server with VS Code?
Build the project (npm run build), then add a new MCP server in VS Code’s settings with "type": "stdio", "command": "node", and "args" pointing to the full path of dist/index.js.
What runtime dependencies does MCP Weather Server require?
It requires Node.js (version 18 or higher) and npm (version 9 or higher). The only external dependency is the OpenWeatherMap API.
Is the server limited to a single transport type?
The README only describes stdio transport for VS Code integration. The Express API is also available via HTTP at the default port, but no configuration details are provided for that.