Skip to main content
Glama

Neon3 AI 创作 MCP

教会 AI 正确构建 Neon3 界面,然后让 Neon3 来验证结果。

License

一个 MCP 服务端、详细的创作 Skill 以及 Python/Node 入门套件,用于 Neon3。它整合了三层:

Skill                 durable NUI Flow rules and design boundaries
MCP resources/tools   searchable references, live capability discovery, orchestration
Neon3 runtime         authoritative parser, compiler, revision, and renderer feedback

MCP 永远不会发明第二套 UI 语言。neon3_nui_validate 调用生产环境的 neon-ui-runtime 解析器/编译器,而实时变更则使用现有的长度前缀 neon3.rpc 契约。

亮点

领域

包含内容

NUI 流程

V1 语法、类型化输入、布局、控件、事件、分支、状态图、拖放、世界面板

AI 工作流

validate、inspect、submit、snapshots、capabilities、diagnostics

运行时安全

回环 RPC、请求 ID、受限应用路径、固定进程配置、超时

应用代码

使用官方 Neon3 封套的 Python 和 Node 模板

文档

MCP 资源外加一个独立的 OpenCode 兼容 Skill

Related MCP server: Flowcore Platform MCP Server

环境要求

  • Node.js 20 或更高版本。

  • Neon3 已检出到 Windows 上的 D:\Neon3,或通过 NEON3_ROOT 指定其他检出路径。

  • 构建一次 Neon3 创作探针:

cd D:\Neon3
cargo build -p neon-ui-runtime --bin neon3_authoring_probe

该探针是这个 MCP 包与具体 Neon3 检出之间的兼容性桥梁。它返回结构化 JSONL,并使用与运行中 UI 运行时相同的解析器/编译器。

从源码安装

git clone https://github.com/unco999/neon3-ai-authoring-mcp.git
cd neon3-ai-authoring-mcp
npm install
npm link

该命令现在以 neon3-mcp 形式提供。

从 npm 安装

发布后可执行:

npm install -g @neon3/ai-authoring-mcp
neon3-mcp

如需固定本地安装:

npm install --save-dev @neon3/ai-authoring-mcp
npx neon3-mcp

OpenCode 配置

添加一个 MCP 条目到原始配置:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "neon3": {
      "type": "local",
      "command": ["neon3-mcp"],
      "enabled": true,
      "environment": {
        "NEON3_ROOT": "D:\\Neon3",
        "NEON3_UI_ENDPOINT": "127.0.0.1:39102",
        "NEON3_WGPU_ENDPOINT": "127.0.0.1:39103",
        "NEON3_PROJECTD_ENDPOINT": "127.0.0.1:39104"
      }
    }
  }
}

将 skill/SKILL.md 复制到宿主的 skill 目录,或者将此仓库添加 为 skill 源。Skill 与 MCP 服务端相互独立,方便 Neon3 离线时 创作规则仍然可用。

MCP 还将同样的内容开放为资源:

neon3://skill
neon3://references/overview
neon3://references/grammar
neon3://references/components
neon3://references/statecharts
neon3://references/interactions
neon3://references/diagnostics

Claude Desktop / MCP 客户端

{
  "mcpServers": {
    "neon3": {
      "command": "neon3-mcp",
      "env": {
        "NEON3_ROOT": "D:\\Neon3",
        "NEON3_UI_ENDPOINT": "127.0.0.1:39102"
      }
    }
  }
}

工具

工具

用途

neon3_nui_reference

阅读一个详细、权威的语法主题

neon3_nui_validate

解析并编译而不去改变 Neon3

neon3_nui_inspect

返回规范化 IR、schema、稳定节点、绑定与预算

neon3_nui_submit

先校验,再经由 ui-runtime 提交

neon3_capabilities

查询当前离线服务能力与版本

neon3_ui_snapshot

读取 UI 状态与修订信息

neon3_project_assets

读取项目摘要与稳定的 AssetRef 值

neon3_diagnose

关联服务快照与交互追踪

neon3_app_init

创建有边界的 Python 或 Node 应用

neon3_app_run

带超时、使用固定应用画像运行

neon3_app_test

运行确定性的本地应用检查

创作循环

reference -> capabilities -> generate NUI -> validate -> inspect -> submit -> diagnose

一个合法、类型化、有语义的 NUI 示例:

