Skip to content

Commit ffcb7d0

Browse files
TMHSDigitalclaude
andcommitted
fix: install the plugin into Cursor's local plugins folder and register the MCP server
The docs told users to open this repository as their Cursor workspace, so rules and the MCP server never reached their Unity project, and the symlink instructions pointed at a folder Cursor does not load. - Register the MCP server through mcp.json at the plugin root using ${CURSOR_PLUGIN_ROOT}, referenced from plugin.json, and drop the workspace-relative .cursor/mcp.json - Getting Started and README: clone into ~/.cursor/plugins/local/ unity-developer-tools, then open your Unity project; add Verify, Updating, and Troubleshooting sections - Release notes and CLAUDE.md use the same local plugins path - CI checks that the registered server path exists in the repo Fixes #23 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MpEiWjv38TrdFcgqU8ER5L
1 parent 2700761 commit ffcb7d0

10 files changed

Lines changed: 91 additions & 29 deletions

File tree

‎.cursor-plugin/plugin.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@
4949
"rules/shader-conventions.mdc",
5050
"rules/visual-scripting-conventions.mdc",
5151
"rules/security-and-builds.mdc"
52-
]
52+
],
53+
"mcpServers": "mcp.json"
5354
}

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
169169
echo "---"
170170
echo ""
171-
echo "**Install:** Extract \`unity-developer-tools-v${{ steps.new.outputs.version }}.zip\` into \`~/.cursor/plugins/unity-developer-tools\` (Windows: \`%USERPROFILE%\.cursor\plugins\unity-developer-tools\`), restart Cursor, then open your Unity project. Do not extract it into a Unity project: the snippets and templates are references, and Unity would compile them. See [Getting Started](https://github.com/${{ github.repository }}/blob/main/docs/GETTING-STARTED.md)."
171+
echo "**Install:** Extract \`unity-developer-tools-v${{ steps.new.outputs.version }}.zip\` into \`~/.cursor/plugins/local/unity-developer-tools\` (Windows: \`%USERPROFILE%\.cursor\plugins\local\unity-developer-tools\`), restart Cursor, then open your Unity project. Do not extract it into a Unity project: the snippets and templates are references, and Unity would compile them. See [Getting Started](https://github.com/${{ github.repository }}/blob/main/docs/GETTING-STARTED.md)."
172172
echo ""
173173
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${last_tag:-initial}...v${{ steps.new.outputs.version }}"
174174
echo "RELEASE_EOF"
@@ -179,8 +179,8 @@ jobs:
179179
run: |
180180
zip -r "unity-developer-tools-v${{ steps.new.outputs.version }}.zip" \
181181
.cursor-plugin/ \
182-
.cursor/ \
183182
.cursorrules \
183+
mcp.json \
184184
AGENTS.md \
185185
skills/ \
186186
rules/ \

‎.github/workflows/validate.yml‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
run: python3 -c "import json; json.load(open('.cursor-plugin/plugin.json'))"
2121

2222
- name: Validate mcp.json
23-
run: python3 -c "import json; json.load(open('.cursor/mcp.json'))"
23+
run: python3 -c "import json; json.load(open('mcp.json'))"
2424

2525
- name: Validate MCP data file schemas
2626
run: |
@@ -133,6 +133,24 @@ jobs:
133133
print(f'All {len(m["rules"])} rule files exist')
134134
PYEOF
135135
136+
- name: Check MCP server registration
137+
run: |
138+
python3 << 'PYEOF'
139+
import json, os
140+
m = json.load(open('.cursor-plugin/plugin.json'))
141+
config = m.get('mcpServers')
142+
assert isinstance(config, str) and os.path.exists(config), f'mcpServers must point to an existing file, got {config!r}'
143+
servers = json.load(open(config))['mcpServers']
144+
assert servers, 'No MCP servers registered'
145+
for name, server in servers.items():
146+
for arg in server.get('args', []):
147+
if arg.startswith('${CURSOR_PLUGIN_ROOT}/'):
148+
path = arg[len('${CURSOR_PLUGIN_ROOT}/'):]
149+
assert os.path.exists(path), f'{name}: {path} not found'
150+
assert not os.path.isabs(arg), f'{name}: absolute path {arg} breaks other installs'
151+
print(f'MCP servers registered: {", ".join(servers)}')
152+
PYEOF
153+
136154
validate-skills:
137155
name: Validate skill files
138156
runs-on: ubuntu-latest

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Marks issues/PRs as stale after inactivity and closes them after further inactiv
143143
- Data: `mcp-server/data/` (JSON reference databases)
144144
- Dependencies: `mcp-server/requirements.txt`
145145

146-
The MCP server is configured in `.cursor/mcp.json` and starts automatically when Cursor invokes a tool.
146+
The MCP server is registered by the plugin in `mcp.json` (referenced from `.cursor-plugin/plugin.json`) and starts automatically when Cursor invokes a tool.
147147

148148
## Key technical facts
149149

