Model Context Protocol (MCP) server for real-time earthquake data access from Thai Meteorological Department (TMD)
- Features
- System Requirements
- Installation
- Claude Desktop Configuration
- Usage
- Example Commands
- API Reference
- Troubleshooting
This server provides tools for searching and analyzing earthquake data:
Tool | Description | Parameters |
---|---|---|
get_earthquakes |
Fetch recent earthquake data | limit (number of items, default: 10) |
get_earthquakes_by_magnitude |
Filter earthquakes by magnitude | min_magnitude (minimum magnitude, default: 3.0) |
get_earthquakes_by_location |
Search by location/country | location (location name in Thai/English) |
get_earthquake_summary |
Get earthquake statistics summary | - |
get_large_earthquakes |
Find large dangerous earthquakes | magnitude_threshold (default: 5.0) |
Resource | Description |
---|---|
earthquake://latest |
Latest earthquake data (1 item) |
earthquake://today |
All earthquakes today (Thai timezone) |
- 📅 Date and time (both UTC and Thai time)
- 📍 Location coordinates (Latitude, Longitude)
- 🎯 Epicenter depth (kilometers)
- 📊 Earthquake magnitude
- 🌏 Event location (in Thai)
- 💬 Additional details
- Python 3.10 or higher
- pip (Python package manager)
- Internet connection for TMD API access
- Claude Desktop (for Claude integration)
cd C:\Users\Asus\2025-Aug-APT_LLMs-for-Telecom\tmd-earthquake-server-1.0
install.bat
cd /path/to/tmd-earthquake-server-1.0
chmod +x install.sh
./install.sh
-
Open Command Prompt/Terminal
-
Navigate to server directory:
cd C:\Users\Asus\2025-Aug-APT_LLMs-for-Telecom\tmd-earthquake-server-1.0
- Create virtual environment (optional but recommended):
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
Or install separately:
pip install "mcp[cli]" httpx
Windows:
%APPDATA%\Claude\claude_desktop_config.json
or
C:\Users\[Username]\AppData\Roaming\Claude\claude_desktop_config.json
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Open claude_desktop_config.json
with a text editor and add:
{
"mcpServers": {
"tmd-earthquake": {
"command": "python",
"args": ["C:\\Users\\Asus\\2025-Aug-APT_LLMs-for-Telecom\\tmd-earthquake-server-1.0\\server.py"]
}
}
}
Note:
- Use
\\
(double backslash) for Windows paths - If other servers exist, add after existing servers (don't forget the comma)
- Close Claude Desktop completely (including system tray)
- Reopen Claude Desktop
- Check for 🔌 icon indicating MCP server connection
# Test if server works
python server.py
# Use MCP Inspector (requires Node.js)
npx @modelcontextprotocol/inspector python server.py
Once configured, use natural language commands with Claude:
- "Show me recent earthquakes"
- "Find earthquakes with magnitude 4 or higher"
- "Are there any earthquakes in Myanmar?"
- "Give me a summary of earthquake activity"
- "Show today's earthquakes"
- "Find large earthquakes that might be dangerous"
- "แสดงข้อมูลแผ่นดินไหวล่าสุด"
- "หาแผ่นดินไหวที่มีขนาดมากกว่า 4 ริกเตอร์"
- "มีแผ่นดินไหวที่ประเทศเมียนมาบ้างไหม"
- "สรุปสถิติแผ่นดินไหวให้หน่อย"
- "แผ่นดินไหววันนี้มีกี่ครั้ง"
- "หาแผ่นดินไหวขนาดใหญ่ที่อาจเป็นอันตราย"
Fetch recent earthquake data
- limit: Maximum number of items to retrieve (default: 10)
- Returns: List of earthquakes with details
Filter earthquakes by magnitude
- min_magnitude: Minimum magnitude threshold (default: 3.0)
- Returns: Earthquakes matching the magnitude criteria
Search earthquakes by location
- location: Location/country name (Thai or English)
- Returns: Earthquakes in specified area
Get earthquake statistics summary
- Returns: Total statistics, average magnitude, distribution by area
Find large earthquakes
- magnitude_threshold: Magnitude threshold (default: 5.0)
- Returns: Earthquakes exceeding the threshold
- Returns: Latest earthquake data (1 item)
- Returns: All earthquakes today (Thai timezone)
- Check Python:
python --version
# Must be Python 3.10 or higher
- Check dependencies:
pip list | findstr mcp
# Must have mcp package
- View logs:
# Windows
type %APPDATA%\Claude\logs\mcp*.log
# Or open with notepad
notepad %APPDATA%\Claude\logs\mcp-server-tmd-earthquake.log
- Test server directly:
cd C:\Users\Asus\2025-Aug-APT_LLMs-for-Telecom\tmd-earthquake-server-1.0
python server.py
Error | Cause | Solution |
---|---|---|
ModuleNotFoundError: No module named 'mcp' |
MCP not installed | Run pip install "mcp[cli]" |
ModuleNotFoundError: No module named 'httpx' |
httpx not installed | Run pip install httpx |
Connection timeout |
Cannot connect to TMD API | Check internet connection |
Server not responding |
Incorrect path in config | Check path in claude_desktop_config.json |
- Claude Desktop should show 🔌 or ⚡ icon
- Type "Show MCP tools" in Claude
- Should see tmd-earthquake server tools
- API Provider: Thai Meteorological Department (TMD)
- API Endpoint: https://data.tmd.go.th/api/DailySeismicEvent/v1/
- Update Frequency: Real-time
- Coverage: Regional and global
This server is for educational and informational purposes. The earthquake data is provided by TMD.
If you find issues or want to add features:
- Create an Issue
- Submit Pull Request
- Contact the developer
If you need help:
- Check Troubleshooting first
- Review logs in
%APPDATA%\Claude\logs\
- Test server directly with
python server.py
Version: 1.0.0
Last Updated: 2025-08-15
Developed for: TMD Earthquake Data Access via MCP