MCP concurrent mutations can corrupt generated project artifacts #41
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/emc#41
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?
While converting Eddy's existing event model to EMC via the EMC MCP server, I hit a project-artifact corruption case when multiple mutating MCP tools were called concurrently.
Context
Consuming repo:
/home/jwilger/projects/eddyEMC repo:
https://git.johnwilger.com/slipstream/emcEMC was installed from the remote flake and exposed to Codex as an MCP server.
The Eddy import initially did this in one parallel batch through MCP:
init_project(name = "Eddy")add_workflow(slug = "organization-access", ...)add_slice(...)calls for the workflow's slicesconnect_workflow(...)callsObserved behavior
After the parallel
add_slicecalls, EMC reported success for several individual tool calls, but the generated workflow/index state was corrupted.emc list slicesreturned only a partial/corrupt set like:emc show workflow organization-accessshowed the workflow digest and generated Lean/Quint containing duplicated/collapsedtranslationslugs and shifted fields, for example:Subsequent transition calls failed with errors like:
emc checkthen failed with artifact drift, e.g.:I had to delete the generated EMC project artifacts (
emc.toml,model/,reviews/) and reinitialize. Sequential MCP mutations did not exhibit the same corruption before the session was interrupted.Expected behavior
Concurrent MCP mutation requests should not corrupt the EMC project.
Acceptable fixes could be any of:
The important invariant is that successful mutating tool responses must leave the Lean/Quint artifacts and workflow/slice indexes synchronized and semantically intact.
Suggested regression coverage
Add MCP tests that issue concurrent mutating requests against the same project root, such as multiple
add_slicecalls for the same workflow, and assert that one of the following holds:emc checkpasses; orAlso consider a test that runs
add_sliceandconnect_workflowunder concurrent client requests to ensure workflow transitions cannot observe a partially regenerated slice index.Why this matters
Codex and other MCP clients can issue independent tool calls in parallel. EMC currently exposes mutating tools as normal MCP tools, so consuming projects can accidentally corrupt their authoritative Lean/Quint event model during imports or agent-driven authoring unless EMC enforces mutation serialization/atomicity itself.