version 1
surface surface.example revision 1
budget nodes=32 bindings=16 instances=16 text=16 glyphs=1024 events=8 clips=64
input title text default text:empty
input can_save bool default false
surface root column w 520 h 240 gap 8 pad 16
  text heading value $title
  button save value "Save" enabled $can_save event document.save

英文翻译过程中保留 NUI Flow。

模板

templates/python-app 和 templates/node-app 包括:

  • neon3.app.json 应用元数据

  • ui/main.nui 类型化声明式 UI

  • 一个极简、带长度前缀的 RPC 客户端

  • 一个确定性协议测试或语法检查

neon3_app_init 工具只写入 NEON3_APP_ROOT(或者在该变量未设置时使用当前工作目录)以下的路径。

无需在线运行时校验 NUI

$source = [string]::Join("`n", (Get-Content .\templates\node-app\ui\main.nui))
$request = @{ request_id = "manual-1"; operation = "validate"; sequence = 1; source = $source } | ConvertTo-Json -Compress
$request | cargo run --quiet -p neon-ui-runtime --manifest-path D:\Neon3\Cargo.toml --bin neon3_authoring_probe

该进程输出 JSONL。解析或编译失败时返回退出码 1,并包含稳定的诊断信息和源码位置。

启动 Neon3 无头服务

请使用现有的 Neon3 启动器。MCP 不会静默创建第二个渲染器:

cd D:\Neon3
scripts\run-neon-services.ps1

然后从 AI 客户端调用 neon3_capabilities、neon3_ui_snapshot 或 neon3_nui_submit。

配置

变量

默认值

含义

NEON3_ROOT

D:\Neon3

用来构建/运行创作探针的 Neon3 检出

NEON3_AUTHORING_PROBE

auto

可执行文件路径的绝对覆盖

NEON3_UI_ENDPOINT

127.0.0.1:39102

UI 运行时 RPC 端点

NEON3_WGPU_ENDPOINT

127.0.0.1:39103

WGPU 运行时 RPC 端点

NEON3_PROJECTD_ENDPOINT

127.0.0.1:39104

项目管理 RPC 端点

NEON3_APP_ROOT | 当前目录

生成应用进程所允许的根目录用于生成的应用进程

所有在线端点必须是回环端点。MCP 不提供任意 shell 命令工具。

故障排除

创作探针无法启动

cd D:\Neon3
cargo build -p neon-ui-runtime --bin neon3_authoring_probe
$env:NEON3_ROOT = 'D:\Neon3'

revision_conflict

调用 neon3_ui_snapshot,使用返回的权威修订,然后重新提交。请勿盲目重试过期的变更。

某个服务不可达

在 neon3_capabilities 中检查相应端口。通过 scripts\run-neon-services.ps1 启动 Neon3,或对于窗口化的场景使用 neon-dev。

开发

npm install
npm test
node --check src/index.js
npm pack --dry-run

协议测试使用一个确定性的本地假设 Neon3 端点,并验证请求 ID、帧格式和结构化 JSON 输出。真正的 NUI 边界由 Neon3 仓库中的 neon3_authoring_probe 验证。

项目关系

本仓库是 AI 集成层。Neon3 依然是协议、NUI 语法、UI 运行时、WGPU 运行时和项目权威的持有者:

  • MCP:https://github.com/unco999/neon3-ai-authoring-mcp

  • Neon3:https://github.com/unco999/Neon3-CiJian

许可证

