Earth Engine MCP Server

Earth Engine MCP Server

Enables satellite imagery analysis through Google Earth Engine, allowing users to search datasets, calculate vegetation indices like NDVI, filter collections by location and date, and export imagery to cloud storage. Supports major satellite datasets including Sentinel-2, Landsat, and MODIS for applications like agriculture monitoring and deforestation tracking.

Category
访问服务器

README

Earth Engine MCP Server

A Model Context Protocol (MCP) server for Google Earth Engine that enables satellite imagery analysis through Claude Desktop or any MCP-compatible client.

🚀 Quick Start

Prerequisites

  1. Google Earth Engine Account: Sign up at earthengine.google.com
  2. Service Account Key: Create a service account in Google Cloud Console with Earth Engine API access
  3. Node.js: Version 18 or higher
  4. Google Cloud Storage Permissions (for exports): See GCS Permissions Guide

Installation

# Clone the repository
git clone https://github.com/Dhenenjay/earth-engine-mcp.git
cd earth-engine-mcp

# Install dependencies
npm install
# or
pnpm install

Configuration

  1. Download your Earth Engine service account JSON key from Google Cloud Console
  2. Save it to a secure location (e.g., C:\Users\YourName\ee-key.json)

🔧 Usage

Option 1: Claude Desktop (Recommended)

  1. Edit Claude Desktop configuration:

    Open %APPDATA%\Claude\claude_desktop_config.json and add:

    {
      "mcpServers": {
        "earth-engine": {
          "command": "node",
          "args": ["C:\\path\\to\\earth-engine-mcp\\mcp-earth-engine.js"],
          "env": {
            "EARTH_ENGINE_PRIVATE_KEY": "C:\\path\\to\\your\\ee-key.json"
          }
        }
      }
    }
    
  2. Restart Claude Desktop

  3. Use Earth Engine tools in Claude:

    • "Search for Sentinel-2 datasets"
    • "Calculate NDVI for San Francisco"
    • "Get Landsat imagery for January 2024"

Option 2: Direct MCP Client

// Connect to the MCP server
const server = spawn('node', ['mcp-earth-engine.js'], {
  env: {
    EARTH_ENGINE_PRIVATE_KEY: '/path/to/ee-key.json'
  }
});

Option 3: SSE Endpoint (For Web Clients)

# Start the SSE server
EARTH_ENGINE_PRIVATE_KEY=/path/to/ee-key.json npm run dev

# Connect at: http://localhost:3000/api/mcp/sse

📚 Available Tools

1. search_catalog

Search the Earth Engine data catalog for datasets.

{
  "query": "sentinel-2"
}

2. get_band_names

Get available bands for a dataset.

{
  "datasetId": "COPERNICUS/S2_SR_HARMONIZED"
}

3. filter_collection

Filter satellite imagery by date and location.

{
  "datasetId": "COPERNICUS/S2_SR_HARMONIZED",
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "region": {
    "type": "Point",
    "coordinates": [-122.4194, 37.7749]
  }
}

4. calculate_ndvi

Calculate Normalized Difference Vegetation Index.

{
  "imageId": "COPERNICUS/S2_SR_HARMONIZED",
  "redBand": "B4",
  "nirBand": "B8"
}

5. get_map_url

Generate map visualization URLs.

{
  "imageId": "COPERNICUS/S2_SR_HARMONIZED",
  "visParams": {
    "bands": ["B4", "B3", "B2"],
    "min": 0,
    "max": 3000
  }
}

6. calculate_statistics

Calculate image statistics for a region.

{
  "imageId": "COPERNICUS/S2_SR_HARMONIZED",
  "region": {
    "type": "Polygon",
    "coordinates": [[[-122.5, 37.7], [-122.4, 37.7], [-122.4, 37.8], [-122.5, 37.8], [-122.5, 37.7]]]
  },
  "scale": 30
}

7. export_image_to_cloud_storage 🆕

Export satellite imagery to Google Cloud Storage (works with service accounts).

{
  "collection": "COPERNICUS/S2_SR_HARMONIZED",
  "start_date": "2024-01-01",
  "end_date": "2024-01-31",
  "region": "Los Angeles",
  "scale": 10,
  "bucket": "earth-engine-exports-PROJECT_ID"
}

Note: Service accounts cannot export to Google Drive. Use GCS exports instead. See GCS Permissions Guide for setup instructions.

🧪 Testing

# Run the test suite
node test-earth-engine.js

# Test individual tools
node mcp-earth-engine.js
# Then send JSON-RPC messages via stdin

🌍 Example Workflows

NDVI Analysis for Agriculture

1. Search for Sentinel-2 imagery
2. Filter by your farm's location and growing season
3. Calculate NDVI to assess crop health
4. Get statistics to track changes over time

Deforestation Monitoring

1. Filter Landsat imagery for two time periods
2. Calculate vegetation indices for both
3. Compare statistics to detect forest loss

Urban Heat Island Analysis

1. Search for temperature datasets (MODIS)
2. Filter for summer months in urban areas
3. Calculate statistics to identify heat patterns

📊 Supported Datasets

  • Sentinel-2: High-resolution optical imagery (10m)
  • Landsat 8/9: Multispectral imagery (30m)
  • MODIS: Daily global coverage
  • CHIRPS: Precipitation data
  • SRTM: Digital elevation models
  • And many more in the Earth Engine catalog

🔒 Security

  • Never commit your service account key to version control
  • Store keys in secure locations with restricted access
  • Use environment variables for production deployments
  • Rotate service account keys regularly

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new features
  4. Submit a pull request

📝 License

MIT License - See LICENSE file for details

🆘 Troubleshooting

"Earth Engine not initialized"

  • Check your service account key path
  • Verify the key has Earth Engine API access
  • Ensure the project has Earth Engine API enabled

"Dataset not found"

  • Use the exact dataset ID from Earth Engine catalog
  • Check if the dataset requires special access

Connection issues

  • Verify Node.js version (18+)
  • Check firewall settings
  • Ensure all dependencies are installed

📧 Support

🎉 Quick Test

After setup, try this in Claude Desktop:

"Search for Sentinel-2 satellite imagery and calculate NDVI for San Francisco in January 2024"

The server will:

  1. Search the Earth Engine catalog
  2. Filter Sentinel-2 data for the specified time and location
  3. Calculate NDVI vegetation index
  4. Return statistics and visualization URLs

Happy Earth Observing! 🛰️

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选