Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: migrate from pnpm to npm for package management
- Remove pnpm-specific files (pnpm-lock.yaml, pnpm-workspace.yaml, .npmrc)
- Remove packageManager field from root package.json
- Remove pnpm-specific configuration from package.json files
- Update prepublishOnly script to use npm instead of pnpm
- Update README.md to replace pnpm commands with npm equivalents
- Generate package-lock.json and install dependencies with npm
- Verify MCP server starts successfully (107 handlers registered)

Reason: Simplify package management by using npm only, which is
standard for MCP server distribution and avoids confusion between
development (pnpm) and production (npm/npx) environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
  • Loading branch information
akiojin and claude committed Nov 18, 2025
commit b06ce70271d77a5e4abd5b9d6a369843bac325a2
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ sequenceDiagram
## Setup

- Unity 2020.3 LTS or newer
- Node.js 18.x / 20.x / 22.x LTS (the server refuses to start on newer majors) and pnpm (via Corepack)
- Node.js 18.x / 20.x / 22.x LTS (the server refuses to start on newer majors)
- Prefer Node.js 20.x or 22.x for the best compatibility (prebuilt `better-sqlite3` binaries are available); Node.js 18.x works, but anything ≥23 is rejected at launch.
- Claude Desktop or another MCP-compatible client

Expand All @@ -207,35 +207,34 @@ Installation

### MCP Server Environment Setup

You must install the MCP server's pnpm-managed dependencies **on the same OS where the server runs** so that native modules such as `better-sqlite3` are built for the correct platform.
You must install the MCP server's dependencies **on the same OS where the server runs** so that native modules such as `better-sqlite3` are built for the correct platform.

- **General rule**: if your `.mcp.json` uses `"command": "node"` (e.g. `node bin/unity-mcp-server serve`), run `pnpm install` (or `pnpm install --frozen-lockfile`) inside the directory where the package lives _on that machine/container_ before launching the MCP client.
- **pnpm build approval**: pnpm v10+ blocks native build scripts until you approve them. Run `pnpm approve-builds better-sqlite3` once (select the package and confirm) so the SQLite binding can compile successfully.citeturn1view0
- **General rule**: if your `.mcp.json` uses `"command": "node"` (e.g. `node bin/unity-mcp-server serve`), run `npm install` (or `npm ci`) inside the directory where the package lives _on that machine/container_ before launching the MCP client.
- **`npx` launch**: the README example above (`npx @akiojin/unity-mcp-server@latest`) downloads dependencies at runtime and works on the supported Node.js versions (18.x / 20.x / 22.x). Node.js 23+ is not supported; the server exits early with a version error.
- **Avoid sharing `node_modules` across operating systems** (Windows ↔ Linux/macOS). Native binaries compiled for one platform cannot be reused on another.

Environment-specific notes:

- **Windows (PowerShell / Command Prompt)**
- Install Node.js 20.x or 22.x LTS (18.x also works if you prefer). Newer major versions (23+) are unsupported.
- In your workspace: change into the installed package directory (for repo clones: `cd C:\path\to\unity-mcp-server\mcp-server`) then run `pnpm install --frozen-lockfile`.
- In your workspace: change into the installed package directory (for repo clones: `cd C:\path\to\unity-mcp-server\mcp-server`) then run `npm ci`.
- Point `.mcp.json` to `node` or keep using `npx` once dependencies exist.

- **Windows Subsystem for Linux (WSL)**
- Keep the repository on the Linux filesystem (e.g. `/home/<user>/unity-mcp-server`).
- Use Node.js 20.x or 22.x inside WSL (18.x also works).
- Run `pnpm install --frozen-lockfile` inside the installed package directory (for repo clones: `/home/<user>/unity-mcp-server/mcp-server`).
- Run `npm ci` inside the installed package directory (for repo clones: `/home/<user>/unity-mcp-server/mcp-server`).

- **Docker / Linux containers**
- Base your image on Node.js 20.x or 22.x (18.x also works). Images with newer Node versions (23+) are unsupported and will fail fast.
- During the image build run `pnpm install --filter mcp-server --frozen-lockfile` (or `pnpm install --frozen-lockfile` inside the package directory) so the container has platform-matched dependencies.
- During the image build run `npm ci --workspace=mcp-server` (or `npm ci` inside the package directory) so the container has platform-matched dependencies.
- Do not bind-mount a host `node_modules` directory into the container.

- **macOS**
- Install Node.js 20.x or 22.x (e.g. `brew install node@22` / `node@20` and add it to `PATH`). Node 18.x also works; newer majors (23+) are unsupported.
- Run `pnpm install --frozen-lockfile` wherever the package is installed (for repo clones: `cd ~/unity-mcp-server/mcp-server && pnpm install --frozen-lockfile`).
- Run `npm ci` wherever the package is installed (for repo clones: `cd ~/unity-mcp-server/mcp-server && npm ci`).

After installation you can verify the server with `node mcp-server/bin/unity-mcp-server --version`. If `better-sqlite3` fails to load, reinstall the dependencies _inside the target environment_ or rebuild with `pnpm rebuild better-sqlite3 --filter mcp-server --build-from-source` once the toolchain is present.
After installation you can verify the server with `node mcp-server/bin/unity-mcp-server --version`. If `better-sqlite3` fails to load, reinstall the dependencies _inside the target environment_ or rebuild with `npm rebuild better-sqlite3` once the toolchain is present.

## Usage Workflow

Expand Down
9 changes: 2 additions & 7 deletions mcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"simulate:code-index": "node scripts/simulate-code-index-status.mjs",
"test:verbose": "VERBOSE_TEST=true node --test tests/**/*.test.js",
"prepare": "cd .. && husky || true",
"prepublishOnly": "pnpm run test:ci",
"prepublishOnly": "npm run test:ci",
"postinstall": "chmod +x bin/unity-mcp-server || true",
"test:ci:unity": "timeout 60 node --test tests/unit/core/codeIndex.test.js tests/unit/core/codeIndexDb.test.js tests/unit/core/config.test.js tests/unit/core/indexWatcher.test.js tests/unit/core/projectInfo.test.js tests/unit/core/server.test.js || exit 0",
"test:unity": "node tests/run-unity-integration.mjs",
"test:nounity": "pnpm run test:integration",
"test:nounity": "npm run test:integration",
"test:ci:integration": "CI=true NODE_ENV=test node --test tests/integration/code-index-background.test.js"
},
"keywords": [
Expand Down Expand Up @@ -60,11 +60,6 @@
"url": "https://github.com/akiojin/unity-mcp-server.git",
"directory": "mcp-server"
},
"pnpm": {
"onlyBuiltDependencies": [
"better-sqlite3"
]
},
"homepage": "https://github.com/akiojin/unity-mcp-server#readme",
"bugs": {
"url": "https://github.com/akiojin/unity-mcp-server/issues"
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.0.0",
"private": true,
"description": "Workspace root for unity-mcp-server monorepo",
"packageManager": "[email protected]",
"scripts": {
"release": "semantic-release"
},
Expand All @@ -22,8 +21,5 @@
},
"workspaces": [
"mcp-server"
],
"pnpm": {
"onlyBuiltDependencies": ["better-sqlite3"]
}
]
}
Loading
Loading