MIT。见 [LICENSE](LIC# Neon AI 创作 MCP

教 AI 正确构建 Neon3 界面,然后让 Neon3 验证结果。

License

一个 MCP 服务端、详细的创作 Skill,以及 Neon3 的 Python/Node 入门套件。它将三层结合:

Skill                 durable NUI Flow rules and design boundaries
MCP resources/tools   searchable references, live capability discovery, orchestration
Neon3 runtime         authoritative parser, compiler, revision, and renderer feedback

MCP 永远不会发明第二种 UI 语言。neon3_nui_validate 调用生产环境的 neon-ui-runtime 解析器/编译器,而在线变更则使用现有的长度前缀型 neon3.rpc 契约。

亮点

领域

包含内容

NUI 流程

V1 语法、类型化输入、布局、控件、事件、分支、状态图、拖拽、球体面板

AI 工作流

validate、inspect、submit、snapshots、capabilities、diagnostics

运行时安全

回环 RPC、请求 ID、受限应用路径、固定进程配置文件、超时

应用代码

使用官方 Neon3 封套的 Python 和 Node 模板

文档

MCP 资源外加独立的 OpenCode 兼容 Skill

要求

  • Node.js 20 或更高版本。

  • Neon3 已克隆至 Windows 上的 D:\Neon3,或设置 NEON3_ROOT 指向其他克隆目录。

  • 构建 Neon3 authoring probe 一次:

cd D:\Neon3
cargo build -p neon-ui-runtime --bin neon3_authoring_probe

该 probe 是此 MCP 包与具体 Neon3 克隆之间的兼容性桥接。它返回结构化 JSONL,并使用与运行中的 UI 运行时相同的解析器/编译器。

从源码安装

git clone https://github.com/unco999/neon3-ai-authoring-mcp.git
cd neon3-ai-authoring-mcp
npm install
npm link

该命令现在可以以 neon3-mcp 名称使用。

从 npm 安装

发布后:

npm install -g @neon3/ai-authoring-mcp
neon3-mcp

对于固定本地安装:

npm install --save-dev @neon3/ai-authoring-mcp
npx neon3-mcp

OpenCode 配置

为你的 OpenCode 配置添加一个 MCP entry:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "neon3": {
      "type": "local",
      "command": ["neon3-mcp"],
      "enabled": true,
      "environment": {
        "NEON3_ROOT": "D:\\Neon3",
        "NEON3_UI_ENDPOINT": "127.0.0.1:39102",
        "NEON3_WGPU_ENDPOINT": "127.0.0.1:39103",
        "NEON3_PROJECTD_ENDPOINT": "127.0.0.1:39104"
      }
    }
  }
}

将 skill/SKILL.md 复制到宿主机的 skill 目录,或将此仓库添加为 skill 来源。Skill 与 MCP 服务器分开,这样即使 Neon3 离线,其创作规则仍然可用。

MCP 还以资源形式提供相同材料:

neon3://skill
neon3://references/overview
neon3://references/grammar
neon3://references/components
neon3://references/statecharts
neon3://references/interactions
neon3://references/diagnostics

Claude Desktop / MCP Clients

{
  "mcpServers": {
    "neon3": {
      "command": "neon3-mcp",
      "env": {
        "NEON3_ROOT": "D:\\Neon3",
        "NEON3_UI_ENDPOINT": "127.0.0.1:39102"
      }
    }
  }
}

工具

工具

目的

neon3_nui_reference

读取详细的权威语法主题

neon3_nui_validate

不修改 Neon3 的情况下解析并编译

neon3_nui_inspect

返回规范化 IR、schema、稳定节点、绑定和预算

neon3_nui_submit

校验,然后通过 ui-runtime 提交

neon3_capabilities

查询当前服务能力和时期

neon3_ui_snapshot

读取 UI 状态和修订信息

neon3_project_assets

读取项目摘要和稳定的 AssetRef 值

neon3_diagnose

关联服务快照和交互日志

neon3_app_init

创建有边界的 Python 或 Node 应用程序

neon3_app_run

通过一个固定应用配置文件运行,带超时

neon3_app_test

运行确定性的本地应用检查

创作循环

reference -> capabilities -> generate NUI -> validate -> inspect -> submit -> diagnose

有效且类型化的语义 NUI 示例:

version 1
surface surface.example revision 1
budget nodes=32 bindings=16 instances=16 text=16 glyphs=1024 events=8 clips=64
input title text default text:empty
input can_save bool default false
surface root column w 520 h 240 gap 8 pad 16
  text heading value $title
  button save value "Save" enabled $can_save event document.save

NUI 流程不得包含 fetch、回调、Python 代码、文件路径、坐标、GPU 句柄或任意表达式。

模板

templates/python-app 和 templates/node-app 包括:

  • neon3.app.json 应用元数据

  • ui/main.nui 类型化声明式 UI

  • 一个最小的长度前缀 RPC 客户端

  • 确定性协议测试或语法检查

neon3_app_init 工具仅写入 NEON3_APP_ROOT(或当未设置时当前工作目录)允许的区域。

在没有实时运行环境的情况下校验 NUI

$source = [string]::Join("`n", (Get-Content .\templates\node-app\ui\main.nui))
$request = @{ request_id = "manual-1"; operation = "validate"; sequence = 1; source = $source } | ConvertTo-Json -Compress
$request | cargo run --quiet -p neon-ui-runtime --manifest-path D:\Neon3\Cargo.toml --bin neon3_authoring_probe

