mcp-geo-tools

Epawse/mcp-geo-tools

3.1

If you are the rightful owner of mcp-geo-tools and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The MCP Geo Tools server is a planned project designed to provide geospatial services following the Model Context Protocol (MCP) standards.

Tools
5
Resources
0
Prompts
0

MCP Geo Tools

A standard Model Context Protocol (MCP) server providing geographic spatial tools for 3D globe visualization.

Works with Claude Desktop, Claude Code, and any MCP-compatible client.

Features

  • Navigation: Fly to coordinates or known locations worldwide
  • Map Styles: Switch between satellite, vector, terrain, and dark basemaps
  • Markers: Add and manage point markers with labels
  • Weather Effects: Rain, snow, fog visual effects
  • Time Control: Day, night, dawn, dusk lighting

Quick Start

Using uvx (Recommended)

uvx mcp-geo-tools

Using pip

pip install mcp-geo-tools
mcp-geo-tools

Claude Desktop Integration

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "geo-tools": {
      "command": "uvx",
      "args": ["mcp-geo-tools"]
    }
  }
}

Or if installed via pip:

{
  "mcpServers": {
    "geo-tools": {
      "command": "mcp-geo-tools"
    }
  }
}

Available Tools

Navigation

ToolDescription
fly_toFly to specific coordinates (longitude, latitude, altitude)
fly_to_locationFly to a known location by name (e.g., "北京", "Paris")
reset_viewReset camera to default view
get_camera_positionGet current camera position

Map Style

ToolDescription
switch_basemapSwitch basemap type: satellite, vector, terrain, dark
switch_basemap_by_nameSwitch basemap using natural language

Markers

ToolDescription
add_markerAdd a marker at coordinates
add_marker_at_locationAdd a marker at a known location
remove_markerRemove a specific marker
clear_markersRemove all markers

Weather

ToolDescription
set_weatherSet weather effect: rain, snow, fog, clear
set_weather_by_nameSet weather using natural language
clear_weatherClear all weather effects

Time

ToolDescription
set_timeSet time preset: day, night, dawn, dusk
set_time_by_nameSet time using natural language

Available Resources

Resource URIDescription
geo://locationsAll known locations with coordinates
geo://locations/listList of location names
geo://locations/chinaLocations in China
geo://locations/worldLocations outside China
geo://basemapsAvailable basemap types
geo://weatherAvailable weather effects
geo://time-presetsAvailable time presets

Known Locations

The server includes 50+ pre-defined locations:

China: 北京, 上海, 广州, 深圳, 杭州, 成都, 故宫, 长城, 西湖, 外滩...

World: New York, Paris, London, Tokyo, Sydney, Eiffel Tower, Statue of Liberty, Pyramids...

Execution Modes

This MCP server supports two execution modes:

Instruction Mode (Default)

Returns JSON action commands that can be executed by a compatible client:

{
  "mode": "instruction",
  "action": "fly_to",
  "arguments": {"longitude": 116.4074, "latitude": 39.9042, "altitude": 5000},
  "message": "飞往坐标 (116.4074, 39.9042)"
}

Execute Mode

When GeoCommander is running, actions are executed directly via HTTP API:

# Enable execute mode
export GEOCOMMANDER_URL=http://localhost:8765
export MCP_GEO_MODE=execute  # or "auto" for automatic detection

mcp-geo-tools

In execute mode, the MCP server:

  1. Sends action commands to GeoCommander's /execute endpoint
  2. GeoCommander broadcasts to connected Cesium frontend
  3. Returns execution result to the LLM

Configuration

Environment VariableDescriptionDefault
GEOCOMMANDER_URLGeoCommander HTTP API URLhttp://localhost:8765
MCP_GEO_MODEExecution mode: instruction, execute, or autoauto

Claude Desktop with Execute Mode

{
  "mcpServers": {
    "geo-tools": {
      "command": "uvx",
      "args": ["mcp-geo-tools[execute]"],
      "env": {
        "GEOCOMMANDER_URL": "http://localhost:8765",
        "MCP_GEO_MODE": "auto"
      }
    }
  }
}

HTTP Transport Mode

For web applications, run in HTTP mode:

mcp-geo-tools --http --port 8766

This starts a Streamable HTTP server that web clients can connect to.

Usage Examples

In Claude Desktop or any MCP client:

"带我去故宫看看" → Flies to the Forbidden City
"切换到卫星地图" → Switches to satellite basemap
"下雪效果" → Adds snow weather effect
"设置成黄昏" → Sets time to dusk
"在西湖添加标记" → Adds a marker at West Lake

Development

Setup

git clone https://github.com/Epawse/mcp-geo-tools.git
cd mcp-geo-tools
pip install -e ".[dev]"

Run Tests

pytest

Project Structure

mcp-geo-tools/
├── src/mcp_geo_tools/
│   ├── __init__.py
│   ├── server.py           # MCP server entry point
│   ├── tools/
│   │   ├── navigation.py   # Camera/flight tools
│   │   ├── basemap.py      # Map style tools
│   │   ├── markers.py      # Marker management
│   │   ├── weather.py      # Weather effects
│   │   └── time.py         # Time/lighting
│   ├── resources/
│   │   └── locations.py    # Location database
│   └── prompts/
│       └── templates.py    # System prompts
├── tests/
├── pyproject.toml
└── README.md

Integration with GeoCommander

This MCP server is designed to work with GeoCommander, a 3D globe visualization application built with Cesium.js.

Architecture

┌─────────────────┐     MCP Protocol     ┌─────────────────┐
│  Claude Desktop │◄───────────────────► │  mcp-geo-tools  │
│  / Claude Code  │                      │   (MCP Server)  │
└─────────────────┘                      └────────┬────────┘
                                                  │
                                         HTTP POST /execute
                                                  │
                                                  ▼
                                         ┌─────────────────┐
                                         │  GeoCommander   │
                                         │ (FastAPI Server)│
                                         └────────┬────────┘
                                                  │
                                            WebSocket
                                                  │
                                                  ▼
                                         ┌─────────────────┐
                                         │  Cesium Viewer  │
                                         │   (Frontend)    │
                                         └─────────────────┘

How It Works

  1. User talks to Claude (via Claude Desktop or Claude Code)
  2. Claude calls MCP tools (e.g., fly_to("北京"))
  3. MCP Server sends action to GeoCommander via HTTP
  4. GeoCommander broadcasts to connected Cesium frontend via WebSocket
  5. Cesium viewer executes the action (camera flies to Beijing)

Running the Full Stack

# Terminal 1: Start GeoCommander backend
cd geocommander/mcp-server
python server.py

# Terminal 2: Start Cesium frontend
cd geocommander/web
npm run dev

# Terminal 3: Use with Claude Desktop or Claude Code
# (Configure as shown in "Claude Desktop with Execute Mode" section)

License

MIT License - see file.

Links