taygunsavas/patina-unity-mcp

๐ŸŽฎ Gaming
0 Views
0 Installs

๐Ÿฆ€ ๏ธโƒฃ ๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Control the Unity Editor from MCP hosts through a local Rust server and C bridge, with one-click host setup and 86 Unity commands for scenes, GameObjects, prefabs, assets, scripts, console, tests, and build settings.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "taygunsavas-patina-unity-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "taygunsavas-patina-unity-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

Patina

npm version MCP Registry Glama MCP server Indexed on TensorBlock MCP Index License: MIT

Control the Unity Editor from any MCP host. One package install, one click, and your AI assistant can see your scene, create objects, and talk to the console.

Patina is a Rust MCP server paired with a C# Unity bridge. It connects your favorite AI coding tool directly to the Unity Editor over a local TCP channel, with zero manual config.

Why Patina?

  • One-click setup. Install the UPM package, click a button, and every supported host is configured automatically.
  • No Rust required. Release packages ship pre-built binaries for Windows, Linux, and macOS. Just install and go.
  • Built for speed. The Rust sidecar keeps the MCP layer fast and lightweight while Unity stays on the main thread.
  • Multi-host. Works with Claude Code, Cursor, VS Code, Gemini CLI, JetBrains Rider, Codex CLI, and more.

How It Works

MCP Host  <-- stdio -->  Patina Server  <-- local TCP -->  Unity Editor

The host launches the Rust binary over stdio MCP. The Rust server forwards tool calls into Unity through a local loopback TCP bridge. Unity executes them on the main thread and returns the result.

Quick Start

1. Install the Unity package

In Unity, open Project Settings > Package Manager, add a scoped registry, then install the package by name.

Scoped registry:

FieldValue
Namenpmjs
URLhttps://registry.npmjs.org
Scope(s)com.taygunsavas

Then open the Package Manager (Window > Package Manager), click the + icon in the top left, select Add package by name..., and enter:

com.taygunsavas.patina-unity-mcp

Registry releases are signed during the release workflow for Unity Package Manager verification.

Alternatively, open the Package Manager, click the + icon, select Add package from git URL..., and enter:

https://github.com/taygunsavas/patina-unity-mcp.git?path=/unity-package

Patina is distributed as a complete Unity package artifact with the editor code, native Rust runtime binaries under Plugins/<platform>/, and the Unity metadata needed for import. End users do not need the Rust toolchain or a Git checkout of this repository.

2. Run One-Click Setup

Open Window > Patina Unity MCP and click One-Click Setup.

The setup flow verifies the binary, starts the Unity bridge, auto-configures every detected host, replaces stale entries, and shows restart guidance where needed.

Patina writes host configs to a stable user-level runtime path instead of a per-project Unity package cache path. When the package is updated, the Unity editor package refreshes that managed runtime automatically, so supported MCP hosts do not need to be reconfigured just because the package cache path changed.

3. Start building

Open your MCP host and try:

  • "Log hello to Unity console"
  • "Show me the scene hierarchy"
  • "Create a cube at position 0, 2, 0"

Available Capabilities

Patina keeps the advertised MCP surface compact so hosts do not need to load every Unity command schema into context. Agents should use:

MCP toolWhat it does
patina_capabilitiesSearch or browse the Unity command catalog; request schemas only for specific commands
patina_callExecute a catalog command with JSON parameters
patina_healthInspect Patina version, command count, bridge port, optional Unity editor state, and bridge diagnostics

The 86 commands below are available through patina_capabilities and patina_call.

Scene

ToolWhat it does
get_hierarchyRetrieve the active scene's GameObject tree as nested JSON; supports max_depth and name_filter
get_scene_infoActive scene metadata (name, path, build index, root count, dirty state); pass include_all_scenes for all loaded scenes
open_sceneOpen a scene by project-relative path; mode single (default) or additive
save_sceneSave the active scene or any loaded scene; supports Save As
new_sceneCreate and save a new scene with optional empty or default-game-objects setup

GameObjects

ToolWhat it does
create_game_objectSpawn an empty GameObject or a built-in primitive (Cube, Sphere, Capsule, Cylinder, Plane, Quad)
delete_game_objectPermanently delete a GameObject and all its children
duplicate_game_objectDuplicate a GameObject and its children
reparent_game_objectMove a GameObject under a new parent; pass null to promote to scene root
get_game_object_infoFull details for a named GameObject: transform, tag, layer, and all component properties
set_active_stateShow or hide a GameObject via SetActive()
set_tagSet the tag on a GameObject (tag must be registered in Tags & Layers)
set_layerSet the layer by name; optionally apply to all children
set_transformSet position, rotation (Euler), and/or scale in world or local space in one call

Components & Properties

ToolWhat it does
add_componentAdd a component by short name (Rigidbody) or fully qualified name
remove_componentRemove a component by type name
set_propertySet any serialized property on a component using its SerializedObject path
get_game_object_componentsReturn a lightweight component list for a GameObject

