mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6648] [MERGED] feat(tools): optional Dev MCP for inspecting and safely restarting a local engine #7271
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7271
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6648
Author: @SirAdoni
Created: 9/25/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @SpicyMarinara
Base:
staging← Head:contrib/dev-mcp📝 Commits (10+)
6ea18c1feat(tools): add a Dev MCP for inspecting a local Marinara engine17fcb17fix(tools): let the Dev MCP stand alone on staging and harden its inputsf024b72docs: point contributors to the Dev MCP902c13bfix(tools): hold the Dev MCP engine lock atomically and for whole buildsdcf60a9fix(tools): stop only the consecutive engine processes above the listener9442789fix(tools): refuse unsafe Dev MCP sandbox setups and failed sandbox starts106644afix(tools): stop a Dev MCP engine start that never answers, close log handlesc650905fix(tools): read the env file the engine reads (MARINARA_ENV_FILE)2553499fix(tools): do not mark run_regressions as read-only12c5251test(tools): close the Dev MCP smoke client on failure, check the write guard exactly📊 Changes
19 files changed (+4417 additions, -0 deletions)
View changed files
📝
.dockerignore(+3 -0)📝
.gitignore(+2 -0)📝
CHANGELOG.md(+1 -0)📝
CONTRIBUTING.md(+1 -0)➕
tools/dev-mcp/.gitignore(+1 -0)➕
tools/dev-mcp/README.md(+189 -0)➕
tools/dev-mcp/lib/api.mjs(+121 -0)➕
tools/dev-mcp/lib/config.mjs(+101 -0)➕
tools/dev-mcp/lib/engine.mjs(+518 -0)➕
tools/dev-mcp/lib/logs.mjs(+192 -0)➕
tools/dev-mcp/lib/proc.mjs(+314 -0)➕
tools/dev-mcp/lib/prompts.mjs(+114 -0)➕
tools/dev-mcp/lib/sandbox.mjs(+310 -0)➕
tools/dev-mcp/lib/util.mjs(+88 -0)➕
tools/dev-mcp/package-lock.json(+1210 -0)➕
tools/dev-mcp/package.json(+24 -0)➕
tools/dev-mcp/server.mjs(+700 -0)➕
tools/dev-mcp/test/isolation.mjs(+409 -0)➕
tools/dev-mcp/test/smoke.mjs(+119 -0)📄 Description
Base:
staging(e15c9e558) · Head:contrib/dev-mcp(11669c447)Linked issue
Closes #6624
Part 2 of the engine foundations series, see #6624.
This PR is independent of the other parts. It targets
stagingdirectly and can be merged, reviewed or declined on its own. Part 1 (foundations) is not required; a few outputs are richer with it, as noted below.Why this change
tools/dev-mcpis a small, optional MCP server that answers those questions for any MCP client (Claude Code, Codex and others), and restarts the engine without the launchers'git cleanstep.What changed
20 commits on
staginge15c9e558, oldest first, 18 files, all additions:6ea18c1fcfeat(tools): add a Dev MCP for inspecting a local Marinara engine.17fcb17e5fix(tools): let the Dev MCP stand alone on staging and harden its inputs.f024b7248docs: point contributors to the Dev MCP.902c13b67fix(tools): hold the Dev MCP engine lock atomically and for whole builds.dcf60a9e3fix(tools): stop only the consecutive engine processes above the listener.94427897efix(tools): refuse unsafe Dev MCP sandbox setups and failed sandbox starts.106644accfix(tools): stop a Dev MCP engine start that never answers, close log handles.c650905f6fix(tools): read the env file the engine reads (MARINARA_ENV_FILE).255349955fix(tools): do not mark run_regressions as read-only.12c5251e9test(tools): close the Dev MCP smoke client on failure, check the write guard exactly.13a51e4e2fix(tools): parse inline comments in the engine env file like dotenv.772c56e44fix(tools): follow exact id matches first in lookup_error.00e405c6ffix(tools): take the engine lock for typecheck's shared rebuild.dd4a8df80fix(tools): restart the sandbox on the build folder it last ran.209997e19fix(tools): do not stop a port listener the Dev MCP cannot identify.2554f3a0dfix(tools): judge an unreadable Dev MCP lock file by its age.f9e7163fbfix(tools): let sandbox_refresh keep the sandbox's recorded build folder.a8858b583fix(tools): refuse a second locked operation in the same Dev MCP session.995c5aa9afix(tools): require the port listener itself to look like the engine.11669c447fix(tools): report whether run_regressions finished, not just its failures.The tool (
tools/dev-mcp/, with its ownpackage.jsonand lockfile)dryRunoption: character edits and chat metadata.confirmand a reason).tools/dev-mcp/test/smoke.mjs) and a README covering setup, settings, safety and platform support.Standalone on staging (
17fcb17e5)stagingwrites no log files, so the log tools fall back to the engine output the tool saves when it starts the engine.LOG_LEVELofwarn, the restart quiet wait sees no generation activity in the logs, so it does not wait. The README says so, and asks you to check that nobody is mid-reply before a restart, or to run withLOG_LEVEL=info.continuity_statustool was removed.errorIdlookup and the startup summary are optional. They work best with part 1, which adds request ids and a startup summary, and degrade cleanly without it.Input hardening (from a hand security review,
17fcb17e5)diff_promptsreads only from inside the state folder: paths are resolved and checked with astartsWithguard.corepack.jsdirectly without a shell. A customMARINARA_DEV_PNPMcontaining shell characters is refused..envreader uses plain string parsing instead of a regex.Review fixes (local CodeRabbit round 1,
902c13b67anddcf60a9e3)buildnow holds the engine lock for the whole build.Review fixes (CodeRabbit rerun, pass 1: 9 found, 9 fixed,
94427897eto12c5251e9)sandbox_refreshstops after a failed stop instead of carrying on.MARINARA_ENV_FILEis honoured, so the tool reads the env file the engine reads.run_regressionsis marked as a write tool, not read-only./healthto reach it.Review fixes (CodeRabbit rerun, pass 2: 4 found, 4 fixed,
13a51e4e2todd4a8df80).envfile are parsed like dotenv.lookup_errorprefers exact request id matches.typechecktakes the engine lock for its shared rebuild. (ItsholdsLock()shortcut was removed again in pass 4.)Review fixes (CodeRabbit rerun, pass 3: 3 found, 3 fixed,
209997e19tof9e7163fb)sandbox_refreshreuses its last build folder, thenMARINARA_DEV_SANDBOX_DIST, thendist.Review fixes (CodeRabbit rerun, pass 4: 3 found, 3 fixed,
a8858b583to11669c447)holdsLock()shortcut was removed.run_regressionsreturnsokplusrunError, so a timeout or a failed start is no longer reported as a pass.Findings per pass went 9, 4, 3, 3, all fixed. The pass 4 fixes have not been re-reviewed locally; CodeRabbit will review them on this PR.
Repository files
.dockerignore:tools/and.dev-mcpare not part of the image..gitignore:.dev-mcp/local state (journal, logs, lock).CHANGELOG.md: one entry under[Unreleased].CONTRIBUTING.md: one line pointing totools/dev-mcp/README.md.Validation
pnpm checkpasses locallyCONTRIBUTING.mdThe boxes are left unticked for a human, per
AGENTS.md. The repository checks in the first rows ran ondcf60a9e3. They were not rerun on11669c447, because the fifteen commits since touch onlytools/dev-mcp, which the build and the regressions don't load. The Dev MCP's own checks (last three rows) ran again on11669c447.tsc --noEmit, Windows 11decision-sidecar-runtime,gallery-previews,request-timeouts,server-signal-shutdown,storage-writer-lock), plus load timeouts that passed when run individuallycomplete-node-regressions370 / 371. The one failure,server-signal-shutdown, timed out, and it also times out on plainstagingin the same WSL setup. Thepnpm-validatesteps all exit 0.11669c447stagingbuild on a spare port11669c447node --checkon every changed file, on11669c447Manual verification notes
stagingbuild started on a spare port (online).Human to tick
Based on the evidence above:
pnpm checkpasses locally: supported. Its steps (tsc, lint, Prettier, locales, builds, regressions) all passed on Windows, apart from the 5 known Windows-only failures, and the CI-equivalentpnpm-validatesteps all exit 0 on Linux. If you want the literal command, runpnpm checkonce before ticking.CHANGELOG.md,CONTRIBUTING.mdandtools/dev-mcp/README.md).Not supported by the evidence, leave unticked unless done by hand:
CONTRIBUTING.md: only a human can confirm these.Needs manual verification
.dockerignorechange leaves the image unchanged apart from excludingtools/.CONTRIBUTING.mdline needs a[docs-i18n]follow-up issue for the translated guides.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)The PR adds a CHANGELOG entry under
[Unreleased], one line inCONTRIBUTING.md, andtools/dev-mcp/README.md. No version bump.UI evidence (if applicable)
Not applicable. This PR has no UI.
Remaining steps
🤖 Generated with Claude Code
Summary by CodeRabbit
Summary
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.