Skip to main content
Glama
CityEngine Cloud MCP Server

CityEngine Cloud MCP Server

CityEngine Cloud MCP Server & Tools

Text-to-3D city buildings in one sentence: natural language → CGA rules → cloud engine → glTF/glb — plus demo browsing and quota lookup. Read-only compute endpoints only.

This repository contains two complementary packages:

Package

What it is

Use it with

cityengine-mcp (repo root)

MCP server (stdio, FastMCP)

kimi code, Codex CLI, Claude Desktop, any MCP client

cityengine-tools/

OpenAI-compatible function-calling toolkit (schemas + client)

DeepSeek, Qwen, GLM, GPT and any OpenAI-style tool-calling API

Live demos and self-service API keys: https://www.cityengine.cn/plugins.html · API contract: https://api.cityengine.cn

Tools (6)

Tool

Description

Quota

generate_cga

Natural language → CGA rule source (sync, no rendering); supports base_cga + instruction refinement

NL quota

parse_cga

CGA source + attributes → engine parse → 3D model stats + glb download (sha256 verified)

generate quota

generate_model

Natural language → ready 3D model (NL2CGA + parse chained), returns cga_source too

NL + generate

list_demos

List showcase demos on the official site (id/name/engine/attribute count)

free

get_demo

Inspect a demo's attribute panel, node/material counts, engine timing

free

get_quota

Current key's plan and quota usage

free

All endpoints are read-only compute calls — nothing writes to your account or the site.

Related MCP server: QCAD MCP

Install (MCP server)

pip install cityengine-mcp        # or: pip install .  from this repo
# provides the `cityengine-mcp` console script; or run: python -m cityengine_mcp.server

Requirements: Python ≥ 3.10, mcp 1.x, httpx.

Get an API key

Keys use the cvk_ prefix. Two self-service ways:

  1. Website: register/log in at https://www.cityengine.cn → User Center → "插件 Key" → issue (shown once, save it).

  2. CLI:

curl -X POST https://api.cityengine.cn/v1/register \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"strong-password","nickname":"optional"}'
# the response api_key is your plugin key (shown in full only once)

Free tier: 5 NL generations/month, 100 model generations/day. Paid members: unlimited NL.

Configure your MCP client

Environment variables:

Variable

Required

Default

Purpose

CITYENGINE_API_KEY

yes

—

plugin API key (cvk_…)

CITYENGINE_GATEWAY_BASE

no

https://api.cityengine.cn

gateway base URL

CITYENGINE_DEMOS_BASE

no

https://www.cityengine.cn

demo listing site

CITYENGINE_OUTPUT_DIR

no

./cityengine_mcp_output

where glb files land

CITYENGINE_MAX_POLL_S

no

300

render job poll cap (seconds)

Generic MCP client config:

{
  "mcpServers": {
    "cityengine": {
      "command": "python",
      "args": ["-m", "cityengine_mcp.server"],
      "env": { "CITYENGINE_API_KEY": "cvk_xxx" }
    }
  }
}

Ready-made snippets for kimi code, Codex CLI and Claude Desktop live in config-examples/.

OpenAI-compatible function calling (cityengine-tools/)

pip install ./cityengine-tools
from cityengine_tools import CityEngineTools
tools = CityEngineTools(api_key="cvk_xxx")
# pass tools.schemas() as the `tools` parameter of any OpenAI-compatible chat call;
# feed tool_calls back into tools.dispatch(...) to execute them.

JSON schemas for all six tools are in cityengine-tools/schemas/.

License

MIT (see LICENSE). The packages are client SDKs; generated models and CGA output are governed by your cityengine.cn plan terms.

Available Tools

6 tools
generate_cgaA

自然语言一句话 → NL2CGA → CGA 规则源码(不渲染,同步返回)。

两种模式二选一:

  1. text:自然语言描述,如「三层小楼,坡屋顶,底层商铺」。

  2. base_cga + instruction:在既有 CGA 上按指令修改(如「把立面材质改成红砖」)。

LLM 兜底模式最长约 90s,属正常现象。

