Unity Project Brain

Unity Project Brain

Read-only MCP server that provides AI agents with context about Unity project relationships, including scenes, prefabs, scripts, GUIDs, and code impact analysis.

Category
访问服务器

README

Unity Project Brain

verify Apache-2.0

Unity Project Brain is an open-source AI context engine and local project intelligence layer for real Unity repositories. It combines a GitNexus code graph with Unity GUID/fileID, scene, prefab, GameObject, component, optional Roslyn symbol, runtime evidence, and Git history relationships behind read-only MCP and Context API surfaces for AI coding agents.

The project helps an AI answer questions such as:

  • Which scenes and prefabs use this script, sprite, material, or component?
  • Which GameObjects would be affected if a Unity GUID disappeared?
  • What is the blast radius of changing or renaming a code symbol?
  • Which technical gates should run before accepting a change?
  • Which answer came from serialized Unity data, code analysis, runtime evidence, or Git history?

Project Brain does not edit Unity projects. Mutation tools remain separate and must pass Unity verification before their results become trusted evidence.

Current public release

Version 0.2.0 includes:

  • the com.heycici.project-brain read-only Unity Editor bridge;
  • no-clone Unity Package Manager and tagged Python backend installation;
  • project-scoped GitNexus orchestration;
  • full and focused indexes;
  • read-only, repository-restricted MCP descriptors;
  • deterministic Git revision/worktree fingerprints for full indexes;
  • deterministic source-tree fingerprints for focused indexes;
  • Unity .meta, scene, prefab, component, and asset-reference graph building;
  • optional Roslyn-compatible symbol-to-MonoScript identity links;
  • incremental Unity graph planning and integrity verification;
  • versioned change envelopes;
  • an evidence store with provenance and confidence;
  • a read-only CLI and loopback HTTP Context API;
  • public data schemas and privacy gates.
  • a versioned Visual RAG context exporter for specialist applications.

GitNexus method-call edges are not yet imported into the unified SQLite Unity graph. Use the GitNexus MCP surface for code impact and the Context API for Unity identity and serialized usage until that connector is complete.

Architecture

Git repository + Unity project + optional symbol catalog
                  |
        +---------+----------+
        |                    |
  GitNexus code graph   Unity identity graph
        |                    |
        +-------- Context API+
                  |
          AI agents and tools
                  |
     external mutation + Unity verification
                  |
           versioned evidence

Project Brain stores rebuildable indexes, not authoritative source. Unity serialized files remain authoritative for GUID/fileID relationships, Git remains authoritative for history, and verification reports remain independent evidence.

Install the Unity bridge

Unity users do not need to clone this repository. In Window > Package Management > Package Manager, select Install package from Git URL and paste:

https://github.com/orange91pku/unity-ai-project-brain.git?path=/Packages/com.heycici.project-brain#v0.2.0

After Unity compiles, open Tools > HeyCici > Project Brain. See the UPM installation guide for a project manifest example, updates, uninstall and backend setup.

Requirements

  • Node.js 22.15 or newer
  • pnpm
  • Python 3.11 or newer
  • Git 2.14+
  • A Unity project using text serialization for full scene/prefab visibility

Node and pnpm are required only for GitNexus orchestration. Python is required only for the external identity graph and Context API. The Unity bridge has no runtime dependency on either.

Backend quick start without cloning

Install the tagged Python backend directly from Git:

python -m pip install \
  "unity-ai-project-brain @ git+https://github.com/orange91pku/unity-ai-project-brain.git@v0.2.0"

Build and validate the Unity identity graph:

python -m project_brain.unity_graph build \
  --repository /absolute/path/to/my-unity-game \
  --unity-project /absolute/path/to/my-unity-game/UnityProject \
  --policy /absolute/path/to/index-policy.json \
  --database /absolute/path/to/.project-brain/unity-graph.sqlite

python -m project_brain.unity_graph validate \
  --database /absolute/path/to/.project-brain/unity-graph.sqlite

Source-development quick start

pnpm install --frozen-lockfile
python -m pip install -e .
cp config/projects.example.json config/projects.local.json

Edit config/projects.local.json with absolute paths, then:

pnpm run doctor -- --project my-unity-game
pnpm run analyze -- --project my-unity-game
pnpm run status -- --project my-unity-game
pnpm run print-mcp -- --project my-unity-game

Build and validate the Unity identity graph from the development checkout:

python -m project_brain.unity_graph build \
  --repository /absolute/path/to/my-unity-game \
  --unity-project /absolute/path/to/my-unity-game/UnityProject \
  --policy config/index-policy.example.json \
  --database .project-brain/unity-graph.sqlite

python -m project_brain.unity_graph validate \
  --database .project-brain/unity-graph.sqlite

Start the read-only Context API on loopback:

python -m project_brain.context_api serve \
  --graph .project-brain/unity-graph.sqlite \
  --repository /absolute/path/to/my-unity-game \
  --unity-project /absolute/path/to/my-unity-game/UnityProject \
  --host 127.0.0.1 \
  --port 8765

See Getting started, Architecture, and Unity CLI guidance.

Read-only boundary

  • MCP defaults to read-only.
  • MCP is restricted to the selected analysis root.
  • The Context API has no mutation endpoint.
  • Generated indexes and local paths are gitignored.
  • AI suggestions are context, not authorization to edit.
  • Any external mutation must compile and pass project-specific Unity gates.

Related application

Unity AI Visual Reskin (ReVisualReskin) is a separate project and database. It can consume Project Brain context to understand where UI and art are used, but owns its own Visual RAG, theme catalog, mappings, A/B evidence, and reskin transactions.

The two systems exchange stable IDs and versioned JSON. Neither reads the other's database directly.

Export a Visual RAG context after building and validating the Unity graph:

python -m project_brain.visual_context export \
  --graph .project-brain/unity-graph.sqlite \
  --repository /absolute/path/to/repository \
  --unity-project /absolute/path/to/repository/UnityProject \
  --project-id studio.game \
  --output .project-brain/visual-context.json

The exporter is read-only. It emits asset content hashes plus exact GUID, fileID, owner asset, component and GameObject hierarchy evidence using hydracore.project-brain.visual-context/v1. ReVisualReskin may consume that file, but it never receives direct database access or mutation authority.

Licensing

The Project Brain code in this repository is licensed under Apache-2.0.

The pinned gitnexus@1.6.9 dependency is separately licensed under PolyForm Noncommercial 1.0.0. Installing or using it requires compliance with that upstream license. See Third-party notices.

This project is not affiliated with or endorsed by Unity Technologies or the GitNexus maintainers.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选