流程输出 JSONL。若解析或编译失败,则返回退出码 1,并包含稳定的诊断和源代码位置信息。

启动 Neon3 无头服务

使用现成的 Neon3 启动器。MCP 不会静默创建第二个渲染器:

cd D:\Neon3
scripts\run-neon-services.ps1

然后从 AI 客户端调用 neon3_capabilities、neon3_ui_snapshot 或 neon3_nui_submit。

cd D:\Neon3
cargo build -p neon-ui-runtime --bin neon3_authoring_probe
$env:NEON3_ROOT = 'D:\Neon3'

revision_conflict

调用 neon3_ui_snapshot,使用返回的权威修订版本,然后重新提交。不要盲目重试过期的变更。

服务不可达

在 neon3_capabilities 中检查端点。使用 scripts\run-neon-services.ps1 启动 Neon3,或使用 neon-dev 用于窗口运行。

开发

npm install
npm test
node --check src/index.js
npm pack --dry-run

协议测试使用一个确定性的本地假 Neon3 端点,并验证请求 ID、帧 和结构化 JSON 输出。真正的 NUI 边界由 Neon3 仓库中的 neon3_authoring_probe 验证。

项目关系

此仓库是 AI 集成层。Neon3 仍然是协议、NUI 语法、UI 运行时、WGPU 运行时和项目权限的所有者:

  • MCP:https://github.com/unco999/neon3-ai-authoring-mcp

  • Neon3:https://github.com/unco999/Neon3-CiJian

许可

MIT。参见 LICENSE。

Available Tools

11 tools
neon3_app_initB

Create a bounded Python or Node Neon3 application template. Files are written only below NEON3_APP_ROOT.

Inputs: runtime (required), destination (required), overwrite.

neon3_app_runC

Run a generated Python or Node app with a fixed executable profile and bounded timeout.

Inputs: cwd (required), runtime (required), args, entry, +1 more.

neon3_app_testA

Run the generated app's deterministic local protocol checks without contacting a live Neon3 service.

Inputs: cwd (required), runtime (required), timeout_ms.

neon3_capabilitiesC

Query service.describe from Neon3 services and return their current capabilities and epochs.

Inputs: ui_endpoint, wgpu_endpoint, projectd_endpoint.

neon3_diagnoseC

Aggregate service snapshots, UI revisions, and interaction trace for a Neon3 authoring issue.

Inputs: ui_endpoint, wgpu_endpoint, interaction_id.

neon3_nui_inspectC

Return the canonical IR, typed input schema, state machines, stable node outline, bindings, and budgets for NUI Flow.

Inputs: source (required).

neon3_nui_referenceB

Read the authoritative Neon3 NUI Flow V1 reference. Topics: overview, grammar, components, statecharts, interactions, diagnostics.

Inputs: topic (required).

neon3_nui_submitC

Validate NUI Flow locally, then submit it through ui-runtime to the WGPU runtime.

Inputs: source (required), ui_endpoint, idempotency_key, expected_revision.

neon3_nui_validateB

Parse and compile NUI Flow with Neon3's production parser/compiler. Never submit automatically.

Inputs: source (required).

neon3_project_assetsC

Read project summary and stable AssetRef entries from projectd.

Inputs: projectd_endpoint.

neon3_ui_snapshotC

Read the current UI runtime snapshot, including active fragment and input revisions.

Inputs: ui_endpoint.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool addresses a distinct stage or resource: reference docs, validation, IR inspection, submission, project assets, capabilities, UI snapshot, app template lifecycle, and diagnostics. There is no meaningful overlap, and validate/inspect/submit are clearly separated by compile, inspect, and runtime submission roles.

    Naming Consistency4/5

    All tool names share the neon3_ prefix and use snake_case, which is consistent and readable. However, the set mixes noun-style names like nui_reference and ui_snapshot with verb-style names like nui_validate and app_run, so the naming pattern is not perfectly uniform.

    Tool Count5/5

    11 tools is a well-scoped count for a Neon3 authoring/debugging server. Each tool provides a distinct capability needed for the domain without redundant or superfluous entries.

    Completeness4/5

    The core workflow is well covered: reference, validate, inspect, submit, create/run/test app templates, and diagnose issues. Minor gaps exist, such as no explicit update/delete for app templates and no write access to project assets, but these do not block the primary authoring flow.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers