Skip to content

cesium-mcp-runtime

MCP Server (stdio) — 58 tools (12 toolsets) + 2 resources, with dynamic discovery.

npm

Installation & Run

bash
npx cesium-mcp-runtime

Or install globally:

bash
npm install -g cesium-mcp-runtime
cesium-mcp-runtime

MCP Client Configuration

Claude Desktop

claude_desktop_config.json:

json
{
  "mcpServers": {
    "cesium": {
      "command": "npx",
      "args": ["-y", "cesium-mcp-runtime"]
    }
  }
}

VS Code (GitHub Copilot)

.vscode/mcp.json:

json
{
  "servers": {
    "cesium-mcp": {
      "command": "npx",
      "args": ["-y", "cesium-mcp-runtime"]
    }
  }
}

Cursor

.cursor/mcp.json:

json
{
  "mcpServers": {
    "cesium": {
      "command": "npx",
      "args": ["-y", "cesium-mcp-runtime"]
    }
  }
}

MCP Tools (58 + 2 meta)

Tools are organized into 12 toolsets. By default, 4 core toolsets are enabled (~31 tools). Set CESIUM_TOOLSETS=all for everything, or let the AI discover and activate toolsets dynamically.

Toolsets

ToolsetToolsDefaultDescription
view8YesCamera view controls + viewpoint bookmarks + scene export
entity10YesCore entity operations + batch, query & property inspection
layer8YesLayer management (GeoJSON, schema, style, basemap)
interaction3YesScreenshot, highlight & measurement
camera4Advanced camera controls (orbit, lookAt)
entity-ext7Extended entity types (box, cylinder, wall, etc.)
animation8Animation system (waypoints, clock, tracking, lighting)
tiles53D Tiles, terrain, imagery services, CZML & KML
trajectory1Trajectory playback
heatmap1Heatmap visualization
scene2Scene options & post-processing
geolocation1Geocoding — convert address/place name to coordinates (Nominatim/OSM)

Dynamic Discovery

When not in all mode, two meta-tools are always available:

ToolDescription
list_toolsetsList all toolset groups with enabled status
enable_toolsetDynamically enable a toolset at runtime

View

flyTo

Animate camera to a position with smooth transition.

ParameterTypeRequiredDefaultDescription
longitudenumberLongitude (-180 to 180)
latitudenumberLatitude (-90 to 90)
heightnumber50000Camera height in meters
headingnumber0Heading in degrees, 0 = North
pitchnumber-45Pitch in degrees, -90 = straight down
durationnumber2Flight animation duration in seconds

setView

Instantly set camera position and orientation (no animation).

ParameterTypeRequiredDefaultDescription
longitudenumberLongitude (-180 to 180)
latitudenumberLatitude (-90 to 90)
heightnumber50000Height in meters
headingnumber0Heading in degrees
pitchnumber-90Pitch in degrees
rollnumber0Roll in degrees

getView

Return current camera position and orientation. No parameters.

Returns: { longitude, latitude, height, heading, pitch, roll }

zoomToExtent

Fit view to a geographic bounding box.

ParameterTypeRequiredDefaultDescription
westnumberWest boundary longitude
southnumberSouth boundary latitude
eastnumberEast boundary longitude
northnumberNorth boundary latitude
durationnumber2Animation duration in seconds

saveViewpoint

Save the current camera state as a named viewpoint bookmark.

ParameterTypeRequiredDefaultDescription
namestringViewpoint bookmark name

Returns: The saved ViewState object.

loadViewpoint

Restore a previously saved viewpoint bookmark.

ParameterTypeRequiredDefaultDescription
namestringViewpoint bookmark name
durationnumber0Flight duration in seconds (0 = instant)

Returns: The restored ViewState, or error if not found.

listViewpoints

List all saved viewpoint bookmarks. No parameters.

Returns: [{ name, state: ViewState }]

exportScene

Export all entities and layers in the current scene as a structured JSON snapshot.

No parameters.

