iflow-mcp_unity-mcp
v8.1.4MCP for Unity Server: A Unity package for Unity Editor integration via the Model Context Protocol (MCP).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
debug_request_context
Return the current FastMCP request context details (client_id, session_id, and meta dump).
execute_custom_tool
Execute a project-scoped custom tool registered by Unity.
| Parameter | Type | Description |
|---|---|---|
tool_name * | string | |
parameters |
manage_asset
Performs asset operations (import, create, modify, delete, etc.) in Unity.
| Parameter | Type | Description |
|---|---|---|
action * | string | Perform CRUD operations on assets. |
path * | string | Asset path (e.g., 'Materials/MyMaterial.mat') or search scope. |
asset_type | ||
destination | ||
filter_date_after | ||
filter_type | ||
generate_preview | boolean | Generate a preview/thumbnail for the asset when supported. |
page_number | ||
page_size | ||
properties | ||
search_pattern |
manage_editor
Controls and queries the Unity editor's state and settings. Tip: pass booleans as true/false; if your client only sends strings, 'true'/'false' are accepted.
| Parameter | Type | Description |
|---|---|---|
action * | string | Get and update the Unity Editor state. |
layer_name | ||
tag_name | ||
tool_name | ||
wait_for_completion |
manage_gameobject
Performs CRUD operations on GameObjects and components.
| Parameter | Type | Description |
|---|---|---|
action * | string | Perform CRUD operations on GameObjects and components. |
component_name | ||
component_properties | ||
components_to_add | ||
components_to_remove | ||
find_all | ||
includeNonPublicSerialized | ||
layer | ||
name | ||
parent | ||
position | ||
prefab_folder | ||
prefab_path | ||
primitive_type | ||
rotation | ||
save_as_prefab | ||
scale | ||
search_in_children | ||
search_inactive | ||
search_method | ||
search_term | ||
set_active | ||
tag | ||
target |
manage_prefabs
Performs prefab operations (open_stage, close_stage, save_open_stage, create_from_gameobject).
| Parameter | Type | Description |
|---|---|---|
action * | string | Perform prefab operations. |
allow_overwrite | ||
mode | ||
prefab_path | ||
save_before_close | ||
search_inactive | ||
target |
manage_scene
Performs CRUD operations on Unity scenes.
| Parameter | Type | Description |
|---|---|---|
action * | string | Perform CRUD operations on Unity scenes. |
build_index | ||
name | ||
path |
apply_text_edits
Apply small text edits to a C# script identified by URI. IMPORTANT: This tool replaces EXACT character positions. Always verify content at target lines/columns BEFORE editing! RECOMMENDED WORKFLOW: 1. First call resources/read with start_line/line_count to verify exact content 2. Count columns carefully (or use find_in_file to locate patterns) 3. Apply your edit with precise coordinates 4. Consider script_apply_edits with anchors for safer pattern-based replacements Notes: - For method/class operations, use script_apply_edits (safer, structur…
| Parameter | Type | Description |
|---|---|---|
edits * | array | List of edits to apply to the script, i.e. a list of {startLine,startCol,endLine,endCol,newText} (1-indexed!) |
uri * | string | URI of the script to edit under Assets/ directory, unity://path/Assets/... or file://... or Assets/... |
options | ||
precondition_sha256 | ||
strict |
create_script
Create a new C# script at the given project path.
| Parameter | Type | Description |
|---|---|---|
contents * | string | Contents of the script to create. Note, this is Base64 encoded over transport. |
path * | string | Path under Assets/ to create the script at, e.g., 'Assets/Scripts/My.cs' |
namespace | ||
script_type |
delete_script
Delete a C# script by URI or Assets-relative path.
| Parameter | Type | Description |
|---|---|---|
uri * | string | URI of the script to delete under Assets/ directory, unity://path/Assets/... or file://... or Assets/... |
validate_script
Validate a C# script and return diagnostics.
| Parameter | Type | Description |
|---|---|---|
uri * | string | URI of the script to validate under Assets/ directory, unity://path/Assets/... or file://... or Assets/... |
include_diagnostics | boolean | Include full diagnostics and summary |
level | string | Validation level |
manage_script
Compatibility router for legacy script operations. Prefer apply_text_edits (ranges) or script_apply_edits (structured) for edits.
| Parameter | Type | Description |
|---|---|---|
action * | string | Perform CRUD operations on C# scripts. |
name * | string | |
path * | string | |
contents | ||
namespace | ||
script_type |
manage_script_capabilities
Get manage_script capabilities (supported ops, limits, and guards). Returns: - ops: list of supported structured ops - text_ops: list of supported text ops - max_edit_payload_bytes: server edit payload cap - guards: header/using guard enabled flag
get_sha
Get SHA256 and basic metadata for a Unity C# script without returning file contents
| Parameter | Type | Description |
|---|---|---|
uri * | string | URI of the script to edit under Assets/ directory, unity://path/Assets/... or file://... or Assets/... |
manage_shader
Manages shader scripts in Unity (create, read, update, delete).
| Parameter | Type | Description |
|---|---|---|
action * | string | Perform CRUD operations on shader scripts. |
name * | string | Shader name (no .cs extension) |
path * | string | Asset path (default: "Assets/") |
contents |
read_console
Gets messages from or clears the Unity Editor console. Note: For maximum client compatibility, pass count as a quoted string (e.g., '5').
| Parameter | Type | Description |
|---|---|---|
action | ||
count | ||
filter_text | ||
format | ||
include_stacktrace | ||
since_timestamp | ||
types |
run_tests
Runs Unity tests for the specified mode
| Parameter | Type | Description |
|---|---|---|
mode | string | Unity test mode to run |
timeout_seconds |
script_apply_edits
Structured C# edits (methods/classes) with safer boundaries - prefer this over raw text. Best practices: - Prefer anchor_* ops for pattern-based insert/replace near stable markers - Use replace_method/delete_method for whole-method changes (keeps signatures balanced) - Avoid whole-file regex deletes; validators will guard unbalanced braces - For tail insertions, prefer anchor/regex_replace on final brace (class closing) - Pass options.validate='standard' for structural checks; 'relaxed' for interior-only edits Canonical fields (use these exact keys): - op: repla…
| Parameter | Type | Description |
|---|---|---|
edits * | array | List of edits to apply to the script |
name * | string | Name of the script to edit |
path * | string | Path to the script to edit under Assets/ directory |
namespace | ||
options | ||
script_type | string | Type of the script to edit |
set_active_instance
Set the active Unity instance for this client/session. Accepts Name@hash or hash.
| Parameter | Type | Description |
|---|---|---|
instance * | string | Target instance (Name@hash or hash prefix) |