Skip to main content
Glama
construct2-mcp

construct2-mcp

by wjrosa

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
C2_ADDON_DIRSNoExtra folders with `plugins/` and `behaviors/` subfolders.
C2_INSTALL_DIRNoConstruct 2 folder, if it isn't found automatically.
C2MCP_BACKUP_DIRNoWhere backups go (default `%LOCALAPPDATA%\construct2-mcp\backups`).
C2MCP_EDITOR_SYNCNo`reload` (default) or `skip`: what to do when an edited project is open in the editor.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Construct 2 (r279/r280) editor control.

Work on a FOLDER project (.caproj). A .capx must be capx_extract-ed first. Typical loop: project_info -> objects_list / layout_get / event_sheet_read -> edit with the object_*, layout_*, instance_*, events_* tools -> editor_open or editor_reload to see it in Construct 2 -> editor_export to build. Every edit is checked against the installed plugins and saved immediately; the first change to each file in a session is backed up (backups_list / backup_restore).

Events: conditions/actions are {"object": "<object, family or System>", "behavior": "<behavior name, optional>", "ace": "<name as in the editor, or numeric id>", "params": [...] or {name: value}, "inverted": bool}. Parameter values are Construct 2 expressions as text: a literal string needs its quotes, e.g. ""Hello"". Comparisons take = <> < <= > >=, combos take the option label or index, keys take names like "Space" or "A". Use object_aces to see what an object can do.

If the project is open in Construct 2 with unsaved changes, project edits are refused (the editor would overwrite them on save). If it is open and saved, the editor is reloaded after each edit (editor_sync="reload"); pass editor_sync="skip" to batch many edits and call editor_reload once. Editor tools never steal the mouse or keyboard, except editor_send_keys.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
project_infoA

Summary of a Construct 2 folder project: layouts (with their event sheets), event sheets, objects count, families, plugins/behaviors used, settings, sounds and files. project is the .caproj path or its folder.

project_templatesA

Templates bundled with Construct 2 that project_create can start from.

project_createB

Create a new folder project in folder (must be empty or missing) from a bundled template, and name it.

project_set_settingsC

Change project properties. Keys: name, description, version, author, email, website, id, first_layout, pixel_rounding, preview_effects, use_loader_layout, window_size ([w, h]), or any Configuration Settings name ("Fullscreen in browser", "Sampling", "Preview browser", ...).

capx_to_folderB

Unpack a single-file .capx into a folder project (default: next to it, same name) so it can be edited.

folder_to_capxB

Pack a folder project into a single .capx file (UI state files are left out).

backups_listC

Backups this server made before changing the project's files (one folder per server session).

backup_restoreB

Copy the files saved in a backup session (default: the newest) back over the project.

addons_listA

Installed plugins (kind="plugin") or behaviors (kind="behavior"): id, name, category, ACE counts.

object_acesB

Everything an object (or family, or "System") can do: its plugin's conditions/actions/expressions, its behaviors' ones, and the common ones (position, size, instance variables...). kind: conditions, actions, expressions or all. filter: substring of the name/category.

addon_infoB

Full definition of a plugin or behavior: settings, properties (with options and defaults), conditions, actions and expressions. Accepts the addon id or its display name.

catalog_learnA

Teach the catalog System/common ACEs it does not know yet by harvesting them from a project or a folder of projects (.caproj folders and .capx files). Saved per user and used from then on.

catalog_reloadA

Re-read installed plugins/behaviors (after installing a .c2addon).

objects_listC

Object types and families with plugin, instance variables, behaviors and animations.

object_createA

Add an object type. plugin: id or name (Sprite, Text, TiledBg, 9patch, Keyboard, Mouse, Audio, Function, Array, ...). Sprites take image (any image file) or frames (several); without one a visible placeholder is made. Like the editor's Insert Object, a world object also gets one instance placed (on layout, default the first; at x/y, default just outside the layout) because Construct 2 can only spawn objects at runtime that have an instance somewhere. Project-wide plugins (Keyboard, Audio...) get their global instance; properties sets its values.

object_add_framesB

Add frames to a Sprite animation (created if missing); replace=true swaps out the existing frames.

object_add_instance_variableC

Add an instance variable (number, text or boolean) to an object or family; every existing instance gets initial.

object_add_behaviorB

Add a behavior (id or name: Platform, 8Direction, Bullet, Solid, Fade, Sine, ...) to an object or family. properties overrides defaults on every instance (see addon_info for names and options).

family_createC

Create a family of object types that share a plugin.

object_referencesC

Where an object or family is used: events, expressions and layout instances.

object_deleteB

Delete an object type or family with its instances and images. Refused while events use it unless force=true.

layout_getC

Layout size, event sheet, margins and layers (with instance counts).

layout_createC

Add a layout. event_sheet: "new" makes " sheet", a name links an existing sheet, null for none. copy_from duplicates another layout's layers and instances.

layout_setC

Change a layout's size, event sheet, margins or unbounded scrolling.

layer_addC

Add a layer (index 0 = bottom). background_color is "r,g,b".

layer_updateC

Rename, show/hide, recolor, set parallax/opacity or reorder a layer (layer: name or index).

layer_deleteB

Delete a layer and its instances.

instances_listC

Instances in a layout: uid, object, layer, position, size, angle, opacity, properties, instance variable values and behavior properties.

instance_addC

Place an instance. properties: plugin properties ({"text": "Hi", "initial-visibility": "Invisible"}); variables: instance variable values; behaviors: {"Platform": {"max-speed": 400}}. Returns it with its uid.