Returns: { entities: [...], layers: [...], camera: ViewState }

Entity

addMarker

Add a point marker with optional label. Returns entityId.

ParameterTypeRequiredDefaultDescription
longitudenumberLongitude (-180 to 180)
latitudenumberLatitude (-90 to 90)
labelstringLabel text
colorstring"#3B82F6"CSS color
sizenumber12Point size in pixels
idstringautoCustom layer ID

addLabel

Add text labels to GeoJSON features (display attribute values).

ParameterTypeRequiredDefaultDescription
dataobjectGeoJSON FeatureCollection
fieldstringProperty field name for label text
styleobjectLabel style (font, fillColor, outlineColor, scale)

addModel

Place a 3D model (glTF/GLB) at a position. Returns entityId.

ParameterTypeRequiredDefaultDescription
longitudenumberLongitude (-180 to 180)
latitudenumberLatitude (-90 to 90)
heightnumber0Height in meters
urlstringglTF/GLB model URL
scalenumber1Scale factor
headingnumber0Heading in degrees
pitchnumber0Pitch in degrees
rollnumber0Roll in degrees
labelstringModel label text

addPolygon

Add a polygon area with fill and outline. Returns entityId.

ParameterTypeRequiredDefaultDescription
coordinatesnumber[][]Ring coordinates [[lon, lat, height?], ...]
colorstring"#3B82F6"Fill color (CSS)
outlineColorstring"#FFFFFF"Outline color
opacitynumber0.6Fill opacity (0–1)
extrudedHeightnumberExtrusion height in meters
clampToGroundbooleantrueClamp to terrain
labelstringPolygon label text

addPolyline

Add a polyline (path/route). Returns entityId.

ParameterTypeRequiredDefaultDescription
coordinatesnumber[][]Coordinates [[lon, lat, height?], ...]
colorstring"#3B82F6"Line color (CSS)
widthnumber3Line width in pixels
clampToGroundbooleantrueClamp to terrain
labelstringPolyline label text

updateEntity

Update properties of an existing entity.

ParameterTypeRequiredDefaultDescription
entityIdstringEntity ID to update
positionobjectNew position { longitude, latitude, height? }
labelstringNew label text
colorstringNew color (CSS)
scalenumberNew scale factor
showbooleanVisibility

removeEntity

Remove a single entity by ID.

ParameterTypeRequiredDefaultDescription
entityIdstringEntity ID to remove

batchAddEntities

Add multiple entities of different types in a single call.

ParameterTypeRequiredDefaultDescription
entitiesobject[]Array of entity definitions

Each entity object must include a type field ("marker", "polyline", "polygon", "model", "label", "billboard", "box", "cylinder", "ellipse", "rectangle", "wall", "corridor") plus the corresponding parameters for that entity type.

Returns: { entityIds: string[], errors: string[] }

queryEntities

Search and filter entities in the scene.

ParameterTypeRequiredDefaultDescription
namestringFilter by name (fuzzy match, case-insensitive)
typestringFilter by type ("point", "billboard", "label", "model", "polyline", "polygon")
bboxnumber[]Bounding box filter [west, south, east, north]

Returns: [{ entityId, name?, type, position? }]

getEntityProperties

Get all properties of a specific entity by ID.

ParameterTypeRequiredDefaultDescription
entityIdstringEntity ID

Returns: { entityId, name, type, position?, properties }

Layer

addGeoJsonLayer

Load GeoJSON data as a layer with optional styling. Supports both inline data and URL loading.

ParameterTypeRequiredDefaultDescription
dataobjectGeoJSON FeatureCollection (inline data)
urlstringURL to fetch GeoJSON from (browser-side fetch)
idstringautoLayer ID
namestringDisplay name
styleobjectStyle config (color, opacity, pointSize, strokeWidth, randomColor, gradient, choropleth, category)

Either data or url must be provided.

listLayers

List all currently loaded layers. No parameters.

Returns: [{ id, name, type, visible, color }]

removeLayer

Remove a layer by ID.

ParameterTypeRequiredDefaultDescription
idstringLayer ID (from listLayers)

clearAll

Remove all layers, entities, and data sources. No parameters.

setLayerVisibility

Toggle layer visibility.

ParameterTypeRequiredDefaultDescription
idstringLayer ID
visiblebooleanWhether layer is visible

updateLayerStyle

Modify layer styling properties.

ParameterTypeRequiredDefaultDescription
layerIdstringLayer ID
labelStyleobjectLabel style (font, fillColor, outlineColor, outlineWidth, scale)
layerStyleobjectLayer style (color, opacity, strokeWidth, pointSize)
tileStyleobject3D Tiles style (Cesium3DTileStyle expressions: color, show, pointSize, meta)

getLayerSchema

Get the property field structure of a layer (GeoJSON DataSource or 3D Tiles batch table).

ParameterTypeRequiredDefaultDescription
layerIdstringLayer ID

Returns: { layerId, layerName, entityCount, fields: [{ name, type, sample? }] }

setBasemap

Switch the base imagery layer.

ParameterTypeRequiredDefaultDescription
basemapstring"dark" | "satellite" | "standard"

Camera

lookAtTransform

Orbit-style camera aim at a target position.

ParameterTypeRequiredDefaultDescription
longitudenumberTarget longitude
latitudenumberTarget latitude
heightnumber0Target height in meters
headingnumber0Camera heading in degrees
pitchnumber-45Camera pitch in degrees
rangenumber1000Distance from target in meters

startOrbit

Start orbiting the camera around the current view center.

ParameterTypeRequiredDefaultDescription
speednumber0.005Rotation speed (radians/tick)
clockwisebooleantrueOrbit direction

stopOrbit

Stop the camera orbit animation. No parameters.

setCameraOptions

Configure camera controller options.

ParameterTypeRequiredDefaultDescription
enableRotatebooleanEnable rotation
enableTranslatebooleanEnable translation
enableZoombooleanEnable zoom
enableTiltbooleanEnable tilt
enableLookbooleanEnable look
minimumZoomDistancenumberMin zoom distance (meters)
maximumZoomDistancenumberMax zoom distance (meters)
enableInputsbooleanEnable/disable all inputs

Extended Entity Types

addBillboard

Add an image icon at a position.

ParameterTypeRequiredDefaultDescription
longitudenumberLongitude
latitudenumberLatitude
heightnumber0Height in meters
imagestringImage URL
namestringBillboard name
scalenumber1.0Scale factor
colorColorInputTint color
pixelOffset{x, y}Pixel offset
heightReferencestring"NONE" | "CLAMP_TO_GROUND" | "RELATIVE_TO_GROUND"

addBox

Add a 3D box entity.

ParameterTypeRequiredDefaultDescription
longitudenumberLongitude
latitudenumberLatitude
heightnumber0Height in meters
dimensionsobject{ width, length, height } in meters
namestringBox name
materialMaterialInputMaterial (color, image, etc.)
outlinebooleantrueShow outline
outlineColorColorInputOutline color
fillbooleantrueShow fill
orientationobject{ heading, pitch, roll } in degrees

addCorridor

Add a corridor (path with width).

ParameterTypeRequiredDefaultDescription
positionsPositionDegrees[]Array of { longitude, latitude, height? }
widthnumberWidth in meters
namestringCorridor name
materialMaterialInputMaterial
cornerTypestring"ROUNDED" | "MITERED" | "BEVELED"
heightnumberHeight above ground
extrudedHeightnumberExtruded height
outlinebooleanShow outline

addCylinder

Add a cylinder or cone.

ParameterTypeRequiredDefaultDescription
longitudenumberLongitude
latitudenumberLatitude
heightnumber0Height in meters
lengthnumberCylinder height in meters
topRadiusnumberTop radius in meters
bottomRadiusnumberBottom radius in meters
namestringName
materialMaterialInputMaterial
outlinebooleantrueShow outline
slicesnumber128Number of slices

