
Cesium Mcp Runtime
io.github.gaopengbin由 GitHub 账号 gaopengbin 发布v2.0.0更新于 Nov 7, 2026
Control CesiumJS 3D globes via MCP: camera, layers, entities, animation, and interaction.
概览
把 AI 助手连接到浏览器中的 CesiumJS 三维地球,可移动相机、添加图层与实体并播放动画。
- 可以做什么
- 控制与查询相机:飞往坐标、设置视角、缩放到范围、环绕与定点观察
- 增删改地图实体:标记、标签、模型、多边形、折线、立方体、墙体、圆柱等
- 管理图层与底图:添加带样式的 GeoJSON、切换可见性、改样式、更换底图
- 加载数据服务:3D Tiles、地形、影像服务、矢量瓦片、CZML 与 KML
- 动画与可视化:航点动画、时钟控制、实体跟踪、轨迹、热力图、光照
- 截图与检查:截图、要素高亮、量测,以及场景相机与图层资源
- 适用场景
- 适合让助手交互式搭建或操作三维地理场景,例如在地球上查看数据、生成地图截图,或在 CesiumJS 查看器中演练相机飞行与动画。
- 运行要求
- 通过 npx 或全局 npm 安装本地运行(需要 Node.js)。需在浏览器打开 localhost:9100 的内置查看器,或使用 cesium-mcp-bridge 的自定义页面。CesiumJS 从官方 CDN 加载,需要网络访问。端口、工具集、语言、传输与鉴权可通过环境变量配置。
安装
在 SourceWeft 中
- 打开 控制台中的 Cesium Mcp Runtime,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
cesium-mcp-runtime
Usage statistics are on by default, with a startup notice on stderr. Set CESIUM_TELEMETRY_DISABLED=1, DO_NOT_TRACK=1, or pass --no-telemetry to disable. Collected fields and privacy.
English | 中文
MCP Server that enables AI Agents to control a Cesium globe in real-time via the Model Context Protocol.
Release channel:
latestuses the stable MCP SDK v2 and supports both MCP2025-11-25and2026-07-28from the same stdio/HTTP entry. If you only want to try the "AI + Cesium" feel, examples/browser-agent is the recommended starting point — zero backend, runs in three minutes. See Which mode should I use?.
MCP Apps map panel
openCesiumMap serves an interactive Cesium Viewer through the standard ui://cesium-mcp/map-v10.html MCP Apps resource. The map occupies the primary area and uses the host's existing native chat through ui/message, with no duplicate composer or history. Layout and host theme/locale changes preserve the Viewer, selection and session. The app follows host semantic style variables and fonts, supports Chinese and English, and publishes camera, layers and selected-object context. Local preview controls simulate live host settings and record message delivery. OpenAI global/thread entrypoint and fullscreen hints are included.
The built HTML, embedded Worker graph and Bridge bundle ship in dist. A compatible host must support WebGL and Blob module workers in an isolated, stable UI origin. The embedded panel exchanges commands through app-only MCP tools and does not access a local WebSocket. CESIUM_APP_DOMAIN optionally declares a dedicated UI origin. External browser Viewers retain the existing WebSocket transport.
For a real local MCP Apps preview, run npm run app:preview -w packages/cesium-mcp-runtime from a built repository and open http://127.0.0.1:19311/. See the full guide. Client-specific ChatGPT installation is a separate verification step.
Vector tiles
Enable the tiles toolset with CESIUM_TOOLSETS=view,entity,layer,interaction,tiles or enable_toolset. Use loadVectorTiles for MVT /{z}/{x}/{y} URLs or vector 3D Tiles, click a feature and read getSelectedTileFeature, then update its managed layer using updateLayerStyle with tileStyle.color and tileStyle.lineWidth. Read back getLayerSchema.metadata.tileStyle to verify the applied expressions.
Vector rendering and clamping require CesiumJS 1.147. Clamped line/polygon picking uses an experimental bounded adapter. For external data in an MCP Apps panel, configure exact allowed origins with CESIUM_MAP_DATA_ORIGINS. See the vector tiles guide for source formats, styling and limits.
Architecture
The runtime acts as a bridge between MCP-compatible AI clients (Claude Desktop, VS Code Copilot, Cursor, etc.) and a browser running CesiumJS. It translates MCP tool calls into WebSocket commands that cesium-mcp-bridge executes.
The npm package ships its browser Bridge bundle locally. The built-in Viewer at http://localhost:9100/ therefore does not depend on an unpkg fallback; CesiumJS itself is still loaded from the official Cesium CDN.
For ordinary MCP users this is a one-package setup: run cesium-mcp-runtime and use the built-in Viewer. Install cesium-mcp-bridge separately only when developing a custom CesiumJS page.
Two transport modes are supported:
Install & Run
Then open http://localhost:9100/ to use the built-in Viewer. No separate Bridge installation is required for this default path.
Streamable HTTP Mode
For remote/cloud MCP clients like Dify:
Environment variable alternative:
In HTTP mode, all 62 Cesium command tools are enabled by default (no dynamic toolset discovery needed).
MCP Client Configuration
Network access
Runtime binds to 127.0.0.1 by default, including its HTTP and WebSocket ports.
Local native MCP clients and pages served from localhost continue to work.
Pages opened directly as file:// must instead be served by a local HTTP server.
For remote access, use HTTPS/WSS through a reverse proxy and configure the public hostname and Viewer origin explicitly. For example, set CESIUM_HOST=0.0.0.0, CESIUM_ALLOWED_HOSTS=maps.example.com, CESIUM_ALLOWED_ORIGINS=https://maps.example.com, and a generated CESIUM_AUTH_TOKEN in the server environment. Preserve the public Host header and WebSocket upgrades in the proxy.
MCP HTTP and REST clients send Authorization: Bearer <token>. The built-in Viewer asks for the connection token when authentication is enabled; it keeps the token in the page only. Custom browser bridges authenticate with WebSocket subprotocols:
Do not put credentials in query strings. Reverse proxies must not log Authorization or Sec-WebSocket-Protocol headers. The Viewer HTML and Bridge script are public assets; protected APIs and WebSocket upgrades still require the token. Secondary local Runtime instances must use the same token to relay to an existing instance. Browser session IDs select a Viewer; they are not credentials.
Claude Desktop
VS Code (Copilot)
In .vscode/mcp.json:
Cursor
In .cursor/mcp.json:
MCP Tools (62 command tools + 2 discovery meta-tools)
Tools are organized into 12 toolsets. By default, 4 core toolsets are enabled (30 tools). Additional toolsets can be activated via environment variable or dynamically by the AI agent at runtime. Shared titles, behavior annotations, localized descriptions, defaults, input validation, advertised output schemas, and structured results are generated from the canonical JSON Schemas in cesium-mcp-contracts. Tool calls also retain text content for older clients.
Toolsets Overview
Toolset Configuration
Dynamic Discovery (meta-tools)
When not in all mode, two meta-tools are always available so the AI can discover and activate additional capabilities on demand:
View
Entity
Layer
Camera (toolset: camera)
Extended Entity Types (toolset: entity-ext)
Animation (toolset: animation)
Tiles & Data (toolset: tiles)
Interaction (toolset: interaction)
Other
MCP Resources
Environment Variables
Browser-Side Setup
Your browser page needs to connect to the runtime via WebSocket and relay commands to cesium-mcp-bridge:
Session Routing
Multiple browser tabs can connect to a single runtime using different session IDs:
Routing via MCP URL (recommended for Dify / third-party integrations)
Add ?session=xxx to the MCP HTTP endpoint URL:
All tool calls from that connection are automatically routed to the matching browser — no need to inject sessionId into prompts or tool parameters.
Routing priority
sessionIdin tool parameters (explicit per-call override)?session=xxxin MCP HTTP URL (connection-level)DEFAULT_SESSION_IDenvironment variable- First connected browser (fallback)
Explicit routing is fail-closed: when a tool parameter or MCP URL names a session that is missing or disconnected, the call returns an error instead of running against another Viewer. The default/first-connected fallback applies only when the caller did not explicitly select a session. Pending responses are also accepted only from the browser that received the command, and are rejected immediately if that browser disconnects.
Resource Handles
The runtime always registers storeResource, listResources, and deleteResource. Store large GeoJSON or CZML once, then pass the returned resourceId to addGeoJsonLayer, addGeoJsonPrimitive, addLabel, addHeatmap, or loadCzml.
Resources are isolated by the same browser sessionId used for command routing. They expire after 30 minutes by default and are never forwarded to the browser until a consuming tool resolves the handle. Existing inline data and remote url inputs remain compatible.
See the resource handle guide.
HTTP Push API
The runtime also exposes an HTTP endpoint for non-MCP integrations (e.g., FastAPI backend):
Compatibility
The stable release serves both protocol generations from the same stdio/HTTP
entry using @modelcontextprotocol/server and
@modelcontextprotocol/node 2.0.0 packages.
The repository pins the official conformance runner separately and validates
the 2026-07-28 server-stateless scenario with:
Conformance-only diagnostic tools are enabled only for that command. They are not registered by normal stdio, HTTP, or browser-demo runtime startup.
License
MIT
来源:packages/cesium-mcp-runtime/README.md,提交 6572b72
工具
0版本历史
5- v2.0.0最新Nov 7, 2026
- v1.147.0Oct 10, 2026
- v1.146.0Sep 28, 2026
- v1.145.3Sep 17, 2026
- v1.145.1Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分