weather-mcp-server

marekdano/weather-mcp-server

3.2

If you are the rightful owner of 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.

This document provides a structured overview of a simple MCP server designed for weather data.

weather-mcp-server

This is my first MCP server where I can get the current weather in each city.

How to use it (videos)

Locally

In ChatGPT chat

Quick overview

  • Entry source: src/server.ts
  • Build output: dist/server.js (TypeScript -> tsc)
  • App port (expected): 3000

Local (npm) commands

Install dependencies:

npm install

Build the project:

npm run build

Start the server (builds first):

npm run start

Run in development mode (no build step, uses tsx):

npm run dev

Project provides an MCP inspector to test the Weather MCP server. Run the MCP inspector:

npm run inspector

Environment

  • Put environment variable WEATHER_API_KEY in a .env file (this repo's .gitignore already ignores .env). The WEATHER_API_KEY is a API key of openweathermap service that it's used in this MCP server.

Docker

  • Build the image:
docker build -t weather-mcp-server .
  • Run MCP server locally with docker:
docker run --rm --env-file .env -p 3000:3000 weather-mcp-server

Deployment

This weather-mcp-server is deployed on https://render.com/ and can be found at https://weather-mcp-server-dc6e.onrender.com/mcp If you want to play with it, you can add it to ChatGPT at the Connectors settings. Please take a look at the videos above.

Troubleshooting

  • Make sure that node.js 18+ is used when npm run inspector runs.