TMD Weather MCP Server
Provides weather data from the Thai Meteorological Department (TMD) with tools for querying stations, weather by province, and summaries, deployable via Docker or remote server.
README
TMD Weather MCP Server
🌤️ Model Context Protocol Server สำหรับข้อมูลสภาพอากาศจากกรมอุตุนิยมวิทยา (TMD)
✨ Features
- 🔧 5 MCP Tools สำหรับค้นหาข้อมูลสภาพอากาศ
- 🌐 HTTP API พร้อม FastAPI documentation
- 🐳 Docker Support พร้อม production-ready setup
- 📊 Monitoring ด้วย Prometheus และ health checks
- 🔒 Security พร้อม rate limiting และ SSL support
- 🚀 Easy Deployment scripts สำหรับทุก platform
🛠️ MCP Tools
- get_all_stations - รายชื่อสถานีตรวจวัดอากาศทั้งหมด
- get_weather_by_province - ค้นหาข้อมูลตามจังหวัด
- get_weather_by_station - ค้นหาตามชื่อสถานี/รหัสสถานี
- get_stations_near_location - หาสถานีใกล้เคียงจากพิกัด
- get_weather_summary - สรุปสภาพอากาศทั่วประเทศ
🚀 Quick Start
Claude Desktop (Local)
# 1. Clone repository
git clone https://github.com/yourusername/tmd-weather-mcp.git
cd tmd-weather-mcp
# 2. Install dependencies
python quick_setup.py
# 3. Update Claude Desktop config
cp claude_desktop_config_fixed.json "%APPDATA%\Claude\claude_desktop_config.json"
# 4. Restart Claude Desktop
Docker (Local/Remote)
# Development
docker-compose up --build
# Production
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
Remote Deployment
# Deploy to remote server
./deploy.sh --host YOUR_SERVER_IP --method files --prod
# Test deployment
./test-remote.sh YOUR_SERVER_IP
📡 API Endpoints
- Health Check:
GET /health - API Docs:
GET /docs - MCP Tools:
GET /mcp/tools - Weather Summary:
POST /api/weather/summary
🌐 Live Demo
หลังจาก deploy แล้ว:
- API Documentation: http://your-server/docs
- Health Status: http://your-server/health
- MCP Tools List: http://your-server/mcp/tools
🔧 Configuration
Environment Variables
MCP_TRANSPORT=http # http or stdio
HOST=0.0.0.0 # Server host
PORT=8000 # Server port
CACHE_DURATION=300 # Cache duration (seconds)
LOG_LEVEL=INFO # Logging level
Claude Desktop HTTP Config
{
"mcpServers": {
"tmd-weather-remote": {
"command": "curl",
"args": ["-s", "http://YOUR_SERVER/mcp/tools"],
"description": "Remote TMD Weather MCP Server"
}
}
}
📊 Data Source
ข้อมูลสภาพอากาศจาก กรมอุตุนิยมวิทยา (TMD)
- Real-time weather data
- 100+ monitoring stations
- Temperature, humidity, pressure, wind, rainfall
- Updated every hour
🐳 Docker Deployment
Development
docker-compose up --build
Production
# Full stack with nginx, monitoring
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
Management Commands
./docker-manage.sh up # Start services
./docker-manage.sh down # Stop services
./docker-manage.sh logs # View logs
./docker-manage.sh health # Health check
./docker-manage.sh status # Service status
🌍 Remote Deployment
Prerequisites
# Run on target server
curl -fsSL https://raw.githubusercontent.com/yourusername/tmd-weather-mcp/main/setup-target-server.sh | bash
Deploy Methods
1. File Transfer (Recommended)
./deploy.sh --host 192.168.1.100 --method files --prod
2. Docker Registry
./deploy.sh --host my-server.com --method docker --registry docker.io/myuser
3. Git Clone
./deploy.sh --host 10.0.0.50 --method git
📱 Management Scripts
- deploy.sh / deploy.bat - Automated deployment
- docker-manage.sh / docker-manage.bat - Container management
- test-remote.sh - Remote server testing
- setup-target-server.sh - Target server preparation
🔒 Security Features
- Rate limiting (10 req/s)
- CORS protection
- Security headers
- SSL/TLS support
- Container security (non-root user)
- Network isolation
📊 Monitoring
- Health Checks:
/healthendpoint - Prometheus Metrics: Port 9090 (production)
- Log Aggregation:
./logs/directory - Resource Monitoring: Docker stats
- Alert Scripts: Custom health checks
🚨 Troubleshooting
Common Issues
# Check service status
./docker-manage.sh status
# View logs
./docker-manage.sh logs
# Health check
curl http://localhost/health
# Test API
curl http://localhost/mcp/tools
Debug Commands
# Container logs
docker-compose logs tmd-weather-mcp
# Execute inside container
docker-compose exec tmd-weather-mcp bash
# Network connectivity
curl -I http://localhost:8000/health
📄 File Structure
tmd-weather-mcp/
├── 🐍 Python Core
│ ├── tmd_weather_server.py # MCP Server (stdio)
│ ├── tmd_weather_http_server.py # HTTP Server
│ ├── weather_api.py # TMD API client
│ ├── weather_models.py # Data models
│ └── requirements.txt # Dependencies
├── 🐳 Docker
│ ├── Dockerfile # Container definition
│ ├── docker-compose.yml # Development setup
│ ├── docker-compose.prod.yml # Production setup
│ ├── nginx.conf # Nginx config
│ └── .dockerignore # Docker ignore
├── 🚀 Deployment
│ ├── deploy.sh # Linux/macOS deploy
│ ├── deploy.bat # Windows deploy
│ ├── setup-target-server.sh # Server setup
│ └── test-remote.sh # Remote testing
├── 🔧 Management
│ ├── docker-manage.sh # Container management
│ ├── quick_setup.py # Local setup
│ └── test_quick.py # Local testing
└── 📚 Documentation
├── README.md # This file
├── DEPLOYMENT_GUIDE.md # Deployment guide
└── DOCKER_README.md # Docker guide
🤝 Contributing
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- กรมอุตุนิยมวิทยา (TMD) - Weather data provider
- Anthropic - Model Context Protocol
- FastAPI - Web framework
- Docker - Containerization platform
📞 Support
- Issues: GitHub Issues
- Documentation: Deployment Guide
- API Docs: http://your-server/docs (after deployment)
🌤️ Made with ❤️ for the Claude MCP ecosystem
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.