feat: add terrain-server MCP server#30
Merged
Merged
Conversation
Add a new MCP server for managing terrain providers on the CesiumJS globe. Server (servers/terrain-server/): - terrain_set: Set terrain from Cesium Ion assets, direct URLs, or flat ellipsoid - terrain_get: Query current terrain provider info and capabilities - terrain_remove: Reset terrain to flat WGS84 ellipsoid - Zod v4 schemas for input validation and response structure - 31 unit tests covering schemas, tools, and client manager Client (test-applications/packages/client-core/): - CesiumTerrainManager with setTerrain, getTerrain, removeTerrain handlers - Terrain type definitions extending MCPCommandResult - Unit tests with full Cesium module mocking Integration: - Port 3007, following existing server conventions - Registered in monorepo build/dev/test scripts - Added to web app configuration and esbuild defines - Updated parent README with terrain server documentation Closes CesiumGS#29
5cf242d to
3bb689c
Compare
Contributor
|
@gaopengbin Looks good! Thanks for contribution. I will add a small demo showing terrain mcp capabilities into README and will merge the PR. |
MKartaviciute
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new MCP server for managing terrain providers on the CesiumJS globe.
terrain_mcp_server.mp4
Closes #29
New Tools
terrain_setterrain_getterrain_removeSource Types
ion— Cesium Ion terrain assets (e.g., Cesium World Terrain with asset ID 1)url— Direct terrain server URLs (quantized-mesh endpoints)ellipsoid— Flat WGS84 ellipsoid with no terrain elevationTerrain Options
requestVertexNormals— Request vertex normals for lighting (default: true for ion/url)requestWaterMask— Request water mask data for water effects (default: false)requestMetadata— Request terrain metadata (default: true)Changes
Server (
servers/terrain-server/)Client (
test-applications/packages/client-core/)CesiumTerrainManagerimplementingManagerInterfacesetTerrain: CreatesCesiumTerrainProvider(Ion/URL) orEllipsoidTerrainProvidergetTerrain: Reads current provider metadata and capabilitiesremoveTerrain: Resets toEllipsoidTerrainProviderMCPCommandResultIntegration
Testing
Architecture Note
Unlike imagery layers (collection-based, indexed), terrain is a singleton — the viewer has one
terrainProviderat a time. This simplifies the API to set/get/remove without needing ID tracking or ordering.