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
Visit Server

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! 🛰️

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured