Get the FREE Ultimate OpenClaw Setup Guide →

mcp-weather -demo

A simple Model Context Protocol (MCP) server that provides real-time weather data to AI agents like GitHub Copilot

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio debs-obrien-mcp-weather-server-demo npx -y @modelcontextprotocol/inspector tsx main.ts \
  --env PORT="4000" \
  --env MCPC_USE_STDIO="true"

How to use

This MCP server provides a get-weather tool that lets AI agents request real-time weather data for a specified city by leveraging the Open-Meteo API. The server processes a city name, geocodes it to coordinates, queries Open-Meteo for current weather information, and returns a structured response that agents can format and present in chat or UI contexts. It is designed to work with MCP-compatible tools like GitHub Copilot or Claude Sonnet, enabling natural language prompts such as asking for the current weather in a city and receiving a concise, structured weather report.

To use the server, run it locally and interact with it through the MCP Inspector or via an MCP-enabled chat interface. The server exposes the get-weather tool, which you can call with a city name. For testing, you can start the server in inspector mode and feed requests through the console or an integration that supports MCP tools. When you query weather data, you’ll get details like temperature, wind, precipitation, and conditions, formatted for easy consumption by the AI agent and end-user in chat or document contexts.

How to install

Prerequisites:

  • Node.js and npm installed on your machine
  • Git installed
  • Internet access to install dependencies

Step-by-step:

  1. Clone the repository: git clone https://github.com/debs-obrien/mcp-weather-server-demo.git cd mcp-weather-server-demo

  2. Install dependencies: npm install

  3. Run the server in inspector/test mode (as shown in the README): npx -y @modelcontextprotocol/inspector npx -y tsx main.ts

  4. (Optional) If you want to run directly without inspector, install dependencies locally and start the server script (adjust path as needed): npm install npx tsx main.ts

  5. Verify operation by using the MCP Inspector or your preferred MCP-enabled client to call the get-weather tool with a city name.

Additional notes

Notes and tips:

  • The server uses Open-Meteo for weather data, which does not require an API key. If you encounter rate limits, consider implementing caching or staggering requests.
  • Ensure your environment has network access to reach Open-Meteo endpoints.
  • The provided mcp_config uses an inspector-based startup; you can adapt the command to your preferred runtime if you run in a different environment.
  • If the server format or tool name changes, update the mcp.json and tool definitions accordingly to keep your MCP tooling in sync.
  • Common troubleshooting: ensure dependencies are installed (npm install), and verify that the TypeScript runtime (tsx) is available in your environment if you modify the start command.

Related MCP Servers

Sponsor this space

Reach thousands of developers