freshcrate
Skin:/
Home > MCP Servers > UniCortex

UniCortex

A toolkit for controlling Unity Editor externally via REST API, MCP (Model Context Protocol), and CLI.

Why this rank:Recent releaseHealthy release cadenceStrong adoption

Description

A toolkit for controlling Unity Editor externally via REST API, MCP (Model Context Protocol), and CLI.

README

UniCortex

Caution

This project is still under active development. The API and command structure may change without notice.

A toolkit for controlling Unity Editor externally via REST API, MCP (Model Context Protocol), and CLI.

Primarily designed for AI agents (Claude Code, Codex CLI, etc.) to operate Unity Editor through MCP. Also provides a CLI tool for terminal-based control.

Requirements

  • Unity 2022.3 or later
  • .NET 10 SDK (for MCP server and CLI)

Installation

Add via Unity Package Manager using a Git URL:

  1. Open Package Manager
  2. Click the + button
  3. Select "Add package from git URL"
  4. Enter the following URL:
https://github.com/VeyronSakai/UniCortex.git

MCP Server Setup

Add the following MCP server configuration to your MCP client's settings file (e.g., .mcp.json, claude_desktop_config.json, etc.). Refer to your client's documentation for the exact configuration location.

{
  "mcpServers": {
    "Unity": {
      "type": "stdio",
      "command": "bash",
      "args": ["-c", "dotnet run --project ${UNICORTEX_PROJECT_PATH}/Library/PackageCache/com.veyron-sakai.uni-cortex@*/Tools~/UniCortex.Mcp/"],
      "env": {
        "UNICORTEX_PROJECT_PATH": "/path/to/your/unity/project"
      }
    }
  }
}

Replace /path/to/your/unity/project with the absolute path of your Unity project. After saving the configuration, restart the client to apply the changes.

The MCP server reads the port number from Library/UniCortex/config.json (written automatically when Unity Editor starts) and connects to the HTTP server.

No pre-build or tool installation is required. The MCP server is built and started automatically via dotnet run.

Alternatively, you can specify the URL directly via the UNICORTEX_URL environment variable (takes priority over UNICORTEX_PROJECT_PATH):

{
  "mcpServers": {
    "Unity": {
      "type": "stdio",
      "command": "/bin/bash",
      "args": ["-c", "dotnet run --project ${UNICORTEX_PROJECT_PATH}/Library/PackageCache/com.veyron-sakai.uni-cortex@*/Tools~/UniCortex.Mcp/"],
      "env": {
        "UNICORTEX_PROJECT_PATH": "/path/to/your/unity/project",
        "UNICORTEX_URL": "http://localhost:12345"
      }
    }
  }
}

CLI Usage

UniCortex also provides a CLI tool for controlling Unity Editor from the terminal:

# Set the Unity project path
export UNICORTEX_PROJECT_PATH="/path/to/your/unity/project"

# Run CLI commands
dotnet run --project "${UNICORTEX_PROJECT_PATH}/Library/PackageCache/com.veyron-sakai.uni-cortex@*/Tools~/UniCortex.Cli/" -- editor ping
dotnet run --project "${UNICORTEX_PROJECT_PATH}/Library/PackageCache/com.veyron-sakai.uni-cortex@*/Tools~/UniCortex.Cli/" -- scene hierarchy
dotnet run --project "${UNICORTEX_PROJECT_PATH}/Library/PackageCache/com.veyron-sakai.uni-cortex@*/Tools~/UniCortex.Cli/" -- gameobject find "t:Camera"

CLI Commands

