fmodel-mcp
fmodel-mcp
MCP server điều khiển FModel (trình duyệt asset Unreal Engine) qua Windows UI Automation — không cần chạm chuột vật lý.
Kiến trúc
opencode ── MCP (stdio) ──> src/index.ts ──> src/bridge.ts ──> bridge/uia.ps1 (-Server) ──> FModel (UI Automation)src/index.ts— MCP server, 19 tools.src/bridge.ts— wrapper daemon: giữ 1 tiến trìnhpwshsống, tuần tự hoá request qua promise queue, tự respawn khi lỗi/timeout.bridge/uia.ps1— PowerShell bridge: nhận 1 JSON/line từ stdin, trả 1 JSON/line ra stdout. Kích hoạt bằng UIA pattern (Invoke/Select/SetFocus+{ENTER}/Shift+F10), không dùngSetCursorPos/mouse_event.
Cài đặt
npm install
npm run buildYêu cầu: Windows + PowerShell 7 (pwsh), FModel đang chạy.
Đăng ký vào opencode
Thêm vào ~/.config/opencode/opencode.jsonc:
{
"mcp": {
"fmodel": {
"type": "local",
"command": ["node", "C:/Users/<bạn>/Desktop/temp/fmodel_mcp/dist/index.js"],
"enabled": true
}
}
}Tools chính
Tool | Chức năng |
| Liệt kê tiến trình & cửa sổ FModel |
| Đưa cửa sổ lên trước, đọc tiêu đề |
| Khảo sát cây UI Automation |
| Duyệt cây thư mục (AssetsFolderName) |
| Đọc danh sách asset hiện tại trong AssetsExplorer |
| Click trái/phải/kép (mở context menu, điều hướng) |
| Đọc/ghi ô nhập liệu (VD: ô tìm kiếm) |
| Gửi phím tắt (VD: |
| Export asset: right-click → Export → format → (tuỳ chọn) Export Session |
Quy trình tìm kiếm asset
send_keys^fđể mở cửa sổ Search For Packages.set_valuevàoSearchTextBoxvới chuỗi cần tìm.click_elementvào chínhSearchTextBox(fallback thành{ENTER}→ kích hoạtRefreshFiltercủa cửa sổ Search).list_files(vớiwindow: "Search For Packages") để đọc kết quả.
Lưu ý: tìm kiếm là substring-match trên FullPath, kết quả bị ảo hoá (~24 dòng hiển thị).
Dev
npm run dev # chạy bằng tsx
npm run build # biên dịch TypeScriptTest nhanh bridge không qua MCP:
pwsh -NoProfile -File bridge/uia.ps1 -Action processes