Weather MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Weather MCP Server what's the weather in Istanbul on 2025-08-29?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🌤️ Weather MCP Server
Model Context Protocol (MCP) kullanarak hava durumu verilerini LLM istemcilerine sunan kapsamlı bir sistem. Hem standalone MCP server hem de akıllı LLM client içerir.
📋 İçindekiler
Related MCP server: Local Weather MCP Server
✨ Özellikler
🔧 MCP Server
get_weather_by_date- Belirli şehir ve tarih için hava durumuhealth_check- Sunucu sağlık kontrolüStdio Transport - Cursor, Claude Code vb. ile uyumlu
Open-Meteo Integration - Gerçek zamanlı hava durumu verisi
🤖 LLM Client
Doğal Dil Desteği - Türkçe soru-cevap
OpenRouter Integration - gpt-oss-20b:free (ücretsiz)
Akıllı Tool Seçimi - Otomatik MCP tool discovery
Interactive CLI - Kullanıcı dostu arayüz
🌍 Weather API
Geocoding - Şehir isimlerini koordinatlara çevirme
Daily Forecast - Günlük hava durumu tahmini
Multi-language - Türkçe dil desteği
Free Tier - Tamamen ücretsiz API
🚀 Hızlı Başlangıç
Gereksinimler
Node.js 18.18.0+
npm veya yarn
OpenRouter API Key (ücretsiz)
1. Repository'yi Klonlayın
git clone https://github.com/canergulsoy/mcp-weather-server.git
cd mcp-weather-server2. Bağımlılıkları Yükleyin
npm install3. MCP Server'ı Derleyin
npm run build4. Environment Variables Ayarlayın
# .env dosyası oluşturun
cp env.example .env
# OpenRouter API key'inizi ekleyin
echo "OPENROUTER_API_KEY=your_actual_api_key" >> .env5. LLM Client'ı Çalıştırın
npm run client:dev🔑 OpenRouter API Key Alımı
OpenRouter sitesine gidin
Ücretsiz hesap oluşturun
API key alın (günlük 10M token ücretsiz)
.envdosyasına ekleyin
💡 Avantajlar:
✅ Tamamen ücretsiz (günlük 10M token)
✅ GPT-4 kalitesinde yanıtlar
✅ Hızlı response time
✅ OpenAI uyumlu API
📦 Kurulum
Development Mode
# Build olmadan çalıştırma
npm run devProduction Mode
# Derlenmiş versiyon
npm run startClient Development
# LLM Client development
npm run client:dev
# Client build
npm run client:build
# Client production
npm run client:start🎯 Kullanım
MCP Server (Standalone)
# Server'ı başlatın
node dist/index.js
# Başka bir MCP client ile bağlanın
# (Cursor, Claude Code, vb.)LLM Client (Interactive)
# Interactive CLI başlatın
npm run client:dev
# Örnek soru:
🤔 Sorunuz: 29.08.2025 tarihinde İstanbul'da hava nasıl olacak?Programmatic Usage
import { WeatherLLMClient } from './dist/client/weather-client.js';
const client = new WeatherLLMClient('./dist/index.js');
await client.initialize();
const response = await client.processQuestion(
"Yarın Berlin'de hava nasıl olacak?"
);
console.log(response);🔌 Cursor/Claude Entegrasyonu
MCP Server Konfigürasyonu
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/abs/path/to/dist/index.js"]
}
}
}Development Mode (Build olmadan)
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "tsx", "/abs/path/to/src/index.ts"]
}
}
}📚 API Dokümantasyonu
Tool: get_weather_by_date
Belirli bir şehir ve tarih için günlük hava durumu bilgisi döndürür.
Parametreler:
city(string, zorunlu): Şehir adı (örn: "İstanbul")country(string, opsiyonel): Ülke kodu (örn: "TR")date(string, zorunlu): Tarih (YYYY-MM-DD formatında)
Örnek Kullanım:
// MCP Client
const result = await mcpClient.callTool({
name: "get_weather_by_date",
arguments: {
city: "İstanbul",
country: "TR",
date: "2025-08-29"
}
});Response Format:
{
"content": [
{
"type": "text",
"text": "Şehir: İstanbul\nTarih: 2025-08-29\nEn yüksek: 28.1°C\nEn düşük: 21.6°C\nYağış toplamı: 0 mm\nKod: 2"
}
]
}Tool: health_check
Sunucunun çalışır durumda olduğunu doğrular.
Parametreler: Yok
Response:
{
"content": [
{
"type": "text",
"text": "OK"
}
]
}🏗️ Proje Yapısı
mcp-weather-server/
├── src/
│ ├── index.ts # MCP Server ana dosyası
│ ├── openmeteo.ts # Weather API entegrasyonu
│ └── client/
│ ├── index.ts # Interactive CLI
│ └── weather-client.ts # LLM Client sınıfı
├── dist/ # Derlenmiş dosyalar
├── docs/ # Dokümantasyon
├── examples/ # Kullanım örnekleri
├── tests/ # Test dosyaları
├── package.json # Proje konfigürasyonu
├── tsconfig.json # TypeScript konfigürasyonu
├── .env.example # Environment variables örneği
├── README.md # Bu dosya
└── LICENSE # MIT Lisansı🧪 Test ve Geliştirme
Test Script'leri
# Type checking
npm run typecheck
# Client test
npm run test:client
# Build test
npm run buildDevelopment Workflow
# 1. Code değişiklikleri
# 2. Type checking
npm run typecheck
# 3. Build
npm run build
# 4. Test
npm run test:client
# 5. Commit & Push
git add .
git commit -m "feat: yeni özellik eklendi"
git push origin main🔧 Environment Variables
Variable | Açıklama | Varsayılan | Zorunlu |
| OpenRouter API key | - | ✅ |
| OpenRouter API endpoint |
| ❌ |
| MCP Server dosya yolu |
| ❌ |
📊 Performance Metrikleri
Tool Discovery: ~50ms
Weather API Call: ~200-500ms
LLM Processing: ~1-3s
Total Response: ~2-4s
Memory Usage: ~50-100MB
Daily Token Limit: 10M (ücretsiz)
🚀 Gelecek Geliştirmeler
Kısa Vadeli
Caching mekanizması
Rate limiting
Daha fazla hava durumu tool'u
Batch processing
Orta Vadeli
Web interface
Database integration
User preferences
Historical data
Uzun Vadeli
Machine learning predictions
Multi-language support
Advanced analytics
Mobile app
🤝 Katkıda Bulunma
Bu projeye katkıda bulunmak istiyorsanız:
Fork yapın
Feature branch oluşturun (
git checkout -b feature/amazing-feature)Commit yapın (
git commit -m 'feat: amazing feature')Push yapın (
git push origin feature/amazing-feature)Pull Request oluşturun
Geliştirme Kuralları
TypeScript strict mode kullanın
ESLint kurallarına uyun
Test coverage'ı koruyun
Commit message'ları conventional commits formatında yazın
Kod Standartları
// ✅ Doğru
export class WeatherClient {
private readonly apiKey: string;
constructor(apiKey: string) {
this.apiKey = apiKey;
}
}
// ❌ Yanlış
export class weatherclient {
private apikey: string;
constructor(apikey: string) {
this.apikey = apikey;
}
}📄 Lisans
Bu proje MIT License altında lisanslanmıştır.
👨💻 Geliştirici
Caner Gülsoy tarafından geliştirilmiştir.
GitHub: @canergulsoyy
🙏 Teşekkürler
Model Context Protocol - MCP protokolü
Open-Meteo - Ücretsiz hava durumu API'si
OpenRouter - Ücretsiz LLM API'si
TypeScript - Tip güvenliği
Zod - Schema validation
📞 İletişim
Issues: GitHub Issues
Discussions: GitHub Discussions
Email: canergulsoyy@gmail.com
Available Tools
2 toolsget_weather_by_dateGünlük hava durumu (tarihe göre)B
Belirli bir şehir ve tarih için günlük özet döndürür
Inputs: city (required), date (required), country.
health_checkHealth CheckB
Sunucunun çalıştığını doğrular
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools serve completely different purposes: one verifies server liveness, the other retrieves weather for a city/date. There is no plausible way an agent could confuse them.
Both names use snake_case and are readable, but health_check is a noun-style status name while get_weather_by_date follows a verb_noun pattern. The minor deviation is acceptable but not perfectly uniform.
Two tools is quite thin for a weather service; health_check is infrastructure boilerplate, leaving effectively one functional tool. This is borderline under-scoped rather than clearly appropriate.
The weather domain clearly needs current conditions, multi-day forecasts, and unit/location handling; only a single query by city+date exists. This leaves significant dead ends for common weather requests.
Maintenance
Related MCP Connectors
Global weather via Open-Meteo: forecast, historical, marine, air quality, geocoding, elevation.
Get current weather for any city and create images from your prompts. Streamline planning, reports…
Current weather and forecast lookup as an agent tool.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides tools to retrieve current weather conditions and daily forecasts for cities worldwide using the Open-Meteo API. This Python-based server enables MCP-compatible clients to access real-time meteorological data through a standardized interface.2MIT
- FlicenseNot gradedqualityDmaintenanceProvides a health check and a get_weather tool to query current weather by city name via HTTP, designed for integration with Dify.-
- 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.18 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides weather query capabilities using the Open-Meteo API with a tool for city/coordinate weather and a weather resource URI.1ISC