MCP Weather Server
by mohaimenhasan
A simple Model Context Protocol (MCP) server providing weather data via an Express API. It allows users to retrieve weather information for specific cities.
Last updated: N/A
What is MCP Weather Server?
The MCP Weather Server is a Node.js application that serves weather data through an Express API, adhering to the Model Context Protocol (MCP). It fetches weather information from a third-party weather API (OpenWeatherMap) based on user-provided city names.
How to use MCP Weather Server?
- Clone the repository. 2. Install dependencies using
npm install
. 3. Add your OpenWeatherMap API key inindex.ts
. 4. Build the project usingnpm run build
. 5. Integrate with VS Code by adding a MCP server configuration in VSCode's settings. 6. Use theGET /weather?location={city}
endpoint to retrieve weather data.
Key features of MCP Weather Server
Provides weather data for specified cities
Uses Express API
Adheres to Model Context Protocol (MCP)
Easy integration with VS Code
Uses OpenWeatherMap API
Use cases of MCP Weather Server
Integrating weather data into VS Code extensions
Providing weather information to other applications
Building weather-aware tools
Learning about MCP server development
Quickly checking weather conditions for different locations
FAQ from MCP Weather Server
How do I get an OpenWeatherMap API key?
How do I get an OpenWeatherMap API key?
You can sign up for a free API key on the OpenWeatherMap website.
What is the MCP?
What is the MCP?
MCP stands for Model Context Protocol. It is a protocol used for communication between different parts of a system, in this case, between VS Code and the weather server.
What Node.js version is required?
What Node.js version is required?
Node.js version 18 or higher is required.
How do I deploy this server?
How do I deploy this server?
You can deploy this server to any platform that supports Node.js, such as Heroku, AWS, or Google Cloud.
Can I use a different weather API?
Can I use a different weather API?
Yes, you can modify the code to use a different weather API. You will need to update the API endpoint and data parsing logic accordingly.