Returns: cga_source(可喂给 parse_cga / generate_model 的 cga_edit 回传)、 engine_path(self/kimi_fallback/hybrid)、warnings、usage。

Inputs: text, base_cga, instruction.

generate_modelB

自然语言一句话 → 直接生成三维模型(NL2CGA + 引擎解析一键串联)。

两种模式二选一:

  1. text:自然语言描述,如「生成一栋 12 层现代玻璃幕墙办公楼」。

  2. base_cga + instruction:回传既有 CGA + 修改指令,二次生成再出模型。

Args:(其余参数同 parse_cga)

Returns: cga_source(供后续 cga_edit 回传)、模型统计、glb 本地路径、 签名下载地址、sha256、usage、warnings。

Inputs: seed, text, base_cga, timeout_s, +5 more.

get_demoA

查看某个官网 demo 案例的详情:属性面板定义、材质数、节点数、引擎耗时。

注意:demo 的 CGA 源码属付费内容(官网商城),本工具返回公开快照信息 (属性 schema / 规模 / 引擎指标),适合做参数设计参考。

Args: demo_id: list_demos 返回的 id,如 building-glass-20260928。

Inputs: demo_id (required).

get_quotaA

查询当前 API key 的套餐、额度用量(generate/NL2CGA)与限流参数。

Inputs: no named parameters.

list_demosA

列出 CityEngine 官网首页的 demo 案例(id、名称、引擎、来源日期、属性个数)。

返回条目可传给 get_demo 查看属性面板细节。

Inputs: no named parameters. Returns: result

parse_cgaA

用 CityEngine 引擎解析 CGA 规则源码,生成三维模型(glTF/glb)。

Args: cga_source: CGA 规则源码全文(手写或 generate_cga 的产物)。 attributes: CGA attr 覆盖,如 {"height": 30};键必须在规则的 attr 声明内。 initial_shape: 初始地块多边形 {"type":"Polygon","pts":[[x,z],...]},米制; 缺省用 30m x 20m 调试地块。 seed: 随机种子,固定后可复现结果。 download_glb: 是否把 glb 下载到本地(默认 True)。 output_dir: glb 落盘目录(默认环境变量 CITYENGINE_OUTPUT_DIR 或当前目录下 cityengine_mcp_output/)。 timeout_s: 轮询 job 的最长秒数(上限 300)。

Returns: job_id、模型统计(nodes/vertices/triangles/textures_embedded)、glb 本地路径、 签名下载地址(24h 有效)、sha256、计费用量、告警列表。

Inputs: cga_source (required), seed, timeout_s, attributes, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation4/5

    parse_cga, generate_cga, and generate_model have related purposes, but descriptions clearly delineate them (parse renders CGA, generate_cga returns only source, generate_model chains both). The generate_model/generate_cga overlap could still cause some misselection when an agent just wants a model.

    Naming Consistency5/5

    All names follow a consistent verb_noun snake_case pattern (parse_cga, generate_cga, generate_model, list_demos, get_demo, get_quota). No mixed conventions or vague verbs.

    Tool Count5/5

    Six tools is well-scoped for a CGA generation/rendering service, with each tool earning a distinct role. Nothing feels padded or missing at the count level.

    Completeness4/5

    The core lifecycle (NL→CGA, CGA→model, combined flow) plus demos and quota is covered. Minor gaps exist around job lifecycle management (no cancel/list jobs) and standalone model retrieval, but agents can work around these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Open-source MCP server for Autodesk Revit 2022 to 2027: read, audit and edit live models with 89 tools, one Undo entry per change, and a workstation read-only lock.
      89
      15
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to automate 2D architectural drafting and CAD file management, including DXF/DWG parsing, SVG/PNG/PDF rendering, wall extrusion to 3D STL meshes, room and beam analysis, block/script library access, and persistent depot storage via a REST API and MCP tools.
      18
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables LLM agents to author EisenScript procedural grammars and render them headlessly into Wavefront OBJ meshes, returning vertex/face counts and bounding boxes alongside validation, linting, PNG previews, mesh-format conversion, batch gallery rendering, and Unreal import.
      12
      MIT