UnityAssetDBのロゴ

UnityAssetDB

組織
song-chaoyang

🗄️ Every Unity asset reference in one queryable database. Rust + SQLite + tree-sitter. CLI + Web UI + MCP server.

公開者song-chaoyang
リポジトリUnityAssetDB
言語Rust
フォーク
5
スター
63
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    UnityAssetDBは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには63件のスターと5件のフォークがあります。


Why UnityAssetDB?

Unity projects grow into tangled webs of asset dependencies. "Who references this material?" "Is this texture safe to delete?" "Which scenes use this prefab?" — answering these questions by hand means grepping through thousands of YAML files.

UnityAssetDB indexes your entire Unity project into a SQLite database and answers these questions in under 1 millisecond.

$ unityassetdb refs Assets/Materials/Enemy.mat

📂 Assets/Materials/Enemy.mat (2 referenced by)
────────────────────────────────────────────────────────────────
  ← Assets/Scenes/Game.unity [scene] via depends_on (guid-file)
  ← Assets/Scenes/Game.unity [scene] via instance_of
2 reference(s) total

✨ Key Features

FeatureWhat it does
🔗 Reference TrackingTrace any asset's incoming/outgoing dependencies via GUID resolution
🌳 Hierarchy BrowserNavigate GameObject trees, component bindings, Transform parent/child
🔬 C# Script Analysistree-sitter powered class/method extraction + MonoBehaviour binding
📁 Virtual File SystemQuery assets as virtual paths with glob, grep, and tree listing
🌐 Interactive Web UIvis.js dependency graph, click-to-explore, REST API
🔌 MCP ServerJSON-RPC over stdio — integrate with any MCP-compatible tool
⚡ Blazing FastRust + SQLite + rayon parallelism — 10,000+ files/sec
📦 Zero DependenciesSingle static binary, no runtime needed

Quick Start

Install

bash
# Download pre-built binary (macOS / Linux / Windows)
# → https://github.com/song-chaoyang/UnityAssetDB/releases

# Or build from source
cargo install --git https://github.com/song-chaoyang/UnityAssetDB

3 Steps to Go

bash
# 1️⃣  Index your Unity project
unityassetdb index build /path/to/your/unity/project

# 2️⃣  Query references
unityassetdb refs Assets/Materials/Enemy.mat -p /path/to/project

# 3️⃣  Launch the Web UI
unityassetdb serve /path/to/project --port 8089

Live Progress Feedback

The 8-phase pipeline renders a live multi-bar display — weighted overall percentage + ETA, a phase bar with throughput and live extraction stats, and the file currently being processed:

⠸ [00:00:12] ████████████░░░░░░░░  48% 3/8 extract · ETA 08s
⠹ ████████████████░░░░░  extract 31,422/54,120 · 2,615/s · 892K objs · 1.2M refs · 2.3 GB
  📄 Assets/Scenes/MainMenu.unity

When it finishes, you get a per-phase timing breakdown so you always know where the time went:

  phase breakdown:
    scan          1.8s  ████████████████████
    register      0.6s  ██████
    extract      14.2s  ████████████████████████████
    assets        0.9s  ██
    graph         2.7s  █████
    bind          0.4s  █
    vfs           1.1s  ██
    publish       0.2s
✅ Index built in 21.4s: .unityassetdb/index.db (54,120 files, 12,830 assets, 8,221 scripts bound, 2,529 files/s)

Demo: Reference Query


CLI Reference

unityassetdb <COMMAND>

Commands:
  index   Index management (build / sync / status)
  refs    Query the reference graph for a VFS path
  ls      List VFS entries under a path
  glob    Find VFS entries matching a glob pattern
  grep    Search content within VFS entries
  read    Read content of a VFS entry
  serve   Start web server with interactive graph UI
  mcp     Start MCP server (JSON-RPC over stdio)
  help    Print this message

Common Queries

bash
# Who references this material? (incoming)
unityassetdb refs Assets/Materials/Enemy.mat -p /project

# What does this scene depend on? (outgoing)
unityassetdb refs Assets/Scenes/Game.unity -p /project --direction out

# Filter to file-level results only
unityassetdb refs Assets/Materials/Enemy.mat -p /project --filter File

# Browse the asset tree
unityassetdb ls Assets -p /project --depth 2

# Find all prefabs
unityassetdb glob "*.prefab" -p /project

# Search for a class name in indexed content
unityassetdb grep "PlayerController" -p /project

# View index statistics
unityassetdb index status /project

Architecture

How It Works

UnityAssetDB runs a 7-stage indexing pipeline:

StageWhat happens
1. DiscoveryWalk Assets/, Packages/, ProjectSettings/ with walkdir. Parse .meta files for GUIDs.
2. ExtractParse Unity YAML (.unity, .prefab, .mat, .asset) with serde_yaml. Parse C# with tree-sitter. Extract objects, references, declarations.
3. ResolveBuild entity graph: GameObject→Component edges, Transform hierarchy, prefab instance links, script-to-symbol bindings.
4. MaterializeProject entities into a Virtual File System (VFS) with queryable paths and edges.
5. FinalizeIntegrity checks — verify no broken VFS edges.
6. PublishAtomic SQLite database swap-in.
7. SyncIncremental update — only re-index changed files based on content hash.

SQLite Schema — 19 Tables

