Skip to content

feat(mcp-server): serve dot-ui-vtl-migration skill via MCP Skills extension (spike) - #38771

Open
nicobytes wants to merge 9 commits into
mainfrom
cursor/38760-mcp-skills-spike-0a13
Open

nicobytes wants to merge 9 commits into
mainfrom
cursor/38760-mcp-skills-spike-0a13

Conversation

@nicobytes

@nicobytes nicobytes commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Proposed Changes

Serves the dot-ui-vtl-migration skill from @dotcms/mcp-server through the MCP Skills extension (io.modelcontextprotocol/skills), after upgrading xmcp from 0.6.4 to 1.13.0. The seven existing tools are unchanged. This is a draft spike for #38760. It is not published to npm, and vtl_migration.py is not ported to TypeScript.

Commits, so the upgrade can be reviewed on its own:

  1. chore(mcp-server): upgrade xmcp from 0.6.4 to 1.13.0
  2. feat(mcp-server): serve the dot-ui-vtl-migration skill
  3. fix(mcp-server): read initialize capabilities with bracket access (strict typecheck gate)
  4. refactor(mcp-server): ship the VTL skill without an upstream drift check
  5. docs(spec): add spec, plan and tasks for the MCP skills spike (specs/38760-mcp-serve-vtl-skill/)

xmcp breaking changes adapted

1.13.0 is the newest 1.x the workspace's seven-day maturity gate (minimumReleaseAge: 10080) will install. 1.13.4 (26 Nov 2026) is the registry latest and is still inside that window. 1.13.0 (20 Nov 2026) is the first release at or after 1.10.0 that clears it, and 1.10.0 is the first release that serves src/skills/.

Adapted from the xmcp upgrade notes and the 1.13.0 compiler:

  • @xmcp-dev/compiler@1.13.0 is a dev dependency. Since 0.8.0 the xmcp package is the runtime and the compiler is separate; xmcp build resolves it from the project.
  • engines.node on the published package is >=22.12.0. Rspack 2 (1.10.2) requires Node 22.12 to build. CI already uses core-web/.nvmrc (v22.22.3).
  • The bundler hook receives an Rspack 2 config whose resolve.alias already contains zod, node: builtins, and the .xmcp runtime shims. Replacing that map drops them. The hook now appends ours. zod is aliased to the workspace-root install, because pnpm does not create apps/mcp-server/node_modules/zod and xmcp only auto-aliases Zod when that path exists.
  • @dotcms/ai/* aliases stay. xmcp reads paths only from this app's tsconfig.json, which extends the base config and does not repeat them.
  • Tool discovery is still <toolsPath>/**/*.{ts,tsx} with no exclude (confirmed in the 1.13 compiler). A file with no default export is skipped only after the module is evaluated, so scripts/check-tools-dir.mjs still rejects a spec under src/tools/. The comment now says that.
  • The stdio entry is still stdio.js with a shebang, emitted to dist/apps/mcp-server/. xmcp 1.x also runs dotenv on startup and writes injected env (0) from .env to stderr even when the file is missing. That line is protocol noise on stdio. The shebang banner now sets DOTENV_CONFIG_QUIET=true when the caller has not set it, so the shipped server stays silent. A second BannerPlugin cannot be appended: rspack prepends it and the shebang leaves line 1.
  • ts-checker-rspack-plugin@1.8.0 (a compiler dependency) requires chokidar@^4.0.3. 4.0.3 (18 Dec 2024) is the only release in that range and has no npm provenance attestation, while 4.0.0, 4.0.1 and 5.0.0 do. It is listed in trustPolicyExclude with that reason. It is not a takeover.
  • paths.resources stays false (no resource modules). paths.skills is ./src/skills. The skills extension registers each file as a resource and declares the resources capability itself.

Source of truth

The copy inside the MCP server is the one that ships. It is not fetched from, or compared against, any other repository.

The files under core-web/apps/mcp-server/src/skills/dot-ui-vtl-migration/ (SKILL.md, reference/, scripts/vtl_migration.py) are committed here and reviewed like any other file. The point of the spike is that configuring the server is enough, so the server must not need another repository to know what its own skill contains. A change to the skill is an edit to those files.

