Weather MCP Server
Provides current weather information for any city worldwide using the free Open-Meteo API, enabling users to query temperature, wind speed, humidity, and weather conditions through natural language.
README
Weather MCP Server
A simple Model Context Protocol (MCP) server built with TypeScript that provides weather information using the Open-Meteo API.
Features
- š¤ļø Get Weather: Fetch current weather data for any city worldwide
- š Greet: Simple greeting tool for testing
- š Uses free Open-Meteo API (no API key required)
- š Built with MCP TypeScript SDK
- š” HTTP transport support
Prerequisites
- Node.js 18+
- npm or yarn
Installation
- Install dependencies:
npm install
Usage
Development Mode
Run the server with auto-reload:
npm run dev
Production Mode
- Build the TypeScript code:
npm run build
- Start the server:
npm start
The server will start on http://localhost:3000/mcp by default. You can change the port by setting the PORT environment variable:
PORT=8080 npm run dev
Connecting to the Server
Using MCP Inspector
The easiest way to test your server:
npx @modelcontextprotocol/inspector
Then connect to: http://localhost:3000/mcp
Using Claude Code
claude mcp add --transport http weather-server http://localhost:3000/mcp
Using VS Code
code --add-mcp "{\"name\":\"weather-server\",\"type\":\"http\",\"url\":\"http://localhost:3000/mcp\"}"
Using Cursor
Click this deeplink
Available Tools
1. get-weather
Get current weather information for any city.
Input:
{
"city": "Sydney"
}
Output:
{
"city": "Sydney, Australia",
"temperature": 22.5,
"weatherCode": 0,
"windSpeed": 15.2,
"humidity": 65,
"description": "Clear sky"
}
Example queries:
- "What's the weather in Tokyo?"
- "Get me the current temperature in London"
- "How's the weather in New York?"
2. greet
Simple greeting tool for testing the server.
Input:
{
"name": "Alice"
}
Output:
{
"greeting": "Hello, Alice! Welcome to the Weather MCP Server!"
}
API Information
This server uses the free Open-Meteo API which provides:
- Current weather conditions
- No API key required
- Global coverage
- Reliable geocoding
Project Structure
weather-mcp-server/
āāā src/
ā āāā index.ts # Main server implementation
āāā dist/ # Compiled JavaScript (generated)
āāā package.json # Dependencies and scripts
āāā tsconfig.json # TypeScript configuration
āāā README.md # This file
Development
The server is built using:
- @modelcontextprotocol/sdk: MCP TypeScript SDK
- Express: HTTP server
- Zod: Schema validation
- TypeScript: Type safety
Health Check
The server includes a health check endpoint:
curl http://localhost:3000/health
Response:
{
"status": "ok",
"server": "weather-mcp-server",
"version": "1.0.0"
}
Troubleshooting
Port already in use
If port 3000 is already in use, specify a different port:
PORT=8080 npm run dev
City not found
Make sure you're using the correct city name. The API uses geocoding to find cities, so try:
- Full city names: "New York" instead of "NYC"
- Including country if ambiguous: "London, UK" or "London, Ontario"
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.