Batch Operations

ToolWhat it does
batch_set_propertiesApply serialized property changes across multiple GameObjects
batch_add_componentsAdd components to multiple GameObjects
batch_set_transformApply transform changes to multiple GameObjects

Prefabs

ToolWhat it does
create_prefabSave a scene GameObject as a prefab asset
instantiate_prefabInstantiate a prefab into the scene at an optional world position
get_prefab_infoInspect a prefab asset or scene instance; returns asset type, overrides list, and instance status
unpack_prefabSever a prefab instance link; outermost (default) or completely
apply_prefab_overridesApply all instance overrides back to the source prefab asset on disk
revert_prefab_overridesRestore a prefab instance to match its source asset
list_prefab_componentsList component types and instance IDs on a prefab asset
edit_prefab_assetPerform a batch of edit operations (add/remove component, add/remove child, set field) on a prefab asset
open_prefab_stageOpen a prefab asset in Unity's prefab stage for editing
close_prefab_stageClose Unity's current active prefab stage, optionally saving changes

Assets

ToolWhat it does
find_assets_by_typeSearch the Asset Database by type filter (t:Material, t:Prefab, t:Texture2D, etc.)
find_assets_by_nameSearch the Asset Database by partial name match
get_asset_infoMetadata for an asset: GUID, type, file size, labels, and importer settings
create_folderCreate a new folder in the Asset Database
move_assetMove an asset to a new project-relative path
rename_assetRename an asset in-place
delete_assetDelete an asset by project-relative path
refresh_asset_databaseTrigger AssetDatabase.Refresh; incremental or force-reimport
set_asset_labelsReplace the full label list on an asset

Materials

ToolWhat it does
create_materialCreate a new Material asset; defaults to URP/Lit
get_material_propertiesRead all exposed shader properties with names, types, and current values
set_material_propertySet a shader property (float, bool, color, vector, or texture path)
assign_materialAssign a Material to a specific Renderer slot

Scripts

ToolWhat it does
create_scriptCreate a new C# script from a template (monobehaviour, scriptableobject, editor_window, plain_class, interface) or verbatim content
resolve_script_typeResolve a MonoScript GUID and asset path by its fully qualified C# type
force_recompileTrigger a Unity script recompile via AssetDatabase.Refresh(ForceUpdate)
compile_and_get_errorsTrigger script recompile and return compiler errors only
get_compilation_errorsGet the list of current compiler errors and warnings
get_script_contentRead the content of a script file in the project
get_assembly_typesList all types declared in a specific assembly

Scriptable Objects

ToolWhat it does
get_scriptable_objectRead serialized fields from a ScriptableObject asset
set_scriptable_object_fieldSet one serialized ScriptableObject field

Validation & Health

ToolWhat it does
validate_sceneScan the active scene for quality issues (missing script references, null serialized fields, and broken prefab connections)
validate_assetsValidate a single prefab asset or a folder recursively for missing scripts, broken object references, and unassigned required serialized fields
get_scene_statsReturn lightweight statistics for the active scene (object count, component count, unique type counts, max depth, etc.)

Search & Query

ToolWhat it does
find_game_objects_by_tagFind all active GameObjects with a given tag
find_game_objects_by_componentFind all scene objects that have a given component type
find_game_objects_by_layerFind all scene objects on a given layer by name
query_game_objectsFind GameObjects matching compound filters
find_game_objects_by_pathFind GameObjects by hierarchy path prefix

Console

ToolWhat it does
log_to_consoleEmit a message to the Unity Console (info, warning, or error)
get_console_logsRead buffered console entries; filterable by type, capped by max_results
clear_consoleClear all console log entries

Editor State & Control

ToolWhat it does
get_editor_stateCurrent editor flags and main-thread responsiveness; returns a limited blocked state with blockedByModalDialogLikely if Unity is not processing editor updates
get_project_settingsRead-only snapshot of key project settings (version, build target, color space, physics gravity, etc.)
set_play_modeEnter, exit, pause, unpause, or step play mode
execute_menu_itemExecute any Editor menu item by full path (e.g. Assets/Refresh)
get_selectionReturn the current Editor selection (scene objects and/or asset paths)
set_selectionSet the Editor selection to specific GameObjects and/or asset paths

Undo

ToolWhat it does
begin_undo_groupOpen a named Unity Undo group
end_undo_groupCollapse operations into the current Undo group
undoPerform one or more Undo steps
redoPerform one or more Redo steps
get_undo_stackReturn current Undo and Redo stack entry names

Build & Player Settings

ToolWhat it does
get_build_settingsBuild Settings snapshot: active target, scripting backend, and full scene list
set_build_scenesReplace the Build Settings scene list with an ordered list of scene paths
get_player_settingsRead Player Settings for a build target group (Standalone, Android, iOS, WebGL)
set_player_settingsWrite Player Settings fields; only non-null fields are changed
set_build_targetSwitch the active build target (blocks the main thread on large projects)