Command Description
editor ping|play|stop|status|pause|unpause|step|undo|redo|save|reload-domain Editor control
scene create|open|hierarchy Scene operations
gameobject find|create|delete|modify GameObject operations
component add|remove|properties|set-property Component operations
prefab create|instantiate|open|close Prefab operations
test run Run Unity tests
console logs|clear Console log management
asset refresh Refresh Asset Database
menu execute Execute menu items
screenshot capture Capture screenshot (Play Mode only)
scene-view focus Switch focus to Scene View
game-view focus Switch focus to Game View
game-view size get|list|set Game View size control
recorder all list List all configured recorders (requires com.unity.recorder)
recorder movie add|remove|start|stop Movie Recorder management (requires com.unity.recorder)
input send-key|send-mouse Simulate input via Input System in Play Mode
timeline create|play|stop Create a TimelineAsset / Play or Stop a Timeline
timeline track add|remove|bind Timeline track operations
timeline clip add|remove Timeline clip operations

Available MCP Tools

Editor Control

Tool Description
ping_editor Check connectivity with the Unity Editor
enter_play_mode Start Play Mode
exit_play_mode Stop Play Mode
get_editor_status Get the current state of the Unity Editor (play mode, paused)
pause_editor Pause the Unity Editor. Use with step_editor for frame-by-frame control
unpause_editor Unpause the Unity Editor
step_editor Advance the Unity Editor by one frame while paused
reload_domain Request script recompilation (domain reload)
undo Undo the last operation
redo Redo an undone operation
save Save the currently active stage (Scene, Prefab, Timeline, etc.)

Scene

Tool Description
create_scene Create a new empty scene and save it at the specified asset path
open_scene Open a scene by path
get_hierarchy Get the GameObject hierarchy tree of the current scene or Prefab

GameObject

Tool Description
find_game_objects Search GameObjects by name, tag, component type, instanceId, layer, path, or state
create_game_object Create a new empty GameObject
delete_game_object Delete a GameObject (supports Undo)
modify_game_object Modify name, active state, tag, layer, or parent

Component

Tool Description
add_component Add a component to a GameObject
remove_component Remove a component from a GameObject
get_component_properties Get serialized properties of a component
set_component_property Set a serialized property on a component

Prefab

Tool Description
create_prefab Save a scene GameObject as a Prefab asset
instantiate_prefab Instantiate a Prefab into the scene
open_prefab Open a Prefab asset in Prefab Mode for editing
close_prefab Close Prefab Mode and return to the main stage

Asset

Tool Description
refresh_asset_database Refresh the Unity Asset Database

Console

Tool Description
get_console_logs Get console log entries from the Unity Editor
clear_console_logs Clear all console logs

Test

Tool Description
run_tests Run Unity Test Runner tests and return results

Menu Item

Tool Description
execute_menu_item Execute a Unity Editor menu item by path

Screenshot

Tool Description
capture_screenshot Capture a screenshot of the current Unity rendering output (Play Mode only)

View

Tool Description
focus_scene_view Switch focus to the Scene View window
focus_game_view Switch focus to the Game View window
get_game_view_size Get the current Game View size (width and height in pixels)
get_game_view_size_list Get the list of available Game View sizes (built-in and custom)
set_game_view_size Set the Game View resolution by index from the size list

Recorder

Tool Description
get_all_recorders Get the list of all configured recorders and their settings (requires com.unity.recorder)
add_movie_recorder Add a Movie recorder to the list with name, output path, encoder, quality (requires com.unity.recorder)
remove_movie_recorder Remove a Movie recorder from the list by index (requires com.unity.recorder)
start_movie_recorder Start recording with the specified Movie recorder (Play Mode only, requires com.unity.recorder)
stop_movie_recorder Stop recording and save the video file (requires com.unity.recorder)

Input

Tool Description
send_key_event Send a keyboard event via Input System in Play Mode (requires com.unity.inputsystem)
send_mouse_event Send a mouse event via Input System in Play Mode (requires com.unity.inputsystem). Supports press, release, and move for drag simulation

Timeline

