Repository navigation
Conversation
When a CKEditor field is explicitly requested via `fields`, MCP tools now
return its value as a list of chunks: {"type": "markup", "html": "…"} and
{"type": "entry", "entry": …}. Core expands the nested entries like Matrix
entries, applying permissions, the public scope, and dot paths.
The chunks come from FieldData::getChunks() on a copy of the value with
no field attached, so oEmbed content isn't fetched and the value's own
cached chunks are left untouched.
Requires the core MCP dot-path support.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
riasvdv
approved these changes
Nov 6, 2026
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.
Prerequisite
craftcms/cms#20415
Description
Builds on #644; this PR targets that branch, so the diff only shows the changes on top of it. It requires craftcms/cms#20415, which adds dot paths and resolves elements inside values returned by
getMcpValue().When a CKEditor field is explicitly requested via
fields(McpOutputContext::$requested), MCP tools now return its value as a list of chunks in document order, so nested entries behave like Matrix entries:[ {"type": "markup", "html": "<p>…</p>"}, {"type": "entry", "entry": { …expanded entry… }}, {"type": "markup", "html": "<p>…</p>"} ]fields: ["cke.innerBlocks"]also includes each nested entry'sinnerBlocks, as summaries.blocks.cke, its entries are summarized.fields: nullis unchanged: it still returns the annotated HTML from Add MCP output for nested entry tags #644.FieldData::getChunks(): the chunks come from a copy of the value with no field attached, so oEmbed content isn't fetched (no network calls, and<oembed>tags stay as stored). The value's own cached chunks are left untouched.Testing
Manual check with a fresh
mcp/serve, on an entry with four nested entries in its CKEditor field:fields: null: annotated HTML, unchanged.fields: ["cke"]: 7 chunks in document order, with each nested entry expanded including itsplainTextvalue.fields: ["cke.innerBlocks"]: the same, plusinnerBlockson each nested entry.🤖 Generated with Claude Code