Logo UnityAssetDB

UnityAssetDB

Tổ chức
song-chaoyang

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

Nhà phát hànhsong-chaoyang
Kho mãUnityAssetDB
Ngôn ngữRust
Bản fork
5
Sao
63
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    UnityAssetDB cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    63 sao và 5 bản fork từ kho mã được liên kết.


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

Cài đặt

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

Dùng MCP UnityAssetDB với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối UnityAssetDB, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm UnityAssetDB làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của UnityAssetDB.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "unityassetdb": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của UnityAssetDB, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của UnityAssetDB.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng UnityAssetDB giúp tôi làm việc này không?
UnityAssetDB
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng UnityAssetDB.

Câu hỏi thường gặp

Máy chủ MCP UnityAssetDB dùng để làm gì?

UnityAssetDB là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP UnityAssetDB với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng UnityAssetDB với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP UnityAssetDB với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối UnityAssetDB, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP UnityAssetDB với TypingMind?

UnityAssetDB hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP UnityAssetDB cung cấp những công cụ nào trong TypingMind?

UnityAssetDB cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP UnityAssetDB không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu UnityAssetDB yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