Studio MCP: serve Studio's instructions and skills to external agents on demand - #5007
Merged
youknowriad merged 2 commits intoOct 6, 2026
Conversation
Base automatically changed from
stu-2508-generate-the-tool-list-for-live-wordpresscom-site-sessions
to
trunk
October 6, 2026 04:54
…nd the Skill tool Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
youknowriad
force-pushed
the
stu-2499-describe-the-agent-host-to-the-shared-studio-tools
branch
from
October 6, 2026 04:55
b99b750 to
c2a535b
Compare
Collaborator
📊 Performance Test ResultsComparing e577921 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
…hrough studio_instructions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
youknowriad
deleted the
stu-2499-describe-the-agent-host-to-the-shared-studio-tools
branch
October 6, 2026 06:21
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.
Related issues
How AI was used in this PR
Written with Claude Code, extracted from the proof of concept in #4993 and cut down to what's used today. I reviewed the diff; Claude ran lint, typecheck and the CLI AI tests, compared Studio Code's prompts and tool lists before and after the change, checked
studio mcpover stdio with an MCP client, and ran a full Codex build against it (codex exec, with the plugin's routing skill): Codex calledstudio_instructionsfirst, loaded the site-spec, visual-design, imagery, block-content and visual-polish runbooks through it, and built and polished the site with no tool errors. Codex doesn't show MCP server instructions to the model, so in Codex the route tostudio_instructionscomes from the plugin's skill (STU-2506).Proposed Changes
studio mcplets other agents (Codex, Claude Code, …) use Studio's tools, but it gives them none of the instructions Studio Code works from: which skill to load when, how to validate blocks, how to polish the result. Those agents improvise the site workflow.studio_instructionstool returns Studio's instructions, in a version written for an agent that brings its own file tools and conversation: no Studio Code identity, and none of the Studio Code CLI's one-file-per-turn cadence. Withskill, it returns that skill's runbook, rendered the same way Studio Code'sSkilltool renders it.Skilltool, so nothing clashes with a host's ownSkilltool.Skilltool returns the same runbooks. The evals run Studio Code's terminal prompt, which didn't change, so they weren't re-run.Smaller than the issue's original plan: the tool registry already takes a description of the host (
CreateStudioToolsOptions), so this PR doesn't rename it or add fields nothing reads yet. Design previews, host image tools and the preview reload add theirs with their own issues (STU-2500, STU-2501, STU-2503). The proposed lint rule keeping the tools free of pi imports is dropped too.Testing Instructions
npm test -- apps/cli/ai/tests/system-prompt.test.tsnpm run cli:build, then connect any MCP client tonode apps/cli/dist/cli/main.mjs mcp(e.g.npx @modelcontextprotocol/inspector node apps/cli/dist/cli/main.mjs mcp):studio_instructionsfirst.studio_instructionswith no arguments returns the full instructions, starting with "These are the instructions for building and managing local WordPress sites with the WordPress Studio tools."{ "skill": "visual-design" }it returns that runbook, with its catalog of directions and layouts filled in; an unknown skill is an error.Pre-merge Checklist
🤖 Generated with Claude Code