lemwaiping123-eng/unity-mcp
MCP server for Unity — give Claude and other AI assistants deep understanding of your Unity scenes, prefabs, components, and runtime spawns
Platform-specific configuration:
{
"mcpServers": {
"unity-mcp": {
"command": "npx",
"args": [
"-y",
"unity-mcp"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
The first Model Context Protocol server for Unity projects. Give Claude, Cursor, Windsurf, and any MCP-compatible AI assistant *real* understanding of your Unity scenes, prefabs, and C# scripts — not just file search.
[](https://www.npmjs.com/package/unity-mcp) [](LICENSE) [](https://modelcontextprotocol.io) [](https://unity.com)
---
When you ask an AI assistant about your Unity project, it reads .cs files — but Unity's real architecture lives in YAML. A PlayerController script might be attached to 12 different prefabs, referenced by 3 different managers, and spawned at runtime by 2 different spawners. None of that is visible from C# alone.
unity-mcp exports your project's complete scene graph (GameObjects → Components → Inspector references → runtime spawns), turns it into a queryable knowledge graph, and makes it available to any MCP-compatible AI through a set of fast, structured tools.
AI asks: "Which scripts reference the Player prefab?"
unity-mcp answers with: 7 scripts, 12 scene objects, 3 runtime spawn sites
— in under 50ms---
You: What components are on the EnemyBoss prefab?
Claude: EnemyBoss.prefab has 4 components:
• EnemyAI (Assets/Scripts/AI/EnemyAI.cs)
• EnemyParent (Assets/Scripts/Enemy/EnemyParent.cs)
• PhotonView (Photon PUN — no script file)
• NavMeshAgent (Unity built-in)
Inspector refs wired up:
EnemyAI.player → Player (scene object, tag: Player)
EnemyAI.spawnPoint → SpawnPoint (scene object)
EnemyParent.healthBar → HealthBar.prefab
Runtime: EnemySpawner.cs line 47 instantiates EnemyBoss via enemyPrefab field.---
Loading reviews...