Start managed MCP with the local Pascal editor - #612
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0b922af. Configure here.
| const exitCode = await new Promise<number>((resolve) => | ||
| result.child?.once('exit', (code, signal) => resolve(code ?? (signal ? 1 : 0))), | ||
| ) | ||
| await stopEditor(paths, { force: true }).catch(() => undefined) |
There was a problem hiding this comment.
Foreground cleanup kills replaced stack
High Severity
After a foreground editor child exits, the new unconditional stopEditor({ force: true }) tears down whichever stack is currently recorded in state. If another command already replaced that stack—pascal restart, pascal mcp connect auto-start, or recovery after MCP died—the replacement editor and MCP are force-stopped as soon as the old child exits.
Reviewed by Cursor Bugbot for commit 0b922af. Configure here.
| components: { | ||
| editor: { running: editorRunning, healthy: editorHealthy }, | ||
| mcp: { running: mcpRunning, healthy: mcpHealthy }, | ||
| }, |
There was a problem hiding this comment.
Start lock outlasts waiter timeout
Medium Severity
startEditor now holds the lifecycle lock across editor health (30s) and MCP health (10s), while waiters still give up after 10s. pascal mcp connect and project commands auto-call startEditor when unhealthy, so a second agent or CLI during an in-progress start fails with editor_locked instead of attaching once startup finishes.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0b922af. Configure here.


Summary
Developer impact
npx @pascal-app/cli editornow brings up the editor and MCP together. Codex and Claude can connect throughpascal mcp connectwithout storing the dynamic port or private token in client configuration.Validation
Note
Medium Risk
Touches local process lifecycle, auth tokens, and runtime activation/rollback paths; scope is large but loopback-only with identity checks on stop and expanded automated smoke coverage.
Overview
pascal editornow brings up the Next.js editor and a separate authenticated MCP HTTP server on auto-picked loopback ports, with a bearer token in~/.pascal/run/mcp-token(never in client config). Health, stop/restart,doctor, and runtime updates treat editor and MCP as paired components; legacy editor-only state is handled on upgrade.New agent and project UX:
pascal mcp connect(stdio bridge to the managed service),mcp status/config/setup codex|claude, plusprojects,resume, andopen [project]with ID/prefix/name resolution. Several commands auto-start the stack if it is stopped.Packaging: Runtime staging bundles
packages/mcpintoservices/pascal-mcp.mjs; smoke tests exercise MCPsave_sceneand CLI resume.@pascal-app/mcpgains per-session HTTP servers, authenticated/healthfor supervisors,PASCAL_EDITOR_ORIGINfor scene URLs, and docs steer local users to the CLI connector.Reviewed by Cursor Bugbot for commit 0b922af. Bugbot is set up for automated code reviews on this repo. Configure here.