meto_weather_mcp_server

abhinav2525/meto_weather_mcp_server

3.1

If you are the rightful owner of meto_weather_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 dayong@mcphub.com.

The Weather MCP Server provides real-time weather information for cities worldwide, integrating seamlessly with AI assistants and IDEs.

Tools
1
Resources
0
Prompts
0

Weather MCP Server

A Model Context Protocol (MCP) server that provides real-time weather information for any city worldwide. This server integrates with AI assistants and IDEs to fetch live weather data through simple tool calls.

Features

  • Real-time weather data using Open-Meteo APIs
  • Global city support with geocoding lookup
  • Comprehensive weather info including temperature, humidity, precipitation
  • MCP protocol compliance for seamless AI integration
  • Error handling for invalid city names

Data Sources

This server fetches data from Open-Meteo, a free weather API service:

  • Geocoding API: https://geocoding-api.open-meteo.com/v1/search - Converts city names to coordinates
  • Weather API: https://api.open-meteo.com/v1/forecast - Provides current and hourly weather data
  • No API key required - Open-Meteo is completely free to use
  • High reliability with global coverage

Installation

  1. Clone or download this repository
  2. Install dependencies:
    npm install
    

Usage

Running the Server Standalone

npx tsx main.ts

The server will start and listen for MCP protocol messages via stdin/stdout.

Testing with MCP Inspector

To test the server interactively in a web browser:

npx @modelcontextprotocol/inspector npx -y tsx main.ts

This will:

  1. Start a proxy server (usually on port 6277)
  2. Provide a session token
  3. Open a web interface where you can test the get-weather tool

Integration with IDEs

Cursor IDE

Create a .cursor/mcp.json file in your project root:

{
  "mcpServers": {
    "weather-server": {
      "command": "npx",
      "args": [
        "-y", 
        "tsx", 
        "/absolute/path/to/your/main.ts"
      ]
    }
  }
}

Replace /absolute/path/to/your/main.ts with the full path to your main.ts file.

VS Code (with MCP extension)

Install an MCP-compatible extension and configure it to use:

  • Command: npx
  • Args: ["-y", "tsx", "/absolute/path/to/your/main.ts"]
Other MCP Clients

Any MCP-compatible client can connect to this server using stdio transport. Configure your client to run:

npx -y tsx /path/to/main.ts

Available Tools

get-weather

Fetches current weather information for a specified city.

Parameters:

  • city (string): Name of the city to get weather for

Example usage:

Tool: get-weather
Input: { "city": "London" }

Response includes:

  • Current temperature and humidity
  • Precipitation data
  • Hourly forecasts
  • Weather conditions

Development

Project Structure

  • main.ts - Main MCP server implementation
  • package.json - Dependencies and project config
  • .cursor/mcp.json - Cursor IDE integration config

Requirements

  • Node.js 18+
  • TypeScript support (via tsx)

Making Changes

  1. Edit main.ts to modify server behavior
  2. Restart your MCP client to pick up changes
  3. Test changes using the MCP inspector

Troubleshooting

"Top-level await not supported"

This project uses ES modules ("type": "module"). The async code is properly wrapped in a main() function.

"Connection Error" in MCP Inspector

  • Ensure no other process is using the proxy port
  • Check that the server starts without TypeScript errors
  • Verify the session token is correct

City Not Found

The server handles unknown cities gracefully and returns a helpful error message. Make sure to use common city names or try alternative spellings.

License

MIT License - Feel free to use and modify as needed.