Tool Description
create_timeline Create a new TimelineAsset (.playable file) at the specified asset path (requires com.unity.timeline)
add_timeline_track Add a track to a TimelineAsset (requires com.unity.timeline)
remove_timeline_track Remove a track from a TimelineAsset by index (requires com.unity.timeline)
bind_timeline_track Set the binding of a Timeline track on a PlayableDirector (requires com.unity.timeline)
add_timeline_clip Add a default clip to a Timeline track (requires com.unity.timeline)
remove_timeline_clip Remove a clip from a Timeline track by index (requires com.unity.timeline)
play_timeline Start playback of a Timeline on a PlayableDirector (requires com.unity.timeline)
stop_timeline Stop playback of a Timeline on a PlayableDirector and reset to the beginning (requires com.unity.timeline)

Architecture

graph LR
    Agent["AI Agent"]
    MCP["UniCortex.Mcp<br/>.NET 10"]
    CLI["UniCortex.Cli<br/>.NET 10"]
    Unity["Unity Editor<br/>HTTP Server"]

    Agent -- "MCP / stdio" --> MCP
    Agent -- "CLI" --> CLI
    MCP -- "HTTP" --> Unity
    CLI -- "HTTP" --> Unity
Loading
  • Unity Editor side: C# HttpListener HTTP server embedded in the Editor
  • Shared Core: UniCortex.Core — service layer and HTTP infrastructure shared by MCP and CLI
  • MCP Server: UniCortex.Mcp — .NET 10 + Model Context Protocol C# SDK
  • CLI Tool: UniCortex.Cli — .NET 10 + ConsoleAppFramework
  • UPM Package: com.veyron-sakai.uni-cortex

Documentation

Contributing

When developing this package locally:

# Build all projects
dotnet build Tools~/UniCortex.Core/
dotnet build Tools~/UniCortex.Mcp/
dotnet build Tools~/UniCortex.Cli/

# Run tests
UNICORTEX_PROJECT_PATH=$(pwd)/Samples~ dotnet test Tools~/UniCortex.Core.Test/

# Run MCP server
dotnet run --project Tools~/UniCortex.Mcp/

# Run CLI
dotnet run --project Tools~/UniCortex.Cli/ -- editor ping

License

MIT License - LICENSE.txt

Release History