‎CLAUDE.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,22 @@ The companion MCP server is Python-based (FastMCP). It exposes Unity-aware tools
9090

9191
## Development Workflow
9292

93-
### Plugin development (symlink)
93+
### Plugin development (local plugin folder)
94+
95+
Cursor loads local plugins from `~/.cursor/plugins/local/<name>` and skips symlinks that point outside that folder, so clone the repo there and work in that clone:
9496

9597
**macOS / Linux:**
9698
```bash
97-
ln -s "$(pwd)" ~/.cursor/plugins/unity-developer-tools
99+
git clone https://github.com/TMHSDigital/Unity-Developer-Tools.git ~/.cursor/plugins/local/unity-developer-tools
98100
```
99101

100-
**Windows (PowerShell as Admin):**
102+
**Windows (PowerShell):**
101103
```powershell
102-
New-Item -ItemType SymbolicLink -Path "$env:USERPROFILE\.cursor\plugins\unity-developer-tools" -Target (Get-Location)
104+
git clone https://github.com/TMHSDigital/Unity-Developer-Tools.git "$env:USERPROFILE\.cursor\plugins\local\unity-developer-tools"
103105
```
104106

107+
Run **Developer: Reload Window** after changing the manifest, rules, skills, or `mcp.json`.
108+
105109
### MCP server development
106110

107111
```bash

‎README.md‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,14 @@ flowchart LR
5757

5858
## Quick Start
5959

60-
Already have Git, Python 3.10+, and Cursor installed? Here's the short version:
60+
Already have Git, Python 3.10+, and Cursor installed? Here's the short version (macOS / Linux; see the guide for Windows):
6161

6262
```bash
63-
git clone https://github.com/TMHSDigital/Unity-Developer-Tools.git
64-
# Open Unity-Developer-Tools folder in Cursor (File > Open Folder)
65-
cd mcp-server && pip install -r requirements.txt
63+
git clone https://github.com/TMHSDigital/Unity-Developer-Tools.git ~/.cursor/plugins/local/unity-developer-tools
64+
python -m pip install -r ~/.cursor/plugins/local/unity-developer-tools/mcp-server/requirements.txt
6665
```
6766

68-
Then ask the AI agent to scaffold a MonoBehaviour, look up an API, or generate a shader effect.
67+
Restart Cursor, then open **your Unity project** (not this repository) and ask the agent to scaffold a MonoBehaviour, look up an API, or generate a shader effect.
6968

7069
> **Need more detail?** The **[Getting Started guide](docs/GETTING-STARTED.md)** covers installing prerequisites, troubleshooting, and building your first project step by step.
7170
@@ -225,16 +224,15 @@ Then ask the AI agent to scaffold a MonoBehaviour, look up an API, or generate a
225224

226225
## MCP Server
227226

228-
The companion MCP server provides programmatic tools that Cursor's AI agent can call directly. Configuration lives in `.cursor/mcp.json`.
227+
The companion MCP server provides programmatic tools that Cursor's AI agent can call directly. The plugin registers it through `mcp.json` at the plugin root, so it is available in any workspace once the plugin is installed.
229228

230-
**Prerequisites:** Python 3.10+
229+
**Prerequisites:** Python 3.10+ available as `python`
231230

232231
```bash
233-
cd mcp-server
234-
pip install -r requirements.txt
232+
python -m pip install -r ~/.cursor/plugins/local/unity-developer-tools/mcp-server/requirements.txt
235233
```
236234

237-
The server starts automatically when Cursor invokes an MCP tool.
235+
Cursor starts the server automatically. Other MCP clients can run `python <plugin folder>/mcp-server/server.py` over stdio.
238236

239237
<details>
240238
<summary><strong>Available Tools (4)</strong></summary>
@@ -282,7 +280,7 @@ What are the WebGL limitations and recommended settings?
282280
```
283281
Unity-Developer-Tools/
284282
.cursor-plugin/ Plugin manifest
285-
.cursor/ MCP server configuration
283+
mcp.json MCP server registration for the plugin
286284
skills/ AI skill files (18 skills)
287285
rules/ Coding convention rules (8 rules)
288286
snippets/ Code snippets -- C#, shaders (20 files)

‎docs/ARCHITECTURE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is a single Cursor IDE plugin following the standard plugin specification.
66

77
```
88
.cursor-plugin/plugin.json <- Plugin manifest (name, version, skills, rules)
9-
.cursor/mcp.json <- MCP server configuration
9+
mcp.json <- MCP server registration (uses ${CURSOR_PLUGIN_ROOT})
1010
skills/ <- AI context files (SKILL.md with YAML frontmatter)
1111
rules/ <- Convention enforcement (.mdc with frontmatter)
1212
snippets/ <- Production-ready code patterns

‎docs/GETTING-STARTED.md‎

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,41 @@
88

99
## Installation
1010

11-
1. Clone this repository:
11+
The plugin is installed once into Cursor's local plugins folder. You then open **your own Unity project** in Cursor, not this repository.
12+
13+
1. Clone the plugin into Cursor's local plugins folder:
14+
15+
**macOS / Linux:**
1216
```bash
13-
git clone https://github.com/TMHSDigital/Unity-Developer-Tools.git
17+
git clone https://github.com/TMHSDigital/Unity-Developer-Tools.git ~/.cursor/plugins/local/unity-developer-tools
1418
```
1519

16-
2. Open the cloned folder in Cursor IDE
20+
**Windows (PowerShell):**
21+
```powershell
22+
git clone https://github.com/TMHSDigital/Unity-Developer-Tools.git "$env:USERPROFILE\.cursor\plugins\local\unity-developer-tools"
23+
```
1724

18-
3. The plugin loads automatically. You should see skills and rules activate when editing C# or shader files.
25+
Or download the zip from the [latest release](https://github.com/TMHSDigital/Unity-Developer-Tools/releases/latest) and extract it into that same folder, so that `.cursor-plugin/plugin.json` sits directly inside `unity-developer-tools/`. Do not extract it into a Unity project.
1926

20-
4. (Optional) Install MCP server dependencies for tool access:
27+
2. Install the MCP server dependencies with the same Python that `python` runs:
2128
```bash
22-
pip install -r mcp-server/requirements.txt
29+
python -m pip install -r ~/.cursor/plugins/local/unity-developer-tools/mcp-server/requirements.txt
2330
```
31+
On Windows, use `"$env:USERPROFILE\.cursor\plugins\local\unity-developer-tools\mcp-server\requirements.txt"`.
32+
33+
3. Restart Cursor, or run **Developer: Reload Window** from the command palette.
34+
35+
4. Open your Unity project folder (the one containing `Assets/` and `ProjectSettings/`) with **File > Open Folder**.
36+
37+
### Verify it works
38+
39+
1. Open **Customize** in the Cursor sidebar. Unity Developer Tools should be listed with its skills, rules, and the `unity-dev-tools` MCP server.
40+
2. Open any `.cs` file in your project. The C# rules apply to it automatically.
41+
3. Ask the agent: *"What are the scripting defines for WebGL?"* It should call the `platform_info` tool and answer with `UNITY_WEBGL`.
42+
43+
### Updating
44+
45+
Run `git pull` inside `~/.cursor/plugins/local/unity-developer-tools`, then reload Cursor. If you installed from a zip, replace the folder with the new release.
2446

2547
## Using Skills
2648

@@ -62,6 +84,25 @@ Ask the AI to use MCP tools naturally:
6284
- "Show me shader properties for a dissolve effect"
6385
- "What are the platform limitations for WebGL?"
6486

87+
## Troubleshooting
88+
89+
**The plugin does not appear in Customize**
90+
- Check the path: `.cursor-plugin/plugin.json` must be at `~/.cursor/plugins/local/unity-developer-tools/.cursor-plugin/plugin.json`. A zip extracted into an extra nested folder will not load.
91+
- Symlinks are skipped when they point to a folder outside `~/.cursor/plugins/local`. Clone or copy the plugin into that folder instead.
92+
- On Cursor Teams or Enterprise, an admin must enable **Allow Local Plugin Imports** (Dashboard > Settings > Security & Identity > Marketplace and Plugins).
93+
- Reload the window after installing.
94+
95+
**The `unity-dev-tools` MCP server shows an error or no tools**
96+
- `python` must be on your PATH. Run `python --version`; it must report 3.10 or newer. On macOS, if only `python3` exists, install Python from python.org or a package manager that provides `python`.
97+
- `ModuleNotFoundError: No module named 'mcp'`: install the requirements with the same interpreter, using `python -m pip install -r .../mcp-server/requirements.txt`.
98+
- `Missing data file`: the plugin folder is incomplete. Re-clone it or extract the release zip again.
99+
100+
**Rules do not apply to my scripts**
101+
- Make sure the Cursor workspace is your Unity project, not the plugin repository. Rules are matched against files in the open workspace (for example, `**/*.cs`).
102+
103+
**Unity reports compile errors after copying files**
104+
- Copy individual snippets or a single template folder into `Assets/`, never the whole plugin. Each template README lists the packages it needs, such as the Input System.
105+
65106
## Next Steps
66107

67108
- Explore the [Architecture](ARCHITECTURE.md) to understand plugin structure

‎mcp-server/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Get platform-specific scripting defines, capabilities, and build recommendations
2727

2828
## Running
2929

30-
The server is started automatically by Cursor via the configuration in `.cursor/mcp.json`.
30+
The plugin registers the server in `mcp.json` at the plugin root, and Cursor starts it automatically once the plugin is installed.
3131

3232
Manual start:
3333
```bash

.cursor/mcp.json renamed to mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"mcpServers": {
33
"unity-dev-tools": {
44
"command": "python",
5-
"args": ["mcp-server/server.py"]
5+
"args": ["${CURSOR_PLUGIN_ROOT}/mcp-server/server.py"]
66
}
77
}
88
}

0 commit comments

Comments
 (0)