ObsPy MCP服务器
MCP服务器使Claude Desktop能够通过ObsPy下载地震和波形数据。
此服务器将ObsPy功能作为MCP工具公开,使Claude能够:
- 搜索地震目录(FDSN)
- 查找附近的地震台站
- 下载波形、元数据和图表
- 估计相位到达时间(TauP)
需求
- Python 3.9+
- obspy -地震数据处理库
- fastmcp -MCP服务器框架
快速开始
# Clone the repository
git clone https://github.com/Fahim-Azwad/simple-obspy.git
cd simple-obspy
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt配置Claude桌面
首选 克劳德→ 设置→ 开发者→ 编辑配置 并添加:
{
"mcpServers": {
"obspy-mcp": {
"command": "/FULL/PATH/TO/simple-obspy/.venv/bin/python",
"args": ["/FULL/PATH/TO/simple-obspy/server.py"]
}
}
}注: 替换/FULL/PATH/TO/simple-obspy根据您的实际路径(例如。,/Users/Fahim-Azwad/simple-obspy)
重新启动克劳德桌面(Cmd+Q→ 重新开放)。
______________________________________________________________________
工具
| 工具 | 目的 |
|---|---|
diagnose_environment | 健康检查 |
find_recent_m7 | 搜索地震目录 |
get_nearby_stations | 寻找震中附近的台站 |
download_waveforms | 下载并保存地震数据 |
estimate_arrival_times | 计算P/S波到达时间 |
calculate_distance | 大圆距离 |
auto_download_study | 一次性自动化工作流程 |
______________________________________________________________________
提示示例
🏥 健康检查
Run diagnose_environment🌍 查找地震
Find recent M7+ earthquakes from the last 30 daysFind M6+ earthquakes from the last 90 days, limit 10Search for large earthquakes in the past 2 months📡 查找车站
Find seismic stations within 3 degrees of latitude 35.0, longitude 139.0What broadband stations are near the Japan earthquake epicenter?List stations within 500 km of 41.0, 142.0📥 下载波形
Download waveforms from station IU.MAJO for the earthquake at 2025-12-08T14:15:10Z, epicenter 41.0, 142.0Get seismic data from II.ERM for the M7.6 Japan earthquake, include 5 minutes before and 30 minutes afterDownload BHZ channel data from network IU, station ANMO for origin time 2025-12-08T14:15:10⏱️ 到达时间
Estimate P and S wave arrival times for an earthquake 45 degrees away at 30 km depthWhat are the expected phase arrivals for a teleseismic event at 80 degrees distance?Calculate when P, S, and PKP waves arrive for distance 120 degrees, depth 600 km📏 距离
What is the distance from Tokyo (35.68, 139.65) to Los Angeles (34.05, -118.24)?Calculate distance between earthquake at 41.0, 142.0 and station at 42.0, 143.0🚀 一键自动学习(最强大)
Use auto_download_study for the last 60 days, M7+, 5 degree radiusRun an automatic earthquake study: find a recent M6.5+ event, locate nearby stations, download waveformsAutomatically download seismic data for any M7+ earthquake in the past 30 daysDo a complete seismic study - find earthquake, pick station, download data, show me the filesauto_download_study with min_magnitude 6.0, days 90, maxradius 10 degrees🔬 高级工作流
1. Find M7+ earthquakes from last 60 days
2. For the first one, find stations within 5 degrees
3. Download waveforms from the closest station
4. Calculate distance and estimate P/S arrival timesFind the recent Japan M7.6 earthquake, download data from station II.ERM, then tell me when the P and S waves should arriveSearch for deep earthquakes (depth > 300 km) in the last 90 days, download waveforms from a nearby station______________________________________________________________________
输出文件
下载已保存到 ./obspy_downloads/:
obspy_downloads/2025-12-08T14-15-10Z_II.ERM/
├── waveforms.mseed # Seismogram data (MiniSEED)
├── station.xml # Instrument response (StationXML)
├── event.json # Earthquake parameters
└── quickplot.png # Waveform visualization______________________________________________________________________
信道编码
| 代码 | 含义 |
|---|---|
BH? | 宽带高增益(默认) |
HH? | 高宽带 |
LH? | 长期 |
BHZ | 仅限垂直宽带 |
BH1, BH2 | 水平组件 |
______________________________________________________________________
参考文献
______________________________________________________________________
致谢
应要求开发 朱伟强教授,地球与行星科学,加州大学伯克利分校。
