Skip to content

Start managed MCP with the local Pascal editor - #612

Merged
Aymericr merged 1 commit into
mainfrom
feat/cli-managed-mcp
Aug 7, 2026
Merged

Start managed MCP with the local Pascal editor#612
Aymericr merged 1 commit into
mainfrom
feat/cli-managed-mcp

Conversation

@Aymericr

@Aymericr Aymericr commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • start an authenticated, dynamic-port MCP service automatically with the CLI-managed editor
  • add stable MCP client setup/connect commands and local project list/open/resume workflows
  • bundle MCP into the portable runtime and document the complete local agent experience

Developer impact

npx @pascal-app/cli editor now brings up the editor and MCP together. Codex and Claude can connect through pascal mcp connect without storing the dynamic port or private token in client configuration.

Validation

  • 2,957 repository tests passed; 1 skipped
  • all 335 MCP tests passed
  • monorepo typecheck passed
  • packed npm runtime smoke passed, including MCP save to CLI resume
  • Biome and diff checks passed

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 editor now 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, plus projects, resume, and open [project] with ID/prefix/name resolution. Several commands auto-start the stack if it is stopped.

Packaging: Runtime staging bundles packages/mcp into services/pascal-mcp.mjs; smoke tests exercise MCP save_scene and CLI resume. @pascal-app/mcp gains per-session HTTP servers, authenticated /health for supervisors, PASCAL_EDITOR_ORIGIN for 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.

@Aymericr
Aymericr merged commit befbecb into main Aug 7, 2026
4 checks passed
@Aymericr
Aymericr deleted the feat/cli-managed-mcp branch August 7, 2026 16:47

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0b922af. Configure here.

components: {
editor: { running: editorRunning, healthy: editorHealthy },
mcp: { running: mcpRunning, healthy: mcpHealthy },
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0b922af. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant