{"record":{"id":"2cbc8c56ea887db4","repo":"CoplayDev/unity-mcp","slug":"mcpb-file-was-not-created-output-path","errorCode":null,"errorMessage":"MCPB file was not created: {output_path}","messagePattern":"MCPB file was not created: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/generate_mcpb.py","lineNumber":103,"sourceCode":"                [\"npx\", \"@anthropic-ai/mcpb\", \"pack\", \".\", str(output_path.absolute())],\n                cwd=build_dir,\n                capture_output=True,\n                text=True,\n                check=True,\n            )\n            print(result.stdout)\n        except subprocess.CalledProcessError as e:\n            print(f\"MCPB pack failed:\\n{e.stderr}\", file=sys.stderr)\n            raise\n        except FileNotFoundError:\n            print(\n                \"Error: npx not found. Please install Node.js and npm.\",\n                file=sys.stderr,\n            )\n            raise\n\n    if not output_path.exists():\n        raise RuntimeError(f\"MCPB file was not created: {output_path}\")\n\n    print(f\"Generated: {output_path} ({output_path.stat().st_size:,} bytes)\")\n    return output_path\n\n\ndef main() -> int:\n    parser = argparse.ArgumentParser(\n        description=\"Generate MCPB bundle for Unity MCP\",\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n        epilog=__doc__,\n    )\n    parser.add_argument(\n        \"version\",\n        help=\"Version string for the bundle (e.g., 9.0.8)\",\n    )\n    parser.add_argument(\n        \"--output\",\n        \"-o\",","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/tools/generate_mcpb.py#L85-L121","documentation":"Raised by generate_mcpb after the @modelcontextprotocol/create-server pack step completes but the expected output_path file is not present. It means the npx pack invocation did not fail outright yet produced no bundle (or wrote it elsewhere).","triggerScenarios":"The subprocess.run of npx @modelcontextprotocol/create-server ... returns, but output_path.exists() is false at generate_mcpb.py:101-102. Pack wrote to a different filename, the temp build dir was empty, or output_path was redirected.","commonSituations":"npx version mismatch changed the output location; the build_dir lacked manifest.json/handlers so pack silently produced nothing; disk full or permissions stripped the file; wrong output_path passed.","solutions":["Inspect the pack stdout/stderr printed just before the raise for the real output location.","Ensure manifest.json and the handler files are present in the temp build dir before pack runs.","Update or pin the @modelcontextprotocol/create-server version and retry; verify npx/node are installed."],"exampleFix":"# before\npython tools/generate_mcpb.py 9.0.8  # pack produces nothing at expected path\n# after (diagnose then pin tool version)\nnpx @modelcontextprotocol/create-server@latest --help\npython tools/generate_mcpb.py 9.0.8 --output dist/unity-mcp-9.0.8.mcpb","handlingStrategy":"try-catch","validationCode":"if not output_path.exists():\n    raise SystemExit(f'pack produced no output at {output_path}; check build_dir contents')","typeGuard":"def bundle_produced(p: pathlib.Path) -> bool:\n    return p.exists()","tryCatchPattern":"try:\n    generate_mcpb(version, output_path, icon_path)\nexcept RuntimeError as e:\n    print(f'MCPB not created: {e}'); sys.exit(1)","preventionTips":["Inspect the build_dir before the pack step","Pin the @modelcontextprotocol/create-server version","Ensure manifest.json and handlers are present"],"tags":["tooling","release","mcpb","subprocess"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}