VersionChangesUrgencyDate
0.1.32## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#208) - Skip release draft for closed-unmerged PRs @VeyronSakai (#206) - Delete .github/dependabot.yml @VeyronSakai (#205) - Translate SPEC.md to English @VeyronSakai (#203) - Document ScriptableObject endpoints and assembly-name argument @VeyronSakai (#202) - Add ScriptableObject (.asset) read/write/create support @VeyronSakai (#201) - Bump actions/create-github-app-token from 3.1.1 to 3.2.0High6/1/2026
0.1.31## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#195) - Serialize MCP tool execution via shared async sequencer @VeyronSakai (#194) - Fix Unity editor test regressions @VeyronSakai (#192) - Fix Unity editor test regressions @VeyronSakai (#191) High4/20/2026
0.1.30## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#190) - Expand CLI documentation and local tool support @VeyronSakai (#189) - Handle cancelled test runs cleanly @VeyronSakai (#188) - Add Project Window asset selection @VeyronSakai (#187) - Bump actions/create-github-app-token from 3.0.0 to 3.1.1 @[dependabot[bot]](https://github.com/apps/dependabot) (#185) - Ignore mcp.json @VeyronSakai (#183) - Add extension support for user-defined MCP tHigh4/18/2026
0.1.29## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#179) - Add captureAudio parameter to movie recorder @VeyronSakai (#178) High4/9/2026
0.1.28## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#177) - fix meta @VeyronSakai (#176) - Update README.md @VeyronSakai (#175) - Update README.md @VeyronSakai (#174) Medium4/9/2026
0.1.27## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#173) - Add Timeline Play and Stop operations @VeyronSakai (#172) - Add Movie Recorder feature using Unity Recorder @VeyronSakai (#162) High4/8/2026
0.1.26## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#171) - Remove time scale feature @VeyronSakai (#170) - Prevent physical device state from leaking into simulated input and retry transient 5xx errors @VeyronSakai (#168) - Unify save\_prefab and save\_scene into a single save tool @VeyronSakai (#167) Medium4/6/2026
0.1.25## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#166) - Add set\_game\_view\_size and get\_game\_view\_size\_list MCP tools @VeyronSakai (#164) Medium4/2/2026
0.1.24## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#165) - Add get\_game\_view\_size MCP tool and move screen size out of editor status @VeyronSakai (#163) - Bump reviewdog/action-actionlint from 1.71.0 to 1.72.0 @[dependabot[bot]](https://github.com/apps/dependabot) (#161) Medium4/2/2026
0.1.23## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#160) ## Bug Fixes - Use fully qualified UnityEngine.Object.DestroyImmediate @VeyronSakai (#159) Medium3/29/2026
0.1.22## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#158) Medium3/29/2026
0.1.21## Changes - Rename capture\_game\_view to capture\_screenshot and add view focus tools @VeyronSakai (#157) - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#155) - Fix get\_scene\_hierarchy and find\_game\_objects in Prefab Mode @VeyronSakai (#152) - Make query required for find\_game\_objects @VeyronSakai (#154) - Fix broken CLI Commands table in README @VeyronSakai (#151) Medium3/29/2026
0.1.20## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#150) - Add save\_prefab for explicit Prefab Mode saves @VeyronSakai (#148) - Make prefab dirty between open and close in test @VeyronSakai (#149) Medium3/25/2026
0.1.19## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#147) - Add open/close Prefab Mode functionality @VeyronSakai (#146) Medium3/25/2026
0.1.18## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#145) - Add click event type to send\_mouse\_event @VeyronSakai (#144) Medium3/25/2026
0.1.17## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#143) - Create SceneView.meta @VeyronSakai (#142) Medium3/24/2026
0.1.16## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#141) - Fix capture\_game\_view to include UI overlays and remove capture\_scene\_view @VeyronSakai (#140) Medium3/24/2026
0.1.15## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#139) - Add set\_time\_scale and get\_time\_scale tools @VeyronSakai (#138) Medium3/24/2026
0.1.14## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#137) - Bump EndBug/add-and-commit from 9.1.4 to 10.0.0 @[dependabot[bot]](https://github.com/apps/dependabot) (#136) - Add UI Button click integration tests and document mouse coordinate system @VeyronSakai (#134) Medium3/24/2026
0.1.13## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#133) - Rename UseCase instance suffix from Service to UseCase @VeyronSakai (#132) - Add [Argument] attribute to all CLI positional parameters @VeyronSakai (#131) - Add capture\_game\_view and capture\_scene\_view MCP tools @VeyronSakai (#129) Low3/22/2026
0.1.12## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#128) - Introduce UnityEditorClient to eliminate HTTP boilerplate @VeyronSakai (#127) - Add Timeline MCP tools @VeyronSakai (#126) - Remove ProjectSettings references from SPEC.md @VeyronSakai (#125) - Bump release-drafter/release-drafter from 7.0.0 to 7.1.1 @[dependabot[bot]](https://github.com/apps/dependabot) (#124) - Remove input workflow from step\_editor description @VeyronSakai (#122) Low3/21/2026
0.1.11## Changes - Add pause and step editor tools to README @VeyronSakai (#121) - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#120) - Add pause/step editor tools and Mermaid architecture diagram @VeyronSakai (#119) - Add pause\_editor and step\_editor MCP tools for frame-by-frame game control @VeyronSakai (#118) - Bump release-drafter/release-drafter from 6.4.0 to 7.0.0 @[dependabot[bot]](https://github.com/apps/dependabot) (#117) - Bump dorny/paths-filLow3/16/2026
0.1.10## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#114) - Add parameter descriptions to CLI command help @VeyronSakai (#113) - Add DRAFT\_README.md to release workflow @VeyronSakai (#112) - Remove outdated Settings section from README @VeyronSakai (#111) - Delete TASK.md @VeyronSakai (#110) - Extract SessionState port key into a constant @VeyronSakai (#109) - Improve Play Mode stability: run HTTP server on thread pool @VeyronSakai (#108) - ALow3/16/2026
0.1.9## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#106) - Reduce editor poll timeout to 30s @VeyronSakai (#105) Low3/12/2026
0.1.8## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#103) - Support ObjectReference in set\_component\_property @VeyronSakai (#102) Low3/12/2026
0.1.7## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#101) - Fix tests asmdef name @VeyronSakai (#100) Low3/11/2026
0.1.6## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#99) - Remove Project Settings UI and always auto-start server @VeyronSakai (#98) Low3/11/2026
0.1.5## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#97) - Suppress INFO logs in CLI @VeyronSakai (#96) - Fix CLI usage paths in README to use UNICORTEX\_PROJECT\_PATH @VeyronSakai (#94) - Quote UNICORTEX\_PROJECT\_PATH in README CLI bash examples @[copilot-swe-agent[bot]](https://github.com/apps/copilot-swe-agent) (#95) - Increase editor polling interval and timeout @VeyronSakai (#93) - Consolidate DomainReloadUseCase into EditorUseCase @VeyrLow3/11/2026
0.1.4## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#81) - Change IRequestContext.HttpMethod type from string to HttpMethodType @VeyronSakai (#80) - Reject run\_tests request during play mode @VeyronSakai (#78) - Add create\_scene MCP tool and prevent Scene Modified dialog @VeyronSakai (#77) - Add verbose query parameter to /ping endpoint @VeyronSakai (#76) - Add testNames, groupNames, categoryNames, assemblyNames to run\_tests @VeyronSakai (#Low3/8/2026
0.1.3## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#63) - Remove CLAUDE.md from git tracking @VeyronSakai (#62) ## Bug Fixes - Use shell glob pattern for MCP server path @VeyronSakai (#59) Low3/4/2026
0.1.2## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#61) - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#58) ## Bug Fixes - Skip server startup in AssetImportWorkerProcess @VeyronSakai (#60) Low3/4/2026
0.1.1## Changes - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#58) - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#57) - Revert "Update files for release" @VeyronSakai (#56) - Use GitHub App token for checkout @VeyronSakai (#55) - Update files for release @[veyronsakai-app[bot]](https://github.com/apps/veyronsakai-app) (#54) - Fix package.json @VeyronSakai (#53) - Add .meta files for docs and update .gitignoLow3/4/2026
0.1.0## Changes - Update API endpoints in documentation @VeyronSakai (#2) - add docs @VeyronSakai (#1) ## Features - Implement ping endpoint with server infrastructure @VeyronSakai (#3) Low2/15/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

