🛰️ GeoSight MCP服务器
  
生产就绪的卫星图像分析MCP服务器 -通过自然语言查询分析地球观测数据。
*“让我看看过去一年亚马逊地区的森林砍伐情况”*\ *“从卫星图像中检测孟加拉国的洪水”*\ *“自2020年以来跟踪孟买周边的城市扩张”*
______________________________________________________________________
🌟 特性
| 特性 | 描述 |
|---|---|
| 土地覆盖分类 | 确定森林、水、城市地区、农业 |
| 植被分析(NDVI) | 监测作物健康、森林砍伐、干旱 |
| 水检测(NDWI) | 追踪洪水、水库、海岸变化 |
| 变化检测 | 比较不同时间段的图像 |
| 目标检测 | 寻找船只、飞机、建筑、太阳能发电场 |
| 自动报告 | 使用地图生成PDF/HTML报告 |
______________________________________________________________________
🏗️ 建筑
┌─────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ Claude Desktop / Streamlit Dashboard / API │
└──────────────────────────┬──────────────────────────────────────┘
│ MCP Protocol (stdio/SSE)
┌──────────────────────────▼──────────────────────────────────────┐
│ MCP SERVER (FastAPI) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Tools │ │ Auth │ │ Queue │ │
│ │ Router │ │ Layer │ │ (Celery) │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└──────────────────────────┬──────────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────────┐
│ PROCESSING ENGINE │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Imagery │ │ ML Models │ │ Visualize │ │
│ │ Fetcher │ │ Pipeline │ │ Engine │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└──────────────────────────┬──────────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────────┐
│ DATA LAYER │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Postgres │ │ Redis │ │ MinIO │ │
│ │ +PostGIS │ │ Cache │ │ Storage │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────────┘______________________________________________________________________
🚀 快速开始
先决条件
- Python 3.11+
- Docker&Docker编写
- Sentinel Hub帐户(提供免费等级)
1.克隆和设置
git clone https://github.com/yourusername/geosight-mcp.git
cd geosight-mcp
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -e ".[dev]"2.配置环境
cp .env.example .env
# Edit .env with your API keys3.启动服务
# Development mode
docker-compose up -d redis postgres minio
# Run MCP server
python -m geosight.server
# Or run everything with Docker
docker-compose up -d4.连接到克劳德桌面
添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"geosight": {
"command": "python",
"args": ["-m", "geosight.server"],
"cwd": "/path/to/geosight-mcp",
"env": {
"SENTINEL_HUB_CLIENT_ID": "your-client-id",
"SENTINEL_HUB_CLIENT_SECRET": "your-client-secret"
}
}
}
}______________________________________________________________________
🔧 可用的MCP工具
search_imagery
查找位置和日期范围的可用卫星图像。
# Example usage through Claude
"Find Sentinel-2 imagery for New Delhi from last month"calculate_ndvi
计算植被指数以评估植物健康状况。
# Returns: NDVI map + statistics
"Calculate NDVI for agricultural region near Punjab"calculate_ndwi
计算水指数以检测水体和洪水。
# Returns: Water mask + area calculations
"Show water bodies in Kerala during monsoon season"detect_land_cover
将土地分为以下几类:森林、水、城市、农业、荒地。
# Returns: Classification map + percentages
"Classify land cover for Bangalore metropolitan area"detect_changes
比较两个时间段并突出差异。
# Returns: Change map + statistics
"Show construction changes in Dubai between 2020 and 2024"detect_objects
在图像中查找特定对象(船只、飞机、建筑物)。
# Returns: Detected objects with bounding boxes
"Detect ships in Mumbai harbor"generate_report
创建全面的PDF/HTML分析报告。
# Returns: Downloadable report
"Generate environmental report for Amazon rainforest region"______________________________________________________________________
📊 数据源
| 来源 | 类型 | 分辨率 | 频率 | 成本 |
|---|---|---|---|---|
| Sentinel-2 | 光学(13个波段) | 10m | 5天 | 免费 |
| Sentinel-1 | SAR(雷达) | 10m | 6天 | 免费 |
| 陆地卫星8/9 | 光学+热 | 30米 | 16天 | 免费 |
| MODIS | 全球覆盖 | 250m-1km | 每日 | 免费 |
______________________________________________________________________
🧠 ML模型
包括预训练模型
- 土地覆盖物分类器 -基于EuroSAT的CNN(ResNet50)
- 变化检测 -暹罗U-Net架构
- 目标检测 -YOLOv8在DOTA数据集上训练
- 分割 -DeepLabV3+用于语义分割
模型性能
| 模型 | 任务 | 准确性 | 推理时间 |
|---|---|---|---|
| 土地覆盖 | 分类 | 94.2% | ~200ms |
| 变化检测 | 二进制变化 | 91.8% | ~500ms |
| 目标检测 | 船舶/飞机 | 87.5%mAP | ~300ms |
______________________________________________________________________
🐳 部署
Docker部署
# Build and run all services
docker-compose -f docker-compose.prod.yml up -d
# Check logs
docker-compose logs -f geosight-mcp云部署(Railway/Fly.io)
# Railway
railway up
# Fly.io
fly launch
fly deployKubernetes
kubectl apply -f k8s/______________________________________________________________________
📁 项目结构
geosight-mcp/
├── src/
│ └── geosight/
│ ├── __init__.py
│ ├── server.py # MCP server entry point
│ ├── tools/ # MCP tool implementations
│ │ ├── __init__.py
│ │ ├── imagery.py # Image search & fetch
│ │ ├── indices.py # NDVI, NDWI calculations
│ │ ├── classification.py # Land cover classification
│ │ ├── change_detection.py
│ │ ├── object_detection.py
│ │ └── reports.py # Report generation
│ ├── models/ # ML models
│ │ ├── __init__.py
│ │ ├── land_cover.py
│ │ ├── change_detector.py
│ │ └── object_detector.py
│ ├── services/ # External service integrations
│ │ ├── __init__.py
│ │ ├── sentinel_hub.py
│ │ ├── earth_engine.py
│ │ └── storage.py
│ └── utils/ # Utilities
│ ├── __init__.py
│ ├── geo.py # Geospatial utilities
│ ├── visualization.py
│ └── cache.py
├── tests/
├── config/
├── scripts/
├── dashboard/ # Streamlit dashboard
├── docs/
├── docker-compose.yml
├── Dockerfile
├── pyproject.toml
└── README.md______________________________________________________________________
🧪 测试
# Run all tests
pytest
# With coverage
pytest --cov=geosight --cov-report=html
# Integration tests
pytest tests/integration/ -v______________________________________________________________________
📈 监控
- 普罗米修斯指标 在
/metrics - 健康检查 在
/health - Grafana仪表板 包含在
config/grafana/
______________________________________________________________________
🤝 贡献
- 分叉存储库
- 创建特征分支(
git checkout -b feature/amazing-feature) - 提交更改(
git commit -m 'Add amazing feature') - 推送到分支(
git push origin feature/amazing-feature) - 打开拉取请求
______________________________________________________________________
📄 许可证
MIT许可证-请参阅 许可证 了解详情。
______________________________________________________________________
🙏 致谢
______________________________________________________________________
📬 联系
你的名字 - @你的推特
项目链接:
