fgui-agent-bridge
This server enables AI agents to interact with the FairyGUI Editor through MCP, providing tools to programmatically inspect, modify, and publish UI components.
Key capabilities include:
Project & Package Management: Connect to FairyGUI projects, list all packages and resources with type filtering, and get project status.
Document Operations: Open, save, save all, or discard component documents, and navigate the object tree.
Component & Resource Creation: Create new components with configurable size and options, generate standard buttons (common, check, radio), and import images with conflict policies.
UI Element Interaction: Select objects by ID, name, or path; modify whitelisted properties; insert existing
ui://resources; and remove non-root objects.History & Undo/Redo: Undo/redo agent-specific property transactions with fallback to native history, and view history stacks.
Publishing: Retrieve publish settings and export packages (active, selected, or all) with options for branch and saving before publish.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@fgui-agent-bridgeCreate a new component called MainMenu in package UI and open it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FairyGUI Agent Bridge
通过 MCP 或 CLI,让 CodeX之类的Agent 以结构化指令操作 FairyGUI Editor,从而实现自动拼UI界面
版本:
0.6.0队列协议:
1.0已验证 FairyGUI Editor:
6.1.4通信:本地 JSON 队列 + MCP stdio
Bridge 仓库与 FairyGUI 工程分开存放。FairyGUI 工程只需要安装插件;使用 Codex 时可额外安装 Skill。
依赖
Python
3.10+FairyGUI Editor
使用 Codex MCP 时需要
codex命令
Related MCP server: Funplay MCP for Unity
AI 安装
将下面的提示词复制给能够操作本地终端和文件的 AI 编程 Agent(例如 Codex)
请帮我在这台电脑上完整安装 FairyGUI Agent Bridge。你可以执行终端命令和编辑本地文件,请实际完成安装,不要只给操作说明。
源仓库:https://github.com/Wilson520403/fgui-agent-bridge.git
目标 FairyGUI 工程:优先从当前工作区自动查找 .fairy 文件;找不到或找到多个时停下来询问我。
目标代码仓库:当前工作区;人类安装
1. 获取 Bridge
git clone https://github.com/Wilson520403/fgui-agent-bridge.git
cd fgui-agent-bridge
uv sync --frozen目录选择安装需要使用最新 main 分支;v0.6.0 标签不包含 --choose-project。
2. 安装 FairyGUI 插件
运行下面的命令,在弹出的窗口中选择 FairyGUI 工程目录:
uv run python scripts/sync_to_project.py --choose-project --apply脚本会先检查工程,再将插件安装到 plugins/agent-bridge/。无效目录或取消选择时不会写入文件。
也可以直接指定路径:
uv run python scripts/sync_to_project.py \
--project /ABSOLUTE/PATH/TO/FAIRYGUI-PROJECT \
--apply--project 支持 .fairy 文件、FairyGUI 工程目录,或包含 FairyGUI/FairyGUI.fairy 的仓库目录。
然后重新打开 FairyGUI 工程。插件运行时目录 .agent/ 会自动创建,不要提交到 Git。
3. 注册 Codex MCP(可选)
codex mcp add fgui \
--env FGUI_PROJECT_PATH=/ABSOLUTE/PATH/TO/FAIRYGUI-PROJECT \
-- uv run --project /ABSOLUTE/PATH/TO/FGUI-AGENT-BRIDGE fgui-agent-mcp检查配置:
codex mcp get fgui修改配置后,新建一个 Codex 任务即可重新发现工具。
也可以参考仓库根目录的 .mcp.example.json 手动配置。
4. 验证
先打开 FairyGUI 工程,再执行:
uv run --project /ABSOLUTE/PATH/TO/FGUI-AGENT-BRIDGE \
fgui-agent \
--project /ABSOLUTE/PATH/TO/FAIRYGUI-PROJECT \
ping也可以先查看状态:
uv run --project /ABSOLUTE/PATH/TO/FGUI-AGENT-BRIDGE \
fgui-agent --project /ABSOLUTE/PATH/TO/FAIRYGUI-PROJECT status连接失败时,优先检查:FairyGUI 工程是否打开、plugins/agent-bridge/main.js 是否存在,以及 .agent/bridge.log。
可选:安装 Codex Skill
Skill 不是 MCP 的必需项。需要时,将仓库中的:
.agents/skills/fgui-agent-bridge/直接复制到目标代码工程的:
<目标工程>/.agents/skills/fgui-agent-bridge/不需要单独运行安装脚本。
常用 CLI
以下命令均可在 Bridge 仓库目录执行;也可以为 fgui-agent 添加 --project PATH。
uv run fgui-agent status
uv run fgui-agent ping
uv run fgui-agent project
uv run fgui-agent packages
uv run fgui-agent items ViewHub
uv run fgui-agent open ViewHub ViewHubBtnItem
uv run fgui-agent active
uv run fgui-agent tree
uv run fgui-agent save
uv run fgui-agent undo
uv run fgui-agent redo
uv run fgui-agent publish --scope active创建和导入资源:
uv run fgui-agent create-component ViewHub NewPanel --width 1920 --height 1080
uv run fgui-agent import-image ViewHub /absolute/path/button.png
uv run fgui-agent create-button ViewHub NewButton --mode common全局参数必须放在子命令前,例如:
uv run fgui-agent \
--project /ABSOLUTE/PATH/TO/FAIRYGUI-PROJECT \
packagesMCP 工具
工具按用途分为:
连接与读取:
fgui_status、fgui_ping、fgui_get_project、fgui_list_packages、fgui_list_items、fgui_get_active_document、fgui_get_tree、fgui_get_history导航与修改:
fgui_open_document、fgui_select_object、fgui_set_property、fgui_insert_object、fgui_remove_object创建资源:
fgui_create_component、fgui_import_image、fgui_create_button保存与回退:
fgui_save_document、fgui_save_all、fgui_discard_document、fgui_undo、fgui_redo发布:
fgui_get_publish_settings、fgui_publish
MCP 只提供显式工具;CLI 的 call 仅用于调试原始 Action。
当前限制
暂不支持字体、音频、Spine 等非图片资源导入。
暂不支持删除、移动或重命名包资源。
暂不支持批量布局和批量属性事务。
Windows 尚未完成真实环境端到端验证。
更新
git pull
uv sync --frozen
uv run python scripts/sync_to_project.py --choose-project --apply更新插件后重新打开 FairyGUI 工程。只有 MCP 启动命令或 Bridge 仓库路径变化时,才需要重新登记 MCP。
开发维护
FairyGUI 插件源码:
plugin/main.ts插件运行文件:
plugin/main.jsPython MCP/CLI:
src/fairygui_agent/Codex Skill:
.agents/skills/fgui-agent-bridge/同步脚本:
scripts/sync_to_project.py
修改插件源码后,需重新生成并提交 plugin/main.js;版本号需同步更新到 plugin/package.json、pyproject.toml、Python __version__ 和插件源码/运行文件。
其他开源库推荐
蓝湖 MCP,配合本工具,可以用 CodeX 之类的 Agent 自动切图然后拼接好 UI 发布
许可证
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server that bridges AI agents with GUI automation capabilities, allowing them to control mouse, keyboard, windows, and take screenshots to interact with desktop applications.Last updated22MIT

Funplay MCP for Unityofficial
Alicense-qualityAmaintenanceThis MCP server integrates AI assistants with Unity Editor, allowing them to create scenes, generate scripts, simulate input, and automate workflows using 91 built-in tools.Last updated195MIT- Alicense-qualityAmaintenanceAn MCP server that enables AI agents to control the Unity Editor externally, providing tools for scene, GameObject, component, and other editor operations.Last updated1MIT
- Alicense-qualityDmaintenanceA comprehensive MCP server plugin for Cocos Creator 3.8+ that enables AI assistants to control the editor via standardized protocol, offering 50 tools for scene, node, component, prefab, asset, project, and debugging operations.Last updated52MIT
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
MCP server for Hailuo (MiniMax) AI video generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Wilson520403/fgui-agent-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server