Skip to content

Commit 6da2205

Browse files
TMHSDigitalclaude
andcommitted
feat: add analyze_project MCP tool for project-aware answers
Reads a Unity project from disk (no running editor needed) and reports the editor version, the render pipeline in use, notable packages, active input handling, scripting backend, API compatibility, scripting define symbols, and assembly definitions. The pipeline is resolved from the asset assigned in GraphicsSettings or per quality level in QualitySettings, matched by GUID to its .meta file and identified by the URP/HDRP pipeline asset script GUIDs (taken from the 6000.0 package sources), with package-based fallbacks and a note when an SRP is installed but unassigned. Field layouts were checked against public Unity 6 projects, and the tool was run against Unity's game-programming-patterns-demo (6000.0.9f1, URP per quality level). The render-pipeline-detection, input-systems, and platform-targeting skills now tell the agent to call analyze_project first. Docs and tool counts updated to 5 tools. Closes #38 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpEiWjv38TrdFcgqU8ER5L
1 parent 7a8e0de commit 6da2205

13 files changed

Lines changed: 500 additions & 15 deletions

File tree

‎.cursorrules‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You are working on Unity Developer Tools, a Cursor IDE plugin for Unity game dev
77
- `rules/` - 8 .mdc rule files (C# conventions, lifecycle, performance, naming, serialization, shaders, visual scripting, security)
88
- `snippets/` - 20 code snippets organized by type (csharp, shaders, visual-scripting)
99
- `templates/` - 5 starter templates (2d-platformer, 3d-fps, ui-menu-system, scriptableobject-architecture, editor-tool)
10-
- `mcp-server/` - Python FastMCP server with 4 tools and JSON data files
10+
- `mcp-server/` - Python FastMCP server with 5 tools and JSON data files
1111
- `docs/` - architecture, roadmap, contributing, getting started
1212
- `.github/workflows/` - validate, release, deploy-docs, label-sync, update-unity-api, stale
1313
- `mkdocs.yml` - MkDocs Material documentation site configuration

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is a Cursor IDE plugin for Unity game development. It contains:
1313
- **`rules/`** - 8 .mdc rule files enforcing coding conventions
1414
- **`snippets/`** - 20 code snippet files (C#, shaders, visual scripting guide)
1515
- **`templates/`** - 5 starter project templates (2D platformer, 3D FPS, UI menu, SO architecture, editor tool)
16-
- **`mcp-server/`** - Python MCP server with 4 tools and JSON data files
16+
- **`mcp-server/`** - Python MCP server with 5 tools and JSON data files
1717
- **`docs/`** - ARCHITECTURE.md, ROADMAP.md, CONTRIBUTING.md, GETTING-STARTED.md
1818
- **`CHANGELOG.md`** - manually maintained release history
1919
- **`.github/workflows/`** - CI/CD automation
@@ -153,7 +153,7 @@ The MCP server is registered by the plugin in `mcp.json` (referenced from `.curs
153153
- ECS/DOTS is now a core engine package (Entities 1.4+), not experimental.
154154
- FindObjectOfType is deprecated; use FindFirstObjectByType.
155155
- CGPROGRAM is deprecated; use HLSLPROGRAM for URP/HDRP shaders.
156-
- The MCP server uses Python FastMCP with 4 tools and 5 JSON data files.
156+
- The MCP server uses Python FastMCP with 5 tools and 5 JSON data files.
157157

158158
## License
159159

‎CLAUDE.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Project documentation for Claude Code and AI assistants working on this reposito
66

77
## Project Overview
88

9-
Unity Developer Tools is a Cursor IDE plugin for Unity game development. It includes 18 skills, 8 rules, 20 code snippets across C# / HLSL / Visual Scripting, 5 starter templates, and a companion Python MCP server with 4 tools for script scaffolding, Unity API lookup, shader patterns, and platform information.
9+
Unity Developer Tools is a Cursor IDE plugin for Unity game development. It includes 18 skills, 8 rules, 20 code snippets across C# / HLSL / Visual Scripting, 5 starter templates, and a companion Python MCP server with 5 tools for script scaffolding, Unity API lookup, shader patterns, platform information, and project analysis.
1010

1111
**Works with:** Cursor (plugin), Claude Code (terminal and in-editor), and any MCP-compatible client.
1212

@@ -77,7 +77,7 @@ Unity-Developer-Tools/
7777
| `visual-scripting-conventions.mdc` | `**/*.asset` | Best practices for Unity Visual Scripting graphs |
7878
| `security-and-builds.mdc` | `**/*.cs`, `**/*.json`, `**/*.asset` | Security and build configuration rules (no hardcoded secrets, build target hygiene) |
7979

80-
## MCP Server (4 tools)
80+
## MCP Server (5 tools)
8181

8282
The companion MCP server is Python-based (FastMCP). It exposes Unity-aware tools that read from local data files (`mcp-server/data/`) and accept agent-supplied parameters.
8383

@@ -87,6 +87,7 @@ The companion MCP server is Python-based (FastMCP). It exposes Unity-aware tools
8787
| `lookup_api` | Search the Unity API reference (name, namespace, signature, examples) with optional category filter and deprecated-pattern warnings |
8888
| `shader_helper` | Fetch shader patterns and property setups for common effects (dissolve, outline, toon, water, hologram, fresnel) per render pipeline |
8989
| `platform_info` | Get platform-specific scripting defines, capabilities, limitations, and recommendations (Windows, macOS, Linux, Android, iOS, WebGL, PS5, Xbox, Switch) |
90+
| `analyze_project` | Read a Unity project from disk (editor version, render pipeline, packages, input handling, scripting backend, define symbols, asmdefs) so advice matches the actual project |
9091

9192
## Development Workflow
9293

‎README.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
---
3030

3131
<p align="center">
32-
18 skills &nbsp;&bull;&nbsp; 8 rules &nbsp;&bull;&nbsp; 4 MCP tools &nbsp;&bull;&nbsp; 20 snippets &nbsp;&bull;&nbsp; 5 templates
32+
18 skills &nbsp;&bull;&nbsp; 8 rules &nbsp;&bull;&nbsp; 5 MCP tools &nbsp;&bull;&nbsp; 20 snippets &nbsp;&bull;&nbsp; 5 templates
3333
</p>
3434

3535
Scaffold Unity scripts, look up APIs, generate shader patterns, detect render pipelines, and write optimized C# -- all from within Cursor's AI chat. Covers the full Unity development lifecycle from project setup to platform deployment.
@@ -46,7 +46,7 @@ Scaffold Unity scripts, look up APIs, generate shader patterns, detect render pi
4646
flowchart LR
4747
A["You ask Cursor\na Unity question"] --> B["Cursor loads\na Skill"]
4848
B --> C{"MCP server\navailable?"}
49-
C -- Yes --> D["Unity MCP Server\n(4 tools)"]
49+
C -- Yes --> D["Unity MCP Server\n(5 tools)"]
5050
C -- No --> E["Skill guidance\nonly"]
5151
D --> F["Scaffold, lookup,\nshader help,\nplatform info"]
5252
E --> G["AI-assisted answer\nin Cursor chat"]
@@ -235,7 +235,7 @@ python -m pip install -r ~/.cursor/plugins/local/unity-developer-tools/mcp-serve
235235
Cursor starts the server automatically. Other MCP clients can run `python <plugin folder>/mcp-server/server.py` over stdio.
236236

237237
<details>
238-
<summary><strong>Available Tools (4)</strong></summary>
238+
<summary><strong>Available Tools (5)</strong></summary>
239239

240240
&nbsp;
241241

@@ -245,6 +245,7 @@ Cursor starts the server automatically. Other MCP clients can run `python <plugi
245245
| `lookup_api` | Search the Unity API reference database by name, namespace, or category. Returns signatures, descriptions, and examples. |
246246
| `shader_helper` | Get shader code patterns for common effects (dissolve, outline, hologram, etc.) with HLSL and Shader Graph guidance. |
247247
| `platform_info` | Get platform-specific defines, capabilities, limitations, and build recommendations. |
248+
| `analyze_project` | Read a Unity project's editor version, render pipeline, packages, input handling, scripting backend, define symbols, and assembly definitions. Unity does not need to be running. |
248249

249250
</details>
250251

@@ -285,7 +286,7 @@ Unity-Developer-Tools/
285286
rules/ Coding convention rules (8 rules)
286287
snippets/ Code snippets -- C#, shaders (20 files)
287288
templates/ Starter project templates (5 sets)
288-
mcp-server/ Python MCP server (4 tools) and data files
289+
mcp-server/ Python MCP server (5 tools) and data files
289290
docs/ Architecture, roadmap, contributing guide
290291
assets/ Logo and images
291292
.github/ CI/CD workflows (5 workflows)

‎docs/ARCHITECTURE.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ Complete starter project scaffolds. Each template is a self-contained directory
4646

4747
### MCP Server (mcp-server/)
4848

49-
A Python FastAPI server implementing the Model Context Protocol. Provides 4 tools:
49+
A Python FastMCP server implementing the Model Context Protocol. Provides 5 tools:
5050
- `scaffold_script` - Generate scripts from templates
5151
- `lookup_api` - Search Unity API reference data
5252
- `shader_helper` - Get shader effect patterns
5353
- `platform_info` - Get platform-specific information
54+
- `analyze_project` - Read a Unity project's version, render pipeline, packages, and settings from disk
5455

5556
Data files in `mcp-server/data/` provide the reference databases:
5657
- `unity_api_common.json` - Common Unity API entries

‎docs/index.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**AI-powered development toolkit for Unity game development in Cursor IDE.**
44

5-
18 skills -- 8 rules -- 4 MCP tools -- 20 snippets -- 5 templates
5+
18 skills -- 8 rules -- 5 MCP tools -- 20 snippets -- 5 templates
66

77
---
88

@@ -62,7 +62,7 @@ For a detailed walkthrough, see the [Getting Started guide](GETTING-STARTED.md).
6262
flowchart LR
6363
A["You ask Cursor\na Unity question"] --> B["Cursor loads\na Skill"]
6464
B --> C{"MCP server\navailable?"}
65-
C -- Yes --> D["Unity MCP Server\n(4 tools)"]
65+
C -- Yes --> D["Unity MCP Server\n(5 tools)"]
6666
C -- No --> E["Skill guidance\nonly"]
6767
D --> F["Scaffold, lookup,\nshader help,\nplatform info"]
6868
E --> G["AI-assisted answer\nin Cursor chat"]

‎mcp-server/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ Get shader code patterns and property setups for common effects. Hand-written HL
2525
Get platform-specific scripting defines, capabilities, and build recommendations.
2626
- **platform**: Target platform (windows, macos, linux, android, ios, webgl, ps5, xbox, switch)
2727

28+
### analyze_project
29+
Summarize a Unity project from its files, without Unity running: editor version, render pipeline (resolved from the pipeline asset assigned in Graphics or Quality settings), notable packages, active input handling, scripting backend, API compatibility, scripting define symbols, and assembly definitions.
30+
- **project_path**: Path to the Unity project root (contains `Assets/`, `Packages/`, `ProjectSettings/`)
31+
32+
Settings must use text serialization (the Unity default, **Force Text**) for full detection.
33+
2834
## Running
2935

3036
The plugin registers the server in `mcp.json` at the plugin root, and Cursor starts it automatically once the plugin is installed.

0 commit comments

Comments
 (0)