Weather MCP Server
A Model Context Protocol (MCP) server that provides weather information.
Installation
Usage
Start the Server
Run Tests
Using with MCP Inspector
To test your server with the MCP Inspector:
Install the Inspector (if not already installed):
Configure the connection:
Command:
npx
Args:
tsx main.ts
Or use the full command:
npx tsx /path/to/mcpWeather/main.ts
Test the tool:
Select the
fetch-Weather
toolEnter a city name (e.g., "Bogotá")
Call the tool
Tools
fetch-Weather
Get the weather for a given location.
Parameters:
city
(string, required): City name like 'Bogotá'
Example:
Response:
Important Notes
⚠️ Zod Version: This project uses Zod v3.23.8 to match the MCP SDK requirements. Do not upgrade to Zod v4 as it will cause parameter registration issues.
Development
The server uses:
MCP SDK:
@modelcontextprotocol/sdk
v1.20.0Zod: v3.23.8 (for parameter validation)
TSX: v4 (for running TypeScript)
Tools
Enables users to retrieve current weather information for any city location. Provides a simple interface to fetch weather data through natural language queries.