unity-indexer
Indexes Unity projects (scenes, prefabs, C# scripts, assets) into a SQLite database and provides 23 MCP tools for structured query and exploration of the project's game objects, components, scripts, and dependencies.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@unity-indexerfind all scripts that inherit from MonoBehaviour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
unity-indexer
Token-efficient Unity project explorer for Claude Code
Quick Start • Installation • How it works • Tools • Development
unity-indexer indexes a Unity project — scenes, prefabs, C# scripts, and assets — into a SQLite database and exposes 23 MCP tools so Claude can explore the project via structured queries. Instead of reading raw .unity, .prefab, and .asset files (Unity's non-standard YAML with GUIDs), Claude calls purpose-built tools that return exactly what's needed.
Works as a Claude Code plugin (MCP server auto-registered on install) or as a standalone npm package.
⚡ Quick Start
Claude Code plugin — zero config:
/plugin marketplace add Mbogdan95/unity-indexer
/plugin install unity-indexer@unity-indexerMCP server auto-registers on install. Tools are available in the next session.
npm — manual setup:
npx unity-indexer install # register in Claude Code settings
npx unity-indexer <path-to-project> # start the serverRelated MCP server: MCP Game Deck
📦 Installation
Claude Code Plugin
/plugin marketplace add Mbogdan95/unity-indexer
/plugin install unity-indexer@unity-indexerMCP server auto-registers on install — no manual configuration needed.
npm / Manual
# Option A: without global install
npx unity-indexer install # registers in ~/.claude/settings.json
npx unity-indexer <project-path> # start the server
# Option B: global install
npm install -g unity-indexer
unity-indexer install
unity-indexer <project-path>install writes to Claude Code settings. Use --scope to select the settings file:
Scope | File |
|
|
|
|
|
|
|
|
unity-indexer install --scope project🚀 Starting the server
Direct path — index a specific Unity project:
npx unity-indexer <path-to-unity-project>Auto-discovery — scan the current directory for Unity projects:
npx unity-indexerWith no arguments, unity-indexer scans 3 levels deep for directories containingAssets/ and ProjectSettings/. All found projects are indexed and available via project:.
The index database is stored in .unity-indexer/ at each project root and auto-added to .gitignore.
🏗️ How it works
Architecture
┌───────────────────────────────────────────┐
│ Claude Code (MCP client) │
└─────────────────────┬─────────────────────┘
│ 23 MCP tool calls
┌─────────────────────▼─────────────────────┐
│ MCP Server │
└─────────────────────┬─────────────────────┘
│ SQL + graph queries
┌─────────────────────▼─────────────────────┐
│ Index Store │
│ │
│ SQLite Graphology │
│ ├─ files (in-memory) │
│ ├─ game_objects ├─ INHERITS │
│ ├─ components ├─ IMPLEMENTS │
│ ├─ scripts ├─ CALLS │
│ ├─ script_members ├─ SUBSCRIBES_TO │
│ ├─ guids └─ USES │
│ ├─ references │
│ └─ graph_edges ──────▶ loaded on start │
└─────────────────────┬─────────────────────┘
│ parse & upsert
┌─────────────────────▼─────────────────────┐
│ Parser Pipeline │
│ │
│ .meta ──▶ GUID registry │
│ .cs ──▶ tree-sitter AST │
│ .unity ──▶ scene hierarchy │
│ .prefab ──▶ prefab tree │
│ .asset ──▶ ScriptableObject fields │
│ .asmdef ──▶ assembly dependencies │
└─────────────────────┬─────────────────────┘
│ file events
┌─────────────────────▼─────────────────────┐
│ File Watcher (chokidar) │
│ Assets/ · 500 ms debounce │
└───────────────────────────────────────────┘Indexing pipeline
On first run, unity-indexer walks Assets/ and indexes files in four phases:
Phase | Files | Why first |
1 — Meta |
| Builds the GUID → file path registry. Every subsequent parser needs this to resolve asset references. |
2 — Scripts |
| Populates the class registry. Scene/prefab parsers need class names to resolve component script GUIDs. |
3 — Scenes & Prefabs |
| Resolves GUIDs to class names using phases 1 & 2. Builds the full GameObject hierarchy. |
4 — Assets & AsmDefs |
| ScriptableObject data and assembly dependency graph. |
Each file passes a two-stage guard before parsing: mtime check (fast — skips unchanged files) then SHA-256 content hash (catches content changes with no mtime update). Only changed files are re-parsed.
C# parsing
Scripts are parsed with tree-sitter (C# WASM grammar — no external toolchain). The parser extracts:
Class name, namespace, base class, interfaces
Members: fields, methods, properties, events — with access modifiers, return types, parameters, attributes, and exact line numbers
Unity-specific flags:
MonoBehaviour,ScriptableObject,Editorsubclass detectionRelationships: what this class calls, inherits, implements, uses, or subscribes to
Method bodies are not stored. Tools return file_path + start_line/end_line per member — fetch bodies on demand with Read.
Code graph
C# class relationships are stored as a directed graph (graphology) with five edge types:
Edge | Meaning |
| Class extends another class |
| Class implements an interface |
| Method calls a method on another class |
| Event subscription ( |
| Field/property reference to another type |
Graph tools (trace_dependencies, find_path, detect_cycles, etc.) load this graph in-memory from graph_edges in SQLite and run graphology algorithms over it.
Incremental updates
The file watcher monitors Assets/ (not Packages/ — rarely changes). Changes batch with a 500 ms debounce to avoid thrashing on large saves. When more than 50 files change within 2 seconds (e.g. a git checkout), the indexer switches to bulk mode and reindexes all affected files.
Importance scoring & summaries
Every file and GameObject gets a float importance_score [0, 1] from:
Incoming reference count (how many other files reference it)
Presence of custom scripts
Change frequency
Hierarchy depth (for GameObjects)
Scores rank results — high-importance items surface first.
Pre-computed one-line summaries (component_summary, api_summary, subtree_summary) are stored alongside structured data. Most tools return summaries by default; drill-down calls fetch full detail on demand.
SQLite schema (key tables)
Table | Contents |
| Every indexed file with type, hash, mtime, importance score |
| GUID → file path mapping from |
| GameObject hierarchy with component summary + subtree summary |
| Component type, script GUID, serialized fields (default values stripped) |
| C# class metadata: namespace, base class, interfaces, assembly |
| Fields, methods, properties with signatures and line numbers |
| GUID-based cross-file references (scene/prefab → script/asset) |
| Code relationship graph (INHERITS, CALLS, USES, etc.) |
| Timestamped file change history |
|
|
🔧 Available Tools
Tool | Description |
| GameObject tree for a scene or prefab. Start here when orienting in an unfamiliar scene. |
| GameObject hierarchy for a prefab file. |
| Full details (components, children) for a specific GameObject. |
| A specific component on a named GameObject. |
Tool | Description |
| List C# classes, filterable by namespace, base class, assembly, or MonoBehaviour. |
| Members with signatures and line numbers, plus callers/callees/implementors. Returns |
| Same as |
| Details for a single member of a C# class. |
Tool | Description |
| All files and code that reference a GUID or class name — scene/prefab usage and code callers. |
| Outgoing references from a file, class, or GUID. |
| Resolve a Unity GUID to a file path and asset type. |
Tool | Description |
| Transitive dependency chain from a class. |
| Everything that depends on a class (impact analysis). |
| Shortest relationship path between two nodes. |
| Local neighborhood of a node. |
| Find circular dependencies in a namespace or assembly. |
| Graph metrics: node counts, edge counts, density. |
| All classes implementing a given interface. |
Tool | Description |
| Search files, GameObjects, or scripts by name. |
| All GameObjects that have a specific component type attached. |
| Unity |
| Files changed recently. Pass an ISO 8601 timestamp to filter. |
| Find scripts, assets, or scenes with no incoming references — a starting point for cleanup. Supports |
📁 Multiple projects
When multiple projects are indexed, pass project: "<name>" to scope any tool call. The name is the directory name of the Unity project root.
project: "MyGame"Omit it when only one project is indexed.
🛠️ Development
Node.js >= 20.17.0 required.
npm run build # compile TypeScript
npm run test # run tests (vitest)
npm run typecheck # type-check without emitting
npm run lint # eslint
npm run ci # typecheck + lint + format-check + test + build📄 License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mbogdan95/unity-indexer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server