addEllipse

Add an ellipse (oval).

ParameterTypeRequiredDefaultDescription
longitudenumberCenter longitude
latitudenumberCenter latitude
heightnumber0Height in meters
semiMajorAxisnumberSemi-major axis in meters
semiMinorAxisnumberSemi-minor axis in meters
namestringName
materialMaterialInputMaterial
extrudedHeightnumberExtruded height
rotationnumberRotation in radians
outlinebooleanShow outline

addRectangle

Add a rectangle by geographic bounds.

ParameterTypeRequiredDefaultDescription
westnumberWest longitude
southnumberSouth latitude
eastnumberEast longitude
northnumberNorth latitude
namestringName
materialMaterialInputMaterial
heightnumberHeight
extrudedHeightnumberExtruded height
outlinebooleanShow outline

addWall

Add a wall along positions.

ParameterTypeRequiredDefaultDescription
positionsPositionDegrees[]Array of { longitude, latitude, height? }
namestringName
minimumHeightsnumber[]Min heights at each position
maximumHeightsnumber[]Max heights at each position
materialMaterialInputMaterial
outlinebooleanShow outline

Animation

createAnimation

Create a time-based animation with waypoints (moving entity along a path).

ParameterTypeRequiredDefaultDescription
waypointsobject[][{ longitude, latitude, height?, time }]time is ISO 8601
namestringAnimation name
modelUristringglTF URL or preset: cesium_man, cesium_air, ground_vehicle, cesium_drone
showPathbooleantrueShow trail path
pathWidthnumber2Path width in pixels
pathColorstring"#00FF00"Path color (CSS)
pathLeadTimenumber0Path lead time in seconds
pathTrailTimenumber1e10Path trail time in seconds
multipliernumber1Clock speed multiplier
shouldAnimatebooleantrueAuto-start animation

controlAnimation

Play or pause the current animation.

ParameterTypeRequiredDefaultDescription
actionstring"play" | "pause"

removeAnimation

Remove an animation entity.

ParameterTypeRequiredDefaultDescription
entityIdstringEntity ID of animation to remove

listAnimations

List all active animations. No parameters.

Returns: [{ entityId, name?, startTime, stopTime, exists }]

updateAnimationPath

Update visual properties of an animation path.

ParameterTypeRequiredDefaultDescription
entityIdstringAnimation entity ID
widthnumberPath width in pixels
colorstringPath color (CSS)
leadTimenumberLead time in seconds
trailTimenumberTrail time in seconds
showbooleanShow/hide path

trackEntity

Follow an entity with the camera, or stop tracking.

ParameterTypeRequiredDefaultDescription
entityIdstringEntity ID to track (omit to stop)
headingnumberCamera heading in degrees
pitchnumber-30Camera pitch in degrees
rangenumber500Camera distance in meters

controlClock

Configure the Cesium clock.

ParameterTypeRequiredDefaultDescription
actionstring"configure" | "setTime" | "setMultiplier"
startTimestringISO 8601 start time
stopTimestringISO 8601 stop time
currentTimestringISO 8601 current time
timestringISO 8601 time to jump to (for setTime)
multipliernumberClock speed multiplier
shouldAnimatebooleanWhether clock should animate
clockRangestring"UNBOUNDED" | "CLAMPED" | "LOOP_STOP"

setGlobeLighting

Enable/disable globe lighting and atmospheric effects.

ParameterTypeRequiredDefaultDescription
enableLightingbooleanEnable globe lighting
dynamicAtmosphereLightingbooleanDynamic atmosphere lighting
dynamicAtmosphereLightingFromSunbooleanUse sun position for atmosphere

3D Data

load3dTiles

Load a 3D Tileset (buildings, terrain mesh, etc.) from URL or Cesium Ion asset ID.

