Skip to main content
Glama

Weather MCP Server

by alesanabv

Weather MCP Server

A Model Context Protocol (MCP) server that provides weather information.

Installation

pnpm install

Usage

Start the Server

pnpm start

Run Tests

pnpm test

Using with MCP Inspector

To test your server with the MCP Inspector:

  1. Install the Inspector (if not already installed):

npx @modelcontextprotocol/inspector
  1. Configure the connection:

    • Command: npx

    • Args: tsx main.ts

    • Or use the full command: npx tsx /path/to/mcpWeather/main.ts

  2. Test the tool:

    • Select the fetch-Weather tool

    • Enter 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:

{ "city": "Bogotá" }

Response:

{ "content": [ { "type": "text", "text": "The weather in Bogotá is sunny" } ] }

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.0

  • Zod: v3.23.8 (for parameter validation)

  • TSX: v4 (for running TypeScript)

Deploy Server
-
security - not tested
F
license - not found
-
quality - not tested

Enables users to retrieve current weather information for any city location. Provides a simple interface to fetch weather data through natural language queries.

  1. Installation
    1. Usage
      1. Start the Server
      2. Run Tests
      3. Using with MCP Inspector
    2. Tools
      1. fetch-Weather
    3. Important Notes
      1. Development

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/alesanabv/mcpWeather'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server