Skip to main content
Glama

jsonui-render-mcp

一个绘制 Minecraft Bedrock JSON UI 界面的 MCP 服务器,这样资源包的布局无需设备即可查看。

它读取你生成的资源包和 Mojang 的真实 UI 文件,展开 @ 继承和 $variables,并报告任何未实现的内容,而不是猜测。

设置

pip install mcp pillow

然后调用一次 setup_samples 工具。它会稀疏克隆 Mojang/bedrock-samples 以获取原版 UI 定义和纹理。这里不包含 Mojang 的任何内容。

环境变量:

变量

默认值

用途

BEDROCK_SAMPLES

~/.cache/bedrock-samples

上面的克隆

MINECRAFT_FONT

~/.aseprite-mcp/fonts/minecraft

包含 font.json、ascii.png 的文件夹

注册它:

{
  "mcpServers": {
    "jsonui-render": {
      "command": "python3",
      "args": ["/path/to/jsonui-render-mcp/server.py"]
    }
  }
}

Related MCP server: Datapack MCP Server

工具

工具

用途

setup_samples

克隆 Mojang 的 UI 文件

list_screens

资源包 dump 定义的界面

render_screen

绘制一个界面,包含表单的标题和图标

render_control

按名称绘制任意控件,包括 Mojang 自己的

check_anchors

将锚点规则约束到 Mojang 的对话框

资源包 dump

render_screen 读取你的构建写入的目录:

controls.json          name -> control
screens.json           [{name, width, height, body, title, background, marker}]
textures/*.png         your own textures, flat
textures/nineslice.json   name -> border, as an int or [l, t, r, b]

两件值得知道的事

  • layer 对同级组排序,不涉及更广的范围。屏幕级深度和累积式深度看起来都合理,但两者都与设备不一致。

  • 锚点规则是:子元素的 anchor_to 点落在父元素的 anchor_from 点上,然后应用偏移。check_anchors 让渲染器遵守这一规则。

尚未实现的功能

  • 除表单标题和纹理之外的绑定。

  • %cm 被读取为内容大小,而不是最大的子元素。

  • 物品图片仅来自原版路径。

设备仍然是事实来源。当两者不一致时,这个渲染器是错的。

Related MCP Connectors

Related MCP Servers