Test Runner

ToolWhat it does
run_testsStart a Unity Test Runner execution
get_test_resultsReturn results from the most recent test run
get_test_listList available Unity tests

Animation

ToolWhat it does
get_animator_infoRead Animator Controller parameters and state information
set_animator_parameterSet an Animator parameter in play mode
list_animation_clipsList AnimationClip assets in the project

Supported Hosts

HostSetup
Antigravity CLI (agy)Automatic
Claude Code (Anthropic CLI)Automatic (~/.claude.json)
Claude DesktopAutomatic
CursorAutomatic
Visual Studio CodeAutomatic
GitHub Copilot (VS Code)Linked via VS Code config
Gemini CLIAutomatic
JetBrains Rider / JunieAutomatic
Codex CLIAutomatic

The setup window also detects stale entries, missing hosts, and provides a clean Remove Patina From Hosts action.

Troubleshooting

If a Patina call reports EDITOR_BLOCKED, or mentions that Unity may be waiting on a modal dialog, check the Unity Editor for a save-changes prompt or other blocking popup. Patina cannot safely run queued editor commands while Unity is waiting for user input. Resolve the Unity prompt, then retry the MCP command or run patina_health with {"include_unity_state": true}.

Roadmap

PhaseFocus
Phase 1 โœ“Core tools: console, hierarchy, object creation
Phase 2 โœ“Expanded coverage: scene management, asset operations, component editing
Phase 3 (current)Distribution and reach: Git URL installation docs, package layout, release pipeline

Local Development

Contributor source checkout

Use this when you are editing unity-package/ or rust-server/ directly from the repository:

  1. Point Unity at the local package checkout.
    • file:<your-clone-path>/unity-package
  2. Build the Rust server.
cd rust-server && cargo build --release
  1. Publish the current binary into the local development runtime path.
pwsh -File scripts/publish-dev-runtime.ps1
  1. In Unity, open Window > Patina Unity MCP, enable Use Local Runtime (Contributor), and click One-Click Setup.

This writes host configs against the local dev runtime instead of the managed packaged runtime. Re-run One-Click Setup after every new cargo build --release + publish-dev-runtime pass, and use Remove Patina From Hosts before switching back to the packaged flow.

Stage a local UPM test package

Use this when you want to test the package as it will be published, not the raw source checkout:

pwsh -File scripts/stage-local-upm.ps1

Then add the staged package from disk in Unity:

  • dist/local-upm/com.taygunsavas.patina-unity-mcp/package.json

Prefer the staged local package when you are validating package layout, import behavior, or release packaging. Prefer the source checkout path when you are actively editing source and want the fastest edit-build-run loop.

See CONTRIBUTING.md for the full contributor workflow.

Community and Contributing

  • Start with CONTRIBUTING.md for the local development loop, validation expectations, and pull request guidance.
  • Use GitHub issue forms for reproducible bugs, feature proposals, and usage questions so maintainers get the context they need.
  • Read .github/SUPPORT.md before opening a help request.
  • Read .github/SECURITY.md for private vulnerability reporting.
  • Read .github/CODE_OF_CONDUCT.md before participating in issues and pull requests.
  • Pull requests targeting main are expected to pass CI and go through CODEOWNERS + Copilot review once repository rules are enabled.

Requirements

  • Unity 6 (6000.3 LTS+)
  • A supported MCP host
  • Rust 1.75+ (contributors only)

License

MIT

Related MCP Servers

3aKHP/prts-mcp

๐Ÿ ๐Ÿ“‡ โ˜๏ธ ๐Ÿ  - MCP Server for Arknights, querying the PRTS Wiki API and serving auto-synced operator archives and voice lines from game data. Designed for fan-creation (ๅŒไบบๅ‰ตไฝœ) AI agents. Python (stdio/Docker) and TypeScript (Streamable HTTP) implementations.

๐ŸŽฎ Gaming0 views
alex-gon/thegamecrafter-mcp-server

๐Ÿ“‡ โ˜๏ธ - Design, manage, and price tabletop games on The Game Crafter. Browse catalogs, create projects, upload artwork, get pricing.

๐ŸŽฎ Gaming0 views
antics-gg/antics-mcp

๐Ÿ“‡ โ˜๏ธ - Deploy a single-file HTML game to a shareable multiplayer URL with rooms, state sync, and leaderboards. No backend or player accounts.

๐ŸŽฎ Gaming0 views
beckettlab/beckett-godot-mcp

๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Beckett โ€” MCP for Godot: a zero-sidecar GDScript editor addon that serves MCP over Streamable HTTP from inside the Godot 4 editor (no Node/Python sidecar). Reflection over any class, validate-before-write GDScript, scene/script/resource authoring, and a runtime play-test loop (play, screenshot, input, assert). MIT.

๐ŸŽฎ Gaming0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it โ†’
โ˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.