Ansh642/MCP-Server
3.1
If you are the rightful owner of MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Weather Data Fetcher is a tool designed to provide real-time weather updates using the Model Context Protocol (MCP) and OpenWeatherMap API.
Tools
1
Resources
0
Prompts
0
š¤ļø MCP Weather Data Fetcher
A simple yet powerful weather-fetching tool built using the Model Context Protocol (MCP). This service allows AI agents to retrieve live weather updates for any city via OpenWeatherMap, wrapped in an agent-friendly format using MCP standards.
š Features
- Real-time weather data via OpenWeatherMap API
- MCP-compatible tool (
getWeatherData
) - Returns structured details: temperature, humidity, wind speed, and description
- Agent-friendly response formatting
- CLI-compatible using Stdio transport
š Tech Stack
- Node.js
- MCP SDK (
@modelcontextprotocol/sdk
) - OpenWeatherMap API
- zod (for input validation)
- dotenv
š¦ Setup
- Clone the repo & install dependencies:
git clone https://github.com/Ansh642/MCP-Server.git
cd mcp-weather-fetcher
npm install
- Create a
.env
file with your OpenWeatherMap API key:
OPENWEATHER_API_KEY=your_api_key_here
- Run the MCP server:
node index.js
- (Optional) Define the server in
mcp.json
:
{
"mcpServers": {
"weatherData": {
"command": "node",
"args": ["C:/Users/91995/Desktop/mcpServer/index.js"]
}
}
}
š¬ Example Interaction
>> Call tool: getWeatherData with { "city": "Delhi" }
ā
Weather Report for Delhi:
- Temperature: 34.9°C
- Feels Like: 37.1°C
- Humidity: 45%
- Weather: Clear
- Description: clear sky
- Wind Speed: 3.6 m/s
š¤ Author
Ansh Agarwal š§ anshagarwal642@gmail.com š GitHub | LinkedIn