ParameterTypeRequiredDefaultDescription
urlstringURL to tileset.json
ionAssetIdnumberCesium Ion asset ID
idstringautoLayer ID
namestringDisplay name
maximumScreenSpaceErrornumber16Max screen space error (lower = more detail)
heightOffsetnumberHeight offset in meters

Either url or ionAssetId must be provided.

loadTerrain

Set the terrain provider.

ParameterTypeRequiredDefaultDescription
providerstring"flat" | "arcgis" | "cesiumion"
urlstringCustom terrain service URL
cesiumIonAssetIdnumberCesium Ion asset ID (for cesiumion)

loadImageryService

Add an imagery layer from URL or Cesium Ion asset ID.

ParameterTypeRequiredDefaultDescription
urlstringImagery service URL
serviceTypestring"wms" | "wmts" | "xyz" | "arcgis_mapserver" | "ion"
ionAssetIdnumberCesium Ion asset ID
idstringautoLayer ID
namestringDisplay name
layerNamestringWMS/WMTS layer name
opacitynumber1.0Opacity (0–1)

Either url + serviceType or ionAssetId must be provided.

loadCzml

Load CZML time-dynamic data source (inline data array or remote URL).

ParameterTypeRequiredDefaultDescription
dataunknown[]CZML packet array (inline)
urlstringURL to CZML file
idstringautoLayer ID
namestringDisplay name
sourceUristringBase URI for relative references
clampToGroundbooleanfalseClamp entities to ground

Either data or url must be provided.

loadKml

Load KML/KMZ data source (inline string or remote URL).

ParameterTypeRequiredDefaultDescription
datastringKML document as string (inline)
urlstringURL to KML/KMZ file
idstringautoLayer ID
namestringDisplay name
clampToGroundbooleanfalseClamp entities to ground

Either data or url must be provided.

Interaction

screenshot

Capture the current globe view as an image. No parameters.

Returns: Base64 PNG image (MCP image content type).

highlight

Highlight specific features in a layer.

ParameterTypeRequiredDefaultDescription
layerIdstringLayer ID
featureIndexnumberFeature index (omit to highlight all)
colorstring"#FFFF00"Highlight color (CSS)

measure

Measure distance or area between points on the globe.

ParameterTypeRequiredDefaultDescription
typestring"distance" | "area"
coordinatesnumber[][]Points [[lon, lat], ...] (2 for distance, 3+ for area)

Returns: { type, value, unit, coordinates }

Scene

setSceneOptions

Configure scene environment (fog, atmosphere, shadows, sun, moon, background color, depth testing).

ParameterTypeRequiredDefaultDescription
fogEnabledbooleanEnable/disable fog
fogDensitynumber0.0002Fog density (0.0–1.0)
fogMinimumBrightnessnumberMinimum fog brightness (0.0–1.0)
skyAtmosphereShowbooleanShow sky atmosphere
skyAtmosphereHueShiftnumberSky hue shift (-1.0–1.0)
skyAtmosphereSaturationShiftnumberSky saturation shift (-1.0–1.0)
skyAtmosphereBrightnessShiftnumberSky brightness shift (-1.0–1.0)
groundAtmosphereShowbooleanShow ground atmosphere
shadowsEnabledbooleanEnable shadows
shadowsSoftShadowsbooleanUse soft shadows
shadowsDarknessnumberShadow darkness (0.0–1.0)
sunShowbooleanShow the sun
sunGlowFactornumber1.0Sun glow factor
moonShowbooleanShow the moon
depthTestAgainstTerrainbooleanDepth test against terrain
backgroundColorstringBackground color (CSS format)

setPostProcess

Configure post-processing effects (bloom, SSAO, FXAA).

ParameterTypeRequiredDefaultDescription
bloombooleanEnable bloom glow effect
bloomContrastnumber128Bloom contrast
bloomBrightnessnumber-0.3Bloom brightness
bloomDeltanumber1.0Bloom delta
bloomSigmanumber3.78Bloom sigma
bloomStepSizenumber5.0Bloom step size
bloomGlowOnlybooleanShow only the glow
ambientOcclusionbooleanEnable ambient occlusion (SSAO)
aoIntensitynumber3.0AO intensity
aoBiasnumber0.1AO bias
aoLengthCapnumber0.26AO length cap
aoStepSizenumber1.95AO step size
fxaabooleanEnable FXAA anti-aliasing