instance_updateC

Move, resize, rotate, re-layer or change properties/variables/behavior properties of an instance by uid.

instance_deleteC

Delete instances by uid.

event_sheet_readA

Read an event sheet. format="text": an indented listing like the editor's, with [sid] on every event, condition (?) and action (>); format="json": the same as editable specs (what events_add takes).

event_getC

One event, group, variable, condition or action as a JSON spec.

event_sheet_createB

Add an empty event sheet (attach it with layout_set or include it with events_add type=include).

events_addA

Insert events, groups, variables, comments or includes. Without a position they go to the end of the sheet; parent_sid puts them as sub-events of an event/group; after_sid/before_sid places them next to an item. Item shapes: {"conditions": [...], "actions": [...], "sub_events": [...], "or": false, "disabled": false} {"type": "group", "title": "...", "description": "", "active": true, "events": [...]} {"type": "variable", "name": "Score", "var_type": "number|text|boolean", "value": 0, "constant": false, "static": false} {"type": "comment", "text": "..."} {"type": "include", "sheet": "Common"} A condition/action: {"object": "Player", "behavior": "Platform"?, "ace": "Is on floor", "params": [...] or {"Name": value}, "inverted": false}. Returns the sheet as text with the new sids.

event_replaceB

Replace an event/group/variable (or a single condition/action) with a new spec, keeping its position. Tip: event_get, change the JSON, event_replace.

ace_addC

Add one condition (kind="condition") or action (kind="action") to an existing event.

events_deleteB

Delete events, groups, variables, conditions or actions by sid (an event goes with its sub-events).

event_moveA

Move an event/group/variable: into parent_sid (as sub-event), next to after_sid/before_sid, or to a top-level index.

event_set_flagsC

Toggle flags: disabled (event, group or action), inverted (condition), or_block (event), group_active.

file_importC

Import a sound (kind="sound"), music track ("music") or project file ("file"). For audio, import both the .ogg and the .m4a so every browser can play it.

editor_statusB

Running Construct 2 windows: pid, project, unsaved changes (dirty), open tabs, status bar, dialogs.

editor_openB

Open a project in Construct 2 (starts the editor; reuses a window that already has it open).

editor_reloadA

Close and reopen the project in Construct 2 so it shows changes made to the files. Refused when the editor has unsaved changes.

editor_closeB

Close a Construct 2 window. Unsaved changes block this unless discard=true.

editor_saveC

Press Save in Construct 2.

editor_previewB

Run the current layout in the browser (Run layout / Debug layout). Construct 2 serves the preview at http://localhost:50000 and opens it in the project's preview browser.

editor_exportB

Export through File > Export project. platform: HTML5 website, NW.js, Cordova, ... (first wizard page). minify needs Java. options answers later pages by control caption, e.g. {"Embed style": true}. The result lists every page's controls, so an unexpected page can be answered by calling again with options.

editor_screenshotC

Picture of the Construct 2 window (captured even when other windows cover it).

editor_dialogsC

Open dialogs and message boxes in Construct 2 with their text and buttons.

editor_dialog_clickC

Press a button (OK, Cancel, Yes, No, Next, ...) in an open Construct 2 dialog.

editor_dialog_set_textC

Type into a text field of an open dialog (by order, 0 = first).

editor_ui_treeA

The editor's UI Automation tree (control type, name, automation id), from the main window or a named control/dialog. Use it to find controls for editor_ui_act.

editor_ui_actB

Act on any editor control by name through UI Automation: invoke (buttons, ribbon), select (tabs, list and tree items), expand/collapse, toggle (checkboxes), set_value/get_value, default (a tree item's double-click action). No mouse or keyboard is used.

editor_send_keysA

LAST RESORT: brings Construct 2 to the front and types with the real keyboard (pywinauto syntax: ^s = Ctrl+S, {ENTER}, {F5}). Interrupts whoever is using the PC; prefer editor_ui_act.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

C2.9/5.0

Scored across 55 tools

Disambiguation4/5

Tools are grouped by clear entity prefixes (project, object, layout, layer, instance, event, editor) and each usually targets a distinct resource+action. A few pairs are genuinely close: event_get vs event_sheet_read (text/json), editor_dialog_click vs editor_ui_act (both press buttons/dialogs), and object_create's frames argument vs object_add_frames. These overlaps are mostly resolvable from the descriptions, so misselection risk is moderate but not severe.

Naming Consistency4/5

A predictable <entity>_<verb> pattern dominates (object_create, layout_set, layer_delete, instance_update, events_add, editor_save, project_set_settings). Deviations are mostly plural/singular entity mismatches (instance_delete vs instances_list, event_get vs events_add/events_delete) and an odd ordering in ace_add and addons_list, but nothing chaotic. An agent can reliably infer prefixes.

Tool Count2/5

55 tools is well past the point where a set stays legible, even for a rich domain. The surface also mixes two largely independent concerns — editing project files on disk and automating the Construct 2 GUI (ui tree, dialogs, keys, screenshots) — so the set feels like two servers bundled together. Many granular event/ACE tools could have been consolidated.

Completeness4/5

Coverage is broad: project create/pack/unpack/settings, full object/family/behavior/instance lifecycle, layout/layer creation and updates, plus rich event-sheet editing (add, replace, move, flags, delete) and editor automation. Minor gaps exist — no layout_delete, event_sheet_delete/rename, or family update tools are exposed. Agents can work around these by editing files or deleting/recreating, so no hard dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues