weather-mcp-server-js
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
š¤ļø Weather MCP Server (Node.js)
A remote MCP (Model Context Protocol) server built on Node.js / Express.
It exposes the get_weather tool via Streamable HTTP transport, letting MCP clients such as Claude Code query the current weather of any city in real time.
Weather data comes from wttr.in ā free, no registration, no API key required.
⨠Features
š°ļø Remote MCP service: Implements Streamable HTTP transport based on the official
@modelcontextprotocol/sdk, supporting both JSON and SSE response modesš Global city support: Pass a city name directly (e.g.
Beijing,Tokyo,Paris) to look up local weatherš Full session management: Automatically generates/validates
Mcp-Session-Id, supporting session creation, reuse, and termination (DELETE)š§© Single-file ready to use: No database, zero configuration files, just one
server.jsto get started
Related MCP server: MCP Weather Server ā Demo
š¦ Requirements
Node.js ā„ 18 (built-in
fetch, no extra dependencies)
š Quick Start
# 1. å®č£
ä¾čµ
npm install
# 2. åÆåØęå”(é»č®¤ē«Æå£ 3000)
npm start
# åå°čæč”(ę„åæåå
„ logs/server.log)
npm run start:bgOnce started successfully, the service address is:
http://localhost:3000/mcpCommon scripts
Command | Description |
| Start the service in the foreground |
| Start in the background, logs written to |
| Development mode, auto-restart on file changes |
| Check whether the service on port 3000 is running |
| View logs in real time |
| Stop the service |
| Restart the service |
| Restart in the background |
š Configuring an MCP client
In Claude Code or another MCP client that supports Streamable HTTP, register the service as a remote MCP server.
Claude Code
Add it via the MCP server list (/mcp ā Add ā HTTP):
{
"type": "http",
"url": "http://localhost:3000/mcp"
}JSON configuration file method
{
"mcpServers": {
"weather": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}š§° Provided tools
get_weather
Get the current weather for a specified city.
Parameters
Parameter | Type | Required | Description |
| string | ā | City name, e.g. |
Example response
å½å Beijing ē天ę°ęÆę“(Sunny),ęø©åŗ¦ 28°C(ä½ę 30°C),湿度 45%,é£é 12 km/hćāļø Implementation notes
Session isolation: Each session holds its own
Server+transportinstance (the SDK'sconnect()only supports one transport), associated via theMcp-Session-Idrequest header.New session flow: A POST without
Mcp-Session-Idis treated as an initialization request; the server generates a session ID and returns it via theMcp-Session-Idresponse header (explicitly exposed to browser clients via CORSexposedHeaders).Compatibility handling: A GET SSE probe request without a session ID keeps an open SSE stream open (instead of returning 404/400), so clients like Claude Code can continue with the POST initialization flow.
Reliable error responses: When the weather API call fails, it returns a result with
isError: trueinstead of crashing the entire request.
šļø Project structure
.
āāā server.js # å
ØéØęå”é»č¾(åęä»¶)
āāā package.json # 锹ē®é
ē½®äøčę¬
āāā logs/ # čæč”ę¶ę„åæ(已被 .gitignore åæ½ē„)
āāā LICENSE # MIT 许åÆčÆš License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
Get daily weather forecasts for any place on Earth via a hosted read-only MCP server.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Related MCP Servers
- AlicenseBqualityDmaintenanceA simple MCP server that provides a tool to fetch current weather information for cities using the Open-Meteo API, communicating through stdin/stdout.12ISC
- AlicenseNot gradedqualityDmaintenanceDemo MCP server that provides weather data for cities, with tools to get weather and list available cities.2MIT
- AlicenseAqualityDmaintenanceMCP server that provides current weather for any city using Open-Meteo APIs. It exposes a single tool 'get_weather' returning temperature, humidity, wind, and other weather data.19 npmMIT
- AlicenseAqualityDmaintenanceA simple MCP server that exposes a get_weather tool to fetch real-time weather for any GPS coordinates using the Open-Meteo API, no API key required.1ISC