weather-mcp

weather-mcp
TypeScript-MCP-Server, der Wetter-Tools bereitstellt, die auf OpenWeatherMap basieren.
Tools
Tool | Beschreibung |
| Aktuelle Bedingungen nach Stadtname oder lat/lon |
| 5-Tage-/3-Stunden-Vorhersage nach lat/lon |
Transporte
Modus | Env | Verwendung |
|
| Lokaler Cursor / Claude Desktop |
Streamable HTTP |
| Deployment (Render usw.) / Remote-URL |
Offizielle MCP-Dokumentation: https://modelcontextprotocol.io/docs/
Live-Remote (Render)
Bereitgestellt im kostenlosen Tarif von Render:
Basis-URL | |
MCP-Endpunkt | |
Health-Check |
Cursor-Konfiguration (Remote)
Füge dies zu Einstellungen → MCP oder ~/.cursor/mcp.json hinzu:
{
"mcpServers": {
"weather": {
"url": "https://weather-mcp-ts.onrender.com/mcp"
}
}
}Kein lokaler Build oder API-Schlüssel in Cursor — der Schlüssel liegt in Renders Umgebungsvariablen.
Renders kostenloser Tarif: Der Dienst wird nach ~15 Minuten Inaktivität heruntergefahren. Die nächste Anfrage ist ein Kaltstart und kann bis zu ~50 Sekunden dauern, bevor MCP antwortet. Rufe
/healtheinmal auf, wenn Cursor-Tools beim Aufwachen festzuhängen scheinen.
Related MCP server: mcp-weatherapi
Voraussetzungen (nur lokal)
Node.js 20+
pnpm (oder npm/yarn)
Einen OpenWeatherMap-API-Schlüssel (hier erhalten)
Einrichtung (lokal)
pnpm install
cp .env.example .envBearbeite .env und setze deinen Schlüssel:
OPEN_WEATHER_MAP_API_KEY=your_key_here
TRANSPORT=stdioBaue den Server:
pnpm run buildDies schreibt den ausführbaren Einstiegspunkt nach dist/index.js.
Zu Cursor hinzufügen (lokales stdio)
Cursor startet diesen Prozess standardmäßig nicht aus dem Projektstammverzeichnis, um Umgebungsvariablen zu laden. Übergib die Env-Datei daher mit einem absoluten Pfad über das --env-file-Flag von Node.js.
Öffne Cursor-Einstellungen → MCP oder bearbeite
~/.cursor/mcp.json.Füge einen
weather-Eintrag untermcpServershinzu:
{
"mcpServers": {
"weather": {
"command": "node",
"args": [
"--env-file",
"/ABSOLUTE/PATH/TO/weather-mcp/.env",
"/ABSOLUTE/PATH/TO/weather-mcp/dist/index.js"
]
}
}
}Ersetze /ABSOLUTE/PATH/TO/weather-mcp durch deinen tatsächlichen Projektpfad (z. B. führe pwd im Repository-Stammverzeichnis aus). Behalte TRANSPORT=stdio in .env bei (oder lasse es ungesetzt).
Alternative: Env-Inline
{
"mcpServers": {
"weather": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/weather-mcp/dist/index.js"
],
"env": {
"OPEN_WEATHER_MAP_API_KEY": "your_key_here",
"TRANSPORT": "stdio"
}
}
}
}Bevorzuge .env + --env-file, damit der Schlüssel nicht in mcp.json landet.
Speichere und schalte den Server dann in Einstellungen → MCP aus/an (oder starte Cursor neu).
Bestätige, dass der Server als verbunden angezeigt wird und
get_current_weatherundget_forecastauflistet.
Nach Codeänderungen
pnpm run buildLade dann den MCP-Server in Cursor neu.
Streamable HTTP (lokal)
Der HTTP-Modus stellt MCP unter POST/GET /mcp (konfigurierbar) sowie GET /health bereit. Streamable HTTP wird über createMcpHandler + toNodeHandler des offiziellen SDK konfiguriert.
pnpm run build
TRANSPORT=http PORT=3000 pnpm run start
# or
pnpm run start:httpDu solltest in etwa Folgendes sehen:
Weather MCP Server running on http://0.0.0.0:3000/mcp (Streamable HTTP)Auf Render bereitstellen
Erstelle einen Web Service aus diesem Repository (Projektstammverzeichnis).
Build:
pnpm install && pnpm run build(oder dasnpm-Äquivalent).Start:
node dist/index.js(oderpnpm run start).Umgebungsvariablen:
TRANSPORT=httpOPEN_WEATHER_MAP_API_KEY=...PORTwird von Render automatisch gesetzt.
MCP-URL:
https://<your-service>.onrender.com/mcp
Dieses Deployment:https://weather-mcp-ts.onrender.com/mcp
Der HTTP-Endpunkt ist nicht authentifiziert. Jeder mit der URL kann die Tools aufrufen. Füge eine Authentifizierung hinzu, bevor du ihn weit verbreitest.
Manueller Smoke-Check (OpenWeatherMap)
Mit gesetzter .env:
node --env-file=.env -e "
import { getApiKey, buildCurrentWeatherUrl, makeOWMRequest, formatCurrentWeather } from './dist/utils.js';
const apiKey = getApiKey();
const data = await makeOWMRequest(buildCurrentWeatherUrl({ apiKey, city: 'Yaounde,CM', units: 'metric' }));
console.log(data ? formatCurrentWeather(data, 'metric') : 'failed');
"Remote-Health:
curl -s https://weather-mcp-ts.onrender.com/healthRepo-Struktur
weather-mcp/
├── README.md
├── package.json
├── tsconfig.json
├── .env.example
└── src/
├── index.ts # stdio + Streamable HTTP entry
├── server.ts # tool registration
├── types.ts
└── utils.tsHinweise
Commite niemals
.env(es ist gitignored).Stdio-Server dürfen außer MCP-JSON-RPC nichts auf stdout schreiben; Logs gehen nach stderr (
console.error).Kostenlose OpenWeatherMap-Tarife decken das aktuelle Wetter und die hier verwendete 5-Tage-/3-Stunden-Vorhersage ab.
Lizenz
ISC
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceWraps the OpenWeatherMap API to provide weather data through MCP, enabling AI agents to query current conditions, forecasts, and other weather information via natural language.10MIT
- AlicenseNot gradedqualityCmaintenanceProvides weather data from WeatherAPI.com through MCP, enabling AI agents to query current conditions and forecasts via natural language.11MIT
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients like Kiro and Claude to access current weather conditions and forecasts for any location using the OpenWeatherMap API.
- AlicenseNot gradedqualityDmaintenanceIntegrates OpenWeatherMap API with MCP to provide weather data, forecasts, air quality, maps, alerts, and geocoding via natural language.10MIT
Related MCP Connectors
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
WeatherAPI.com MCP — wraps WeatherAPI.com (api.weatherapi.com)
Visual Crossing Weather MCP — wraps the Visual Crossing Weather Timeline API
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/RashJrEdmund/Weather-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server