PerformanceStudioFree, open-source SQL Server execution plan analyzer — cross-platform GUI + CLI with 30 analysis rules, missing index detection, SSMS extension. Built-in MCP server for AI-assisted plan review.v1.12.0
Perigon.CLIThis is a tool that helps you quickly build backend services based on Asp.Net Core and EF Core. It provides command line, WebUI and IDE MCP support. In a well-designed project architecture that has bev10.0.0
mcp-dotnet-samplesA comprehensive set of samples of creating and using MCP servers and clients with .NETmain@2026-06-05
ksailAll-in-one Kubernetes SDK: create, manage, and operate clusters across distributions (Kind, K3d, Talos, VCluster) with built-in GitOps, secrets, AI assistant, and MCP server. Only requires Docker.v7.26.0
ResxMcpNo descriptionmaster@2026-06-05

More in MCP Servers

AstrBotAgentic IM Chatbot infrastructure that integrates lots of IM platforms, LLMs, plugins and AI feature, and can be your openclaw alternative. ✨
agentscopeBuild and run agents you can see, understand and trust.
claude-plugins-officialOfficial, Anthropic-managed directory of high quality Claude Code Plugins.
langchain4jLangChain4j is an open-source Java library that simplifies the integration of LLMs into Java applications through a unified API, providing access to popular LLMs and vector databases. It makes impleme