CoplayDev/unity-mcp · error · FileNotFoundError
Manifest template not found: {MANIFEST_TEMPLATE}
Error message
Manifest template not found: {MANIFEST_TEMPLATE} What it means
Raised by create_manifest in tools/generate_mcpb.py when the repo's manifest.json template (REPO_ROOT/manifest.json) does not exist. The MCPB bundle is assembled from this template plus a version and icon, so a missing template aborts generation early.
Source
Thrown at tools/generate_mcpb.py:33
from __future__ import annotations
import argparse
import json
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
DEFAULT_ICON = REPO_ROOT / "docs" / "images" / "coplay-logo.png"
MANIFEST_TEMPLATE = REPO_ROOT / "manifest.json"
def create_manifest(version: str, icon_filename: str) -> dict:
"""Create manifest.json content with the specified version."""
if not MANIFEST_TEMPLATE.exists():
raise FileNotFoundError(f"Manifest template not found: {MANIFEST_TEMPLATE}")
manifest = json.loads(MANIFEST_TEMPLATE.read_text(encoding="utf-8"))
manifest["version"] = version
manifest["icon"] = icon_filename
return manifest
def generate_mcpb(
version: str,
output_path: Path,
icon_path: Path,
) -> Path:
"""Generate MCPB bundle file.
Args:
version: Semantic version string (e.g., "9.0.8")
output_path: Output path for the .mcpb file
icon_path: Path to the icon fileView on GitHub (pinned to c21bf496bc)
Solutions
- Run generate_mcpb.py from within the repository so REPO_ROOT/manifest.json resolves.
- Restore manifest.json from git (git checkout HEAD -- manifest.json) if it was removed.
- If releasing from a trimmed export, ensure manifest.json is included in the export.
Example fix
# before python /tmp/exported/generate_mcpb.py 9.0.8 # no manifest.json present # after python tools/generate_mcpb.py 9.0.8 # run in repo root where manifest.json exists
Defensive patterns
Strategy: validation
Validate before calling
if not MANIFEST_TEMPLATE.exists():
raise SystemExit(f'missing template {MANIFEST_TEMPLATE}; run from the repo root') Type guard
def template_present(p: pathlib.Path) -> bool:
return p.exists() Try / catch
try:
create_manifest(version, icon_filename)
except FileNotFoundError as e:
print(e); sys.exit(1) Prevention
- Run release tooling from the repo root
- Keep manifest.json tracked in the repo
- Verify REPO_ROOT resolution when relocating the script
When it happens
Trigger: tools/generate_mcpb.py is run, MANIFEST_TEMPLATE.exists() is false. Happens when the script is run outside a full checkout, the template was deleted/renamed, or REPO_ROOT resolves wrongly (script moved out of tools/).
Common situations: Partial/shallow clone missing manifest.json; running a copied generate_mcpb.py from outside the repo; manifest.json was gitignored or removed in a release prep branch.
Related errors
- Icon not found: {icon_path}
- MCPB file was not created: {output_path}
- Could not find Packages/manifest.json from current directory
- No Unity editor binary found. Searched:\n {searched}
- {path}: expected 1 replacement for pattern, got {n}
AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13).
Data as JSON: /api/errors/a9e9acdb2d9c41f5.
Report an issue: GitHub.