
mcp weather server
A Model Context Protocol server that fetches weather data for a location
Repository Info
About This Server
A Model Context Protocol server that fetches weather data for a location
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Weather Server
A Model Context Protocol (MCP) server that fetches weather data for a location. This server provides weather information through a standardized MCP interface.
Setup
-
Clone the repository:
git clone https://github.com/selmernoid/mcp-weather-server.git cd mcp-weather-server -
Install dependencies:
npm install -
Create a
.envfile based on the.env.examplefile:cp .env.example .env -
Get an API key from OpenWeatherMap and add it to your
.envfile:WEATHER_API_KEY=your_api_key_here -
Start the server:
npm start
API Usage
The server implements the Model Context Protocol (MCP) pattern, allowing for standardized interactions.
Endpoint
POST /mcp
Request Format
{
"type": "weather",
"arguments": {
"location": "London,UK"
}
}
Response Format
{
"type": "weather",
"data": {
"location": {
"name": "London",
"country": "GB",
"coordinates": {
"lat": 51.5074,
"lon": -0.1278
}
},
"weather": {
"description": "scattered clouds",
"temperature": {
"current": 18.5,
"feels_like": 17.9,
"min": 16.8,
"max": 20.2
},
"humidity": 65,
"wind": {
"speed": 4.12,
"direction": 240
},
"clouds": 40,
"timestamp": 1684150800
}
}
}
Error Handling
Errors are returned with appropriate HTTP status codes and an error message:
{
"error": "Error message here"
}
Example Usage with cURL
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"type": "weather",
"arguments": {
"location": "New York,US"
}
}'
MCP Integration with AI Systems
This server is designed to work with AI systems that implement the Model Context Protocol. When integrated, the AI can request weather data for a specific location, which can be used to enhance responses about weather conditions, travel planning, and more.
License
MIT
Quick Start
Clone the repository
git clone https://github.com/selmernoid/mcp-weather-serverInstall dependencies
cd mcp-weather-server
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.