An earlier revision of this PR pinned dotCMS/agent-toolkit and ran a drift check on every build. That was removed in 5cf513342f: it made an uncached build depend on raw.githubusercontent.com, and because it ran inside the cached build target it did not notice upstream moving ahead anyway. A smoke test now fails if a build step or build script reaches for agent-toolkit again. It is a tripwire on the build's command list and on scripts/, not proof of network isolation: the build still reads the dotCMS OpenAPI description through sdk-ai:generate-spec, which is unrelated to the skill.

The content was taken once from the MCP-driven version in dotCMS/agent-toolkit (merged PR dotCMS/agent-toolkit#1) and adapted to be served:

  • Frontmatter name is dot-ui-vtl-migration. xmcp and the Agent Skills spec require the name to equal the directory, and the issue requires the URI skill://dot-ui-vtl-migration/SKILL.md.
  • The description is 1008 characters. xmcp rejects one over 1024.
  • reference/migration-guide.md and a comment in scripts/vtl_migration.py no longer cite files in the dotCMS core checkout. The logic is unchanged.

The core checkout's .claude/skills/dot-ui-vtl-migration was not used. That copy shells out to uv and calls REST with DOTCMS_TOKEN / BASE_URL. The three copies (that folder, the agent-toolkit plugin, and this one) can now differ; aligning them is out of scope for the spike.

Acceptance criteria

  • Met, automated. xmcp is 1.13.0 (>= 1.10.0). pnpm nx build mcp-server, pnpm nx lint mcp-server and pnpm nx test mcp-server pass. See commands below.
  • Met, automated. src/smoke/server-boot.spec.ts still lists exactly the seven tools: download_assets, execute, page_create, page_place_content, page_verify, search, upload_assets. The build log reports Registered 7 tools, 1 skill.
  • Met, automated. The smoke test asserts capabilities.extensions["io.modelcontextprotocol/skills"] and capabilities.resources on initialize (protocol 2025-06-18).
  • Met, automated. skills/list returns exactly one skill, skill://dot-ui-vtl-migration/SKILL.md, and its description matches the served SKILL.md. The manifest includes scripts/vtl_migration.py and the two reference files, and nothing else. The smoke test asserts this.
  • Met, automated. resources/read on every manifest URI returns bytes whose SHA-256 and size match the manifest. The smoke test asserts this.
  • Met, automated. The same test rejects a served file that references uv (as a word), DOTCMS_TOKEN, BASE_URL, REST basic auth (Authorization: Basic / HTTPBasicAuth), or a core-local path (.claude/skills, core-web/, dotCMS/src, dotCMS/core, migrate_custom_fields, apps/mcp-server/).
  • Pending manual (Nicolas). Single field, Claude Code connected to the local build and a dotCMS instance. Steps below.
  • Pending manual (Nicolas). Whole instance, dry run, Claude Code. Steps below. Not run here. The agent-toolkit PR already recorded that the MCP half has not been run against a live instance.

Commands and results

From core-web, on this branch:

pnpm nx build mcp-server
  exit 0
  Built STDIO server
  Registered 7 tools, 1 skill

pnpm nx lint mcp-server --skip-nx-cache
  exit 0

pnpm nx test mcp-server --skip-nx-cache
  exit 0
  src/smoke/server-boot.spec.ts (6 tests) passed

node tools/scripts/strict-gate/run.mjs --base=origin/main --flags=strict --granularity=line --scope=core-web
  exit 0
  PASS — no new strict-mode violations in this diff

pnpm nx test mcp-server depends on build, and the smoke test boots dist/apps/mcp-server/stdio.js over stdio.

CI

On b1d0b5b1f5, run 46071778948 failed PR Test / Frontend Unit Tests in the strict typecheck gate (TS4111 on initialize.result.capabilities). Finalize / Final Status failed only because that job failed. Fixed in 26e6563852.

On 26e6563852, PR Test / Frontend Unit Tests and Finalize / Final Status succeed. Two Claude jobs fail before they review the diff, both with Workflow initiated by non-human actor: cursor (type: Bot). Add bot to allowed_bots list or use '*' to allow all bots. That is the action refusing a bot-opened PR, not a finding about this change.

Manual verification (for reviewer)

These two checks are for Nicolas, against a real dotCMS instance. Do not also install .claude/skills/dot-ui-vtl-migration or the agent-toolkit plugin in that Claude Code session, or the skill can come from disk instead of the server.

Build and point Claude Code at the local bundle:

cd core-web
pnpm nx build mcp-server
{
  "mcpServers": {
    "dotcms": {
      "command": "node",
      "args": ["<repo>/core-web/dist/apps/mcp-server/stdio.js"],
      "env": {
        "DOTCMS_URL": "http://localhost:8080",
        "AUTH_TOKEN": "<jwt from the instance>"
      }
    }
  }
}

Restart Claude Code so it reconnects. The skill should show up as coming from the dotcms MCP server, named dot-ui-vtl-migration.

Single field. Paste one legacy Dojo/Dijit custom-field template and ask for the migration. Expect one inline reply: migrated code inside #if( $structures.isNewEditModeEnabled() ), the original untouched inside #else. Expect no python3 and no vtl_migration.py.

Whole instance, dry run. Ask to dry-run a migration of every legacy custom field on the connected instance. Expect Claude Code to ask for approval before it runs python3 on scripts/vtl_migration.py (the script is python3 and the standard library only). Expect every instance read (contentTypes, field bodies, /dA/ files) to go through the MCP tools (execute, download_assets, and the others), not through REST, uv, DOTCMS_TOKEN, or BASE_URL. Nothing should be written to the instance: the skill's own step 6 is python3 scripts/vtl_migration.py check --dry-run. Please paste both transcripts on this PR and note which step failed, if any.

Known limitations

  • This is a third copy of the skill, and nothing keeps it aligned with the .claude/skills folder or the agent-toolkit plugin. That is deliberate for the spike.
  • Clients that cannot run code (Claude Desktop, ChatGPT) only get the single-field mode. The script runs on the client, and only after the user approves it.
  • The whole-instance flow has not been run against a live instance in this spike, and had not been run when agent-toolkit#1 merged. In particular: whether download_assets can fetch a /dA/ file by path, whether execute can publish multipart, and whether the preloaded contentTypes list is complete.
  • vtl_migration.py is still Python. Porting it to a server-side tool is a follow-up.
  • The package is not published to npm. paths.prompts stays off. Tasks, elicitation and file uploads are not in this change.
  • The compiler still prints the dotenv line while it is building. The shipped stdio.js does not.

Checklist

  • Tests — src/smoke/server-boot.spec.ts (stdio boot, seven tools, exactly one skill and its manifest, digest/size, forbidden markers, no upstream fetch in the build)
  • Translations — not applicable
  • Security Implications Contemplated — the server only distributes the skill files. The script runs on the client after explicit approval, has no network and no token, and the served files are checked for uv, DOTCMS_TOKEN, BASE_URL, REST basic auth and core-local paths. No secrets are added.

Additional Info

Refs #38760

Related: #38007, #36078, #37699, #37768, dotCMS/agent-toolkit#1.

Open in Web Open in Cursor 

1.13.0 is the newest 1.x release the workspace's seven-day maturity gate
will install, and the first line that serves src/skills. The build now
depends on the matching @xmcp-dev/compiler. The bundler hook merges xmcp's
rspack 2 aliases instead of replacing them, points Zod at the hoisted
workspace copy, and keeps the stdio entry silent on stderr.
Vendors the MCP-driven skill from dotCMS/agent-toolkit and publishes it
through the MCP Skills extension. A drift check pins that commit. The
smoke test checks the skills capability, the manifest, and that every
resources/read matches the published SHA-256 and size.
@claude

claude Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @nicobytes's task in 1m 30s —— View job


Review

Reviewed the diff against origin/main: the xmcp 1.13.0 upgrade (xmcp.config.ts, package.json, pnpm-workspace.yaml), the smoke test, check-tools-dir.mjs, and the served skill files.

New Issues

No new issues found.

Resolved

  • ✅ src/skills/dot-ui-vtl-migration/reference/instance-migration.md:67-91 — The discovery snippet no longer slices the preloaded 200-type contentTypes global; it pages /api/v1/contenttype directly with page/per_page/orderby and stops on a short page. I confirmed these params are real: ContentTypeResource.java:1744-1750 binds page, per_page, orderby, and the Javadoc example at line 1654 uses page=3&per_page=10, so an instance with >200 types is now scanned in full. The off-by-one (a full last page costs one extra empty call) is handled and commented.
  • ✅ src/smoke/server-boot.spec.ts:383-397 — The "does not fetch or compare against another repository" test no longer pins the exact build-command array; it now asserts no build command and no scripts/ file matches /agent-toolkit|raw\.githubusercontent\.com/, the same tripwire pattern on both. Unrelated build changes (another cp, a new check) no longer fail it.

Notes (non-blocking)

  • xmcp.config.ts:63-65 — filtering plugins by plugin?.constructor?.name !== 'BannerPlugin' relies on the runtime class name of rspack's own BannerPlugin. That's stable for a directly-imported class, but it will silently stop matching if a future rspack renames or wraps it, dropping the shebang/quiet banner. Acceptable for a spike; worth a note if this outlives the spike.
  • pnpm-workspace.yaml:90 — chokidar@4.0.3 added to trustPolicyExclude with date/provenance reasoning per the core-web/CLAUDE.md rule (4.0.0/4.0.1/5.0.0 attested, 4.0.3 the only release satisfying ts-checker-rspack-plugin's ^4.0.3). Consistent with the existing entries.

This is a draft spike; the two manual acceptance criteria (single-field and whole-instance dry run against a live instance) are still open and are the real risk surface — the smoke test covers the served bytes and protocol shape, not agent behavior, as Kevin noted. The code in the diff is clean.
• cursor/38760-mcp-skills-spike-0a13

The diff-scoped strict gate rejects capabilities as a dotted property
because the JSON-RPC result type carries an index signature.

Co-authored-by: Nicolas Molina Monroy <hi@nicobytes.com>
@nicobytes
nicobytes marked this pull request as ready for review December 1, 2026 14:16
nicobytes and others added 3 commits December 1, 2026 11:56
The copy of dot-ui-vtl-migration under src/skills/ is the one that ships.
The build no longer downloads the four files from dotCMS/agent-toolkit to
compare them, so it does not depend on GitHub for the skill and an
unchanged skill can no longer fail a build.

- Remove scripts/check-skill-drift.mjs, scripts/skill-upstream.json and
  the build step that ran them.
- Add a smoke test that fails if the build gains a step beyond the tools
  guard, xmcp build and the two copies, or if a build script names
  agent-toolkit or raw.githubusercontent.com.
- Assert that skills/list returns exactly one skill.
- Update CLAUDE.md and README.md, which described a vendored copy.

Refs #38760

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Spec-Kit artifacts for serving the dot-ui-vtl-migration skill from the
dotCMS MCP server: the spec, the plan with its research, data model,
contract and quickstart, and the task list with the gate record of the
approvals and mutation checks run so far. The two manual checks in
Claude Code are still open in tasks.md.

Refs #38760

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>

@KevinDavilaDotCMS KevinDavilaDotCMS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Draft status and manual checks. #38760 asks to keep this as a draft, and the two manual acceptance criteria (single field, whole-instance dry run in Claude Code) are still open. Those are the real risk surface here, since the smoke test covers the served bytes, not agent behavior. Could this go back to draft until both transcripts are attached?

🤖 Claude (Claude Code)


Evals. The skill files are model-facing behavior, and there's no eval task for them in apps/ai-evals/tasks/. The harness today can't run one as-is: apps/ai-evals/src/tools.ts defines its own search/execute tools through the AI SDK and never connects to the MCP server, so it cannot load MCP-served skills or read skill:// resources. Suggest a follow-up that (a) lets the harness load a skill (from the built server, or by injecting SKILL.md + references) and (b) adds a single-field task: paste a legacy Dojo field, assert the reply has the #if( $structures.isNewEditModeEnabled() ) / #else structure with the original untouched, and that no script ran. Please link that follow-up here.

🤖 Claude (Claude Code)

@nicobytes

Copy link
Copy Markdown
Member Author

Follow-up for the evals: #38829. It covers letting the harness load a skill and a single-field task for dot-ui-vtl-migration.

nicobytes and others added 2 commits December 1, 2026 14:50
…step

The snippet sliced the preloaded contentTypes global, which holds only the
first 200 types, so on a larger instance the custom fields of the rest never
reached the scan. It now pages /api/v1/contenttype itself and stops on a
short page.

Refs: #38760

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
…ild commands

The guard compared the build command list against four exact commands, so
any unrelated build change failed a test about fetching the skill. It now
checks that no command names agent-toolkit or raw.githubusercontent.com,
the same match already applied to scripts/.

Refs: #38760

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
@nicobytes

Copy link
Copy Markdown
Member Author

@KevinDavilaDotCMS thanks for the review. Summary of where each point stands:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants