Repository navigation
feat(mcp): merge_recipe merges a recipe into the served project (#1024) - #1027
Merged
Merged
Conversation
The authoring surface gains merge_recipe {name, dryRun?}, which runs the
same mergeRecipe as `urlcode recipes add NAME --project`: routes, includes,
files, extension configuration, fixtures, seed and the audit route count,
with the same all-or-nothing clash refusal. It takes no path: the target is
the operator-selected project root, and the write holds the authoring lock
create_route uses. A clash is an error tool result naming every clash. The
result is the CLI's JSON report with project "." and next naming the MCP
runners, plus the validation verdict.
A separate tool rather than an add_recipe target keeps add_recipe's required
destination and gives merge_recipe a schema with no path argument at all.
--allow-authoring now adds eight tools (TOOLING, AI-AUTHORING, RECIPES,
llms updated; agent-facts derives the count from the inventory).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1024
What
A new authoring tool,
merge_recipe {name, dryRun?}(offered only withurlcode mcp --allow-authoring), runs the samemergeRecipeasurlcode recipes add NAME --project:isError: true) whose text is the CLI'srecipe-clash/recipe-needs-extensionmessage, naming every clash.dryRunreports what would be added and written, and writes nothing.--jsonreport withproject: "."andnext: ["run_validate","run_test","run_audit"], because the MCP runners already carry the operator's flags. It also has the usualvalidationverdict.additionalProperties: falserefusesproject/destinationwith -32602. The target is the realpath'd operator-selected root. Non-dry runs hold the sameurlcode.yaml.lockascreate_route.Why a separate tool rather than an
add_recipetargetadd_reciperequiresdestination, a path argument checked byconfinedPath, and creates a new directory. Adding a target to it would mean either makingdestinationoptional with a mode switch, or adding a second path-like argument, and one schema would then describe two different operations. The existing authoring tools each do one operation with strict required arguments (create_route,scaffold_feature), so the merge fits better as its own tool. It also means no argument ofmerge_recipecan name a directory at all. Both tools keep the same annotations: project-confined write, not destructive, not open-world.Docs
docs/TOOLING.md(authoring mode): the tool is documented, and "adds seven tools" is now "adds eight tools".check-agent-factsderives the count frommcpToolInventory, and it passes withauthoring: 8.docs/AI-AUTHORING.md,docs/RECIPES.md(SDK and MCP) andllms.txtare updated.llms-full.txtis regenerated.Tests
test/mcp-authoring.test.ts:merge_recipe.json-endpointon a copy of the default starter writes nothing, and the report matches the CLI's. A real merge ofjson-endpointthenredirectmovesexpectRoutesto 4, andrun_validate,run_testandrun_auditexit 0. Re-merging is all unchanged and writes nothing. The lock is removed.contact-formoverstatic-pageclashes, in both the real run and the dry run, and the error names the route and the file clash.store-bookingis refused for its missing extensions. Aprojectordestinationargument is refused by the schema. An unknown recipe errors. The project is byte-identical afterwards.Evidence
npm run verify: green.npm run test:package: green (package audit within budget, packed smoke passed).CI passing is not an independent security review.
🤖 Generated with Claude Code