iflow-mcp_unity-mcp

v8.1.4
iflow-mcp_unity-mcp Checked 7 hours ago Published 1 year ago

MCP 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.

ParameterTypeDescription
tool_name *string
parameters

execute_menu_item

Execute a Unity menu item by path.

ParameterTypeDescription
menu_path

manage_asset

Performs asset operations (import, create, modify, delete, etc.) in Unity.

ParameterTypeDescription
action *stringPerform CRUD operations on assets.
path *stringAsset path (e.g., 'Materials/MyMaterial.mat') or search scope.
asset_type
destination
filter_date_after
filter_type
generate_previewbooleanGenerate 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.

ParameterTypeDescription
action *stringGet and update the Unity Editor state.
layer_name
tag_name
tool_name
wait_for_completion

manage_gameobject

Performs CRUD operations on GameObjects and components.

ParameterTypeDescription
action *stringPerform 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).

ParameterTypeDescription
action *stringPerform prefab operations.
allow_overwrite
mode
prefab_path
save_before_close
search_inactive
target

manage_scene

Performs CRUD operations on Unity scenes.

ParameterTypeDescription
action *stringPerform 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…

ParameterTypeDescription
edits *arrayList of edits to apply to the script, i.e. a list of {startLine,startCol,endLine,endCol,newText} (1-indexed!)
uri *stringURI 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.

ParameterTypeDescription
contents *stringContents of the script to create. Note, this is Base64 encoded over transport.
path *stringPath 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.

ParameterTypeDescription
uri *stringURI of the script to delete under Assets/ directory, unity://path/Assets/... or file://... or Assets/...

validate_script

Validate a C# script and return diagnostics.

ParameterTypeDescription
uri *stringURI of the script to validate under Assets/ directory, unity://path/Assets/... or file://... or Assets/...
include_diagnosticsbooleanInclude full diagnostics and summary
levelstringValidation level

manage_script

Compatibility router for legacy script operations. Prefer apply_text_edits (ranges) or script_apply_edits (structured) for edits.

ParameterTypeDescription
action *stringPerform 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

ParameterTypeDescription
uri *stringURI 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).

ParameterTypeDescription
action *stringPerform CRUD operations on shader scripts.
name *stringShader name (no .cs extension)
path *stringAsset 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').

ParameterTypeDescription
action
count
filter_text
format
include_stacktrace
since_timestamp
types

run_tests

Runs Unity tests for the specified mode

ParameterTypeDescription
modestringUnity 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…

ParameterTypeDescription
edits *arrayList of edits to apply to the script
name *stringName of the script to edit
path *stringPath to the script to edit under Assets/ directory
namespace
options
script_typestringType of the script to edit

set_active_instance

Set the active Unity instance for this client/session. Accepts Name@hash or hash.

ParameterTypeDescription
instance *stringTarget instance (Name@hash or hash prefix)