Other

playTrajectory trajectory

Animate an entity along a path over time.

ParameterTypeRequiredDefaultDescription
coordinatesnumber[][]Path coordinates [[lon, lat, alt?], ...]
idstringautoTrajectory layer ID
namestringTrajectory name
durationSecondsnumber10Animation duration in seconds
trailSecondsnumber2Trail length in seconds
labelstringMoving entity label

addHeatmap heatmap

Create a heatmap overlay from point data.

ParameterTypeRequiredDefaultDescription
dataobjectGeoJSON Point FeatureCollection
radiusnumber30Heat influence radius in pixels

geocode geolocation

Convert an address, landmark, or place name to geographic coordinates (longitude/latitude). Uses OpenStreetMap Nominatim — no API key required. Supports HTTPS_PROXY / HTTP_PROXY / ALL_PROXY environment variables for proxy.

ParameterTypeRequiredDefaultDescription
addressstringAddress, landmark, or place name, e.g. "Eiffel Tower", "故宫"
countryCodestring2-letter ISO country code to limit search scope (e.g. CN, US, JP)

Returns: { success, longitude, latitude, displayName, boundingBox }

MCP Resources (2)

URIDescription
cesium://scene/cameraCurrent camera state (position, orientation)
cesium://scene/layersList of all loaded layers with metadata

Resources are read-only and can be polled by the AI agent for context-aware decisions.

Environment Variables

VariableDefaultDescription
CESIUM_WS_PORT9100WebSocket server port for bridge connections
DEFAULT_SESSION_IDdefaultWhich browser session to route MCP calls to
CESIUM_TOOLSETS(not set)Toolset activation: omit for defaults, all for everything, or comma-separated list
OSM_USER_AGENTcesium-mcp-runtime/1.0User-Agent header for Nominatim geocode requests
CESIUM_LOCALEenTool description language: en (English, default) or zh-CN (Chinese)

Session Routing

Multiple browser tabs can connect simultaneously. Each bridge instance registers with a sessionId:

Tab 1: sessionId = "project-a"
Tab 2: sessionId = "project-b"

Routing via MCP URL

Add ?session=xxx to the MCP HTTP endpoint URL to route all tool calls to a specific browser:

http://localhost:3216/mcp?session=project-a

This is the recommended approach for third-party integrations (e.g., Dify) — no prompt injection or tool parameter needed.

Routing priority

  1. sessionId in tool parameters (explicit per-call override)
  2. ?session=xxx in MCP HTTP URL (connection-level)
  3. DEFAULT_SESSION_ID environment variable
  4. First connected browser (fallback)

HTTP Push API

For non-MCP integrations (e.g., FastAPI backends), the runtime exposes an HTTP endpoint:

bash
curl -X POST http://localhost:9100/push \
  -H "Content-Type: application/json" \
  -d '{"action": "flyTo", "params": {"longitude": 2.29, "latitude": 48.86, "height": 1000}}'

Common Types

ColorInput

typescript
type ColorInput =
  | string                        // CSS color: "#FF0000", "red", "rgba(255,0,0,0.5)"
  | { red: number; green: number; blue: number; alpha?: number }  // RGBA 0–1

MaterialInput

typescript
type MaterialInput =
  | ColorInput
  | {
      type: "color" | "image" | "checkerboard" | "stripe" | "grid"
      color?: ColorInput
      image?: string
      evenColor?: ColorInput
      oddColor?: ColorInput
      orientation?: "horizontal" | "vertical"
      cellAlpha?: number
    }

PositionDegrees

typescript
type PositionDegrees = {
  longitude: number   // degrees
  latitude: number    // degrees
  height?: number     // meters
}

Released under the MIT License.