LayerTablesPurpose
Filesfiles, assemblies, assembly_referencesTrack every file + .meta GUID
YAMLyaml_objects, yaml_referencesParsed Unity YAML structure + references
C#cs_declarations, cs_mentions, symbols, symbol_edgestree-sitter extracted code structure
Graphassets, entities, entity_edges, entity_symbol_edgesEntity relationship graph
VFSvfs_entries, vfs_edgesVirtual file system for querying
Metaprojects, index_diagnostics, rebuild_summaryIndex metadata

VFS Edge Types

EdgeMeaning
child_ofDirectory → file, parent → child
defined_inNode → file where it's defined
depends_onFile → referenced file (via GUID)
instance_ofPrefab instance → source prefab
binds_toComponent → C# script class
refsGeneral reference edge

REST API

When running serve, these endpoints are available:

EndpointDescription
GET /api/statusIndex statistics (file count, asset count, etc.)
GET /api/ls?path=...&depth=NList VFS children
GET /api/refs?path=...&direction=in&filter=ALLReference query
GET /api/glob?pattern=...&entry_type=ALLGlob search
GET /api/grep?pattern=...&path=...Content search
GET /api/read?path=...Read VFS entry content
GET /api/graph?path=...Subgraph for visualization (nodes + edges)

MCP Server

UnityAssetDB can run as an MCP (Model Context Protocol) server, exposing 7 tools via JSON-RPC over stdio.

bash
unityassetdb mcp

Configuration

Add to your MCP client config file (e.g. claude_desktop_config.json):

json
{
  "mcpServers": {
    "unityassetdb": {
      "command": "/path/to/unityassetdb",
      "args": ["mcp"]
    }
  }
}

Available Tools

ToolDescription
index_buildBuild a fresh index for a Unity project
index_statusShow index statistics
refsQuery reference graph (in/out, with filter)
lsList VFS entries
globGlob pattern search
grepContent search
readRead VFS entry content

Supported File Types

ExtensionKindParser
.unity, .sceneSceneUnity YAML
.prefabPrefabUnity YAML
.matMaterialUnity YAML
.assetScriptableObjectUnity YAML
.controller, .overrideControllerAnimatorUnity YAML
.animAnimationUnity YAML
.vfxVisual EffectUnity YAML
.csC# Scripttree-sitter
.asmdef, .asmrefAssembly DefinitionJSON
.shader, .hlslShaderText
.fbx, .png, .wav, ...BinaryHash only

Tech Stack

ComponentTechnologyWhy
LanguageRustZero-cost abstractions, memory safety, single binary
Databaserusqlite (bundled)Recursive CTE queries, WAL mode, zero-config
C# Parsertree-sitterIncremental parsing, AST extraction
YAML Parserserde_yamlUnity multi-document YAML support
Web Serveraxum + tokioAsync, type-safe routing
ParallelismrayonData-parallel file extraction
Graph UIvis.jsInteractive network visualization

Benchmarks

Measured on a real Unity project (URP + TextMeshPro, Apple Silicon MacBook):

Project SizeFilesIndex TimeThroughputDB Size
Test fixture10<0.1s—48 KB
Real project (Assets + PackageCache)12,96913.6s~950 files/s185 MB

Indexing covers Assets/, Packages/, ProjectSettings/ and Library/PackageCache/ (built-in package scripts resolve too). Includes indexing file bodies for grep/read.


Development

bash
cargo test      # Run all 32 tests
cargo clippy    # Lint
cargo fmt       # Format
cargo bench    # Benchmarks

Project Structure

src/
├── model/          # Data types (FileKind, AssetKind, EntityKind, EdgeKind)
├── discovery/      # File system scanning + .meta parsing
├── extract/         # Unity YAML + C# tree-sitter parsers
├── resolve/        # Entity graph construction + script binding
├── materialize/    # VFS projection
├── db/              # SQLite schema + connection management
├── query/           # refs, ls, glob, grep, read
├── cli/             # CLI + MCP command handlers
├── server/          # axum REST API
└── web/             # Embedded HTML/JS/CSS

tests/
├── fixtures/        # Minimal Unity test project
└── integration_test # 32 tests: unit + integration

Download

Pre-built binaries available on the Releases page:

PlatformDownload
macOS (Apple Silicon)unityassetdb-aarch64-apple-darwin.tar.gz
macOS (Intel)unityassetdb-x86_64-apple-darwin.tar.gz
Linux (x86_64)unityassetdb-x86_64-unknown-linux-gnu.tar.gz
Windows (x86_64)unityassetdb-x86_64-pc-windows-msvc.zip

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Star History

Star History Chart

License

MIT © 2026

インストール

TypingMind
{
  "mcpServers": {
    "unityassetdb": {
      "command": "unityassetdb",
      "args": [
        "mcp"
      ]
    }
  }
}

UnityAssetDBのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度UnityAssetDBに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

UnityAssetDBをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. UnityAssetDBのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "unityassetdb": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてUnityAssetDBのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. UnityAssetDBのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
UnityAssetDBを使ってこのタスクを手伝ってもらえますか?
UnityAssetDB
はい、読みました。
UnityAssetDBで調べた結果をお伝えします。

よくある質問

UnityAssetDB MCPサーバーは何に使いますか?

UnityAssetDBは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでUnityAssetDB MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでUnityAssetDBを利用できます。

TypingMindでUnityAssetDB MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。UnityAssetDBを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

UnityAssetDB MCPをTypingMindに接続するにはどうすればよいですか?

UnityAssetDBはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでUnityAssetDB MCPのどのようなツールを利用できますか?

UnityAssetDBはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

UnityAssetDB MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。UnityAssetDBで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