Unity MCP + GraphRAG
Provides tools for controlling and inspecting the Unity Editor via a Unity plugin, including editor operations, Unity API/source knowledge retrieval, asset library workflows, and running EditMode/PlayMode tests with Unity Test Runner.
Click on "Deploy 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 MCP + GraphRAGSearch Unity API for Rigidbody.AddForce with code examples"
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 MCP + GraphRAG
为 Codex、CodeBuddy 等 MCP 客户端提供 Unity 编辑器操作、API 检索、源码参考和资产库能力。
Codex / CodeBuddy → FastMCP → ChromaDB / LightRAG
→ UnityBridge → Unity 编辑器插件默认使用 BAAI/bge-m3 向量检索;需要图谱关系时显式指定 sources。图谱使用 Ollama,默认模型 gemma3:4b,可通过 UNITY_MCP_RAG_MODEL 覆盖。缺少图谱或模型不影响 Unity 操作工具启动。
快速开始
安装环境:在 Windows 运行
install.bat,自动创建虚拟环境、安装依赖并生成 MCP 配置。导入 Unity 插件:Package Manager → “Add package from disk” → 选择
UnityPlugin/package.json,等待编译完成。接入 MCP 客户端:将生成的
mcp.json合并到 CodeBuddy(%USERPROFILE%\.codebuddy\mcp.json)或 Codex。验证连接:读取
mcpforunity://health确认服务,读取mcpforunity://editor/state确认 Unity 已连接,再执行编辑器操作。
knowledge_search(query="Rigidbody.AddForce", include_full_content=True)
knowledge_unified_search(query="GameObject 和 Component 的关系", sources=["vector", "api_graph"])Unity API 知识库(22702 条 API,约 738MB)不随仓库分发,需从 GitHub Release 下载,详见 使用说明。
详细安装、环境变量、换电脑部署与故障排查见 使用说明。已实现工具列表以客户端 tools/list 为准;run_tests 已接入 Unity Test Runner,支持 EditMode / PlayMode。
Related MCP server: Agent Bridge for Unity
文档与验证
.codebuddy/ 提供可选的客户端工作流。备份、会话管理和 IDE 本身的项目管理不属于 MCP 核心服务职责。
This server cannot be deployed
Maintenance
Related MCP Connectors
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Capability registry for the agentic economy. Semantic search over verified MCP server listings.
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI clients to interact with and control the Unity Editor through a Python MCP server bridge, allowing natural language-based Unity project manipulation.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to control the Unity Editor through MCP, allowing scene building, runtime scripting, visual QA, and more.5Apache 2.0
- AlicenseNot gradedqualityBmaintenanceAllows MCP clients like Claude Desktop or Cursor to perform Unity Editor actions, including asset management, scene modification, and game mechanic testing.22MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to control the Unity Editor via MCP, allowing scene manipulation, asset management, compilation, and testing through natural language.MIT