convez.ai
MCP ServerIntegração & APIsAvançado
SponexONYTB

Flax MCP — Controle de Engine via IA

SponexONYTB/flax-mcp-

Controle o Flax Engine por voz/texto através de assistentes IA

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP que integra assistentes de IA (Claude, Cursor, Windsurf) diretamente ao editor Flax Engine. Oferece 47 ferramentas para manipular cenas, atores, assets e scripts via linguagem natural, com arquitetura em 3 camadas (MCP Server + Bridge WebSocket + Plugin C#).

Instalação

$npx convez-ai SponexONYTB/flax-mcp-

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
2

Casos de uso

  • Desenvolvimento de jogos assistido por IA (criação de cenas, atores, scripts)
  • Prototipagem rápida de game design com comandos em linguagem natural
  • Automação de tarefas repetitivas no editor (asset management, play mode control)
  • Integração de fluxo de trabalho entre editor Flax e IDEs com MCP (Cursor, Windsurf, Cline)

Veredito

Projeto ambicioso e bem arquitetado que democratiza controle do Flax Engine via IA. Alpha funcional com boa documentação de setup; requer Node.js, Flax 1.12+ e familiaridade com MCP para máximo aproveitamento. Ideal para game devs que querem acelerar iteração com assistentes de IA.

README

A tradução para o português deste README ainda está na fila.

Flax MCP — AI-to-Flax Engine Control System

Bridge AI assistants (Claude, Cursor, Windsurf, etc.) directly into the Flax Engine editor via the Model Context Protocol (MCP).

Inspect scenes, create and manipulate actors, manage assets, control play mode — all through natural language.

Alpha — core works, some editor APIs need refinement.


Architecture

┌─────────────────────────────┐
│      AI Assistant           │
│  (Claude, Cursor, etc.)     │
└─────────────┬───────────────┘
              │ MCP Protocol (JSON-RPC over stdio)
              ▼
┌─────────────────────────────┐
│   LAYER 1: MCP Server       │
│   (TypeScript)              │
│   - Tool Registry           │
│   - Zod Validation          │
│   - Command Dispatcher      │
└─────────────┬───────────────┘
              │ WebSocket (localhost:7777)
              ▼
┌─────────────────────────────┐
│   LAYER 2: Bridge Gateway   │
│   (Node.js)                 │
│   - Reconnect Logic         │
│   - Command Queue           │
│   - Response Correlation    │
└─────────────┬───────────────┘
              │ TCP/WebSocket
              ▼
┌─────────────────────────────┐
│   LAYER 3: Flax Plugin      │
│   (C# GamePlugin)           │
│   - WebSocket Server :7777  │
│   - CommandRouter           │
│   - EditorReflection        │
└─────────────────────────────┘

Quick Start

Prerequisites

  • Node.js >= 18
  • Flax Engine 1.12 (editor)
  • npm or yarn

1. Install the Flax Plugin

Copy plugin/FlaxMcpPlugin.cs to your project:

YourProject/Source/Game/FlaxMcpPlugin.cs

Open Flax Editor — it auto-compiles. You'll see:

[FlaxMcp] Plugin initialized on port 7777

2. Install Server

cd server
npm install

3. Run

# Terminal 1: MCP server (for AI assistant)
npx tsx server/src/index.ts

# Terminal 2: Bridge (for manual testing)
echo '{"tool":"ping","params":{}}' | npx tsx bridge/src/index.ts

AI Client Setup

Claude Desktop

Edit claude_desktop_config.json:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "flax-mcp": {
      "command": "npx",
      "args": [
        "tsx",
        "C:/path/to/flax-mcp/server/src/index.ts"
      ],
      "env": {
        "FLAX_WS_HOST": "localhost",
        "FLAX_WS_PORT": "7777"
      }
    }
  }
}

Cursor

  1. Open Cursor Settings → Features → MCP Servers
  2. Click + Add New MCP Server
  3. Fill in:
    • Name: flax-mcp
    • Type: command
    • Command: npx tsx C:/path/to/flax-mcp/server/src/index.ts
  4. Click Save

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "flax-mcp": {
      "command": "npx",
      "args": [
        "tsx",
        "C:/path/to/flax-mcp/server/src/index.ts"
      ]
    }
  }
}

VS Code + Cline / Continue

Cline: cline_mcp_settings.json Continue: ~/.continue/config.json

{
  "mcpServers": {
    "flax-mcp": {
      "command": "npx",
      "args": [
        "tsx",
        "C:/path/to/flax-mcp/server/src/index.ts"
      ]
    }
  }
}

Tools (47 total)

Core

ToolDescription
pingConnectivity check
echoEcho test for bridge validation
get_tool_listList all available tools

Scene — Hierarchy

ToolDescription
get_scene_hierarchyRecursive actor tree of active scene
get_active_sceneCurrent scene name + path
scene_list_openedList all opened scenes
scene_get_dataRoot actors in a scene
scene_openOpen a scene (single/additive)
scene_saveSave current scene
scene_createCreate a new scene asset
scene_unloadUnload a scene
scene_set_activeSet active scene

Scene — Actors

ToolDescription
create_actorSpawn actor (EmptyActor, StaticModel, lights, camera, etc.)
delete_actorRemove actor by ID
duplicate_actorClone an actor
find_actorsSearch actors by name/type
select_actorSelect actors in editor
move_actorSet or offset position
rotate_actorSet or offset rotation
scale_actorSet or offset scale
modify_actorMulti-property edit (transform, name, active)
set_actor_parentReparent in hierarchy

Scene — Components

ToolDescription
add_componentAdd a Script component to an actor
get_componentCheck if component exists
modify_componentSet component properties
remove_componentRemove a component
list_component_typesAll available Script types

Assets

ToolDescription
get_assetsList project assets
find_assetsSearch with filters (t:Texture, glob:*.flax)
import_assetImport external file into project
assign_materialAssign material to actor slot
create_asset_folderCreate folders in Content
delete_assetDelete an asset
copy_assetDuplicate an asset
move_assetMove or rename an asset
refresh_assetsForce asset database refresh
create_materialCreate a new Material asset

Editor Control

ToolDescription
get_editor_stateFull state snapshot (selection, play mode, FPS)
play_controlPlay / Stop / Pause
take_screenshotCapture editor viewport
screenshot_cameraCapture from a specific camera
get_console_logsRetrieve editor logs
get_project_infoProject metadata

Scripting

ToolDescription
read_scriptRead a C# script file
write_scriptCreate or update a script
delete_scriptDelete a script file
execute_scriptCompile & run C# code dynamically

Manual Testing (Bridge CLI)

The bridge has a REPL mode for direct testing:

# Interactive
npx tsx bridge/src/index.ts
> {"tool":"get_scene_hierarchy","params":{}}

# Pipe a single command
echo '{"tool":"ping","params":{}}' | npx tsx bridge/src/index.ts

Development

Adding a tool

Server — add schema in server/src/core/validator.ts + tool def in server/src/tools/:

{
  name: "my_tool",
  schema: z.object({ /* zod */ }),
  handler: async (params, ctx) => ctx.bridge.send({ tool: "my_tool", params }),
}

Plugin — register in Router.Handlers + implement handler method:

{ "my_tool", MyToolHandler },

Register in server/src/index.ts:

registry.registerBatch(createMyTools());

Credits

Built for Flax Engine — the open-source game engine by Flax. Massive thanks to the Flax team and community for building an incredible engine with first-class C# scripting and editor extensibility.

Disclaimer: This project is not affiliated, endorsed, or sponsored by the Flax Engine team. It is an independent integration created by SponexONYTB.


Safety

Enable command whitelist via FLAX_TOOL_WHITELIST env var:

{"enabled": true, "allowedTools": ["ping", "get_scene_hierarchy"]}

The C# plugin runs only in editor mode and never affects standalone builds.


License

MIT

Security Scan

Ver o original no GitHub

Bom para

Relacionados