Skip to content

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

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

nicobytes wants to merge 3 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.

Two commits, so the upgrade can be reviewed on its own, plus a follow-up that fixes the strict typecheck gate:

  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

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

Vendored copy plus a drift check, not a build-time copy.

dotCMS/agent-toolkit is a separate repository. Copying it at build time would make every pnpm nx build mcp-server depend on GitHub for the bytes that ship, and those bytes would not be in the review diff. The files under core-web/apps/mcp-server/src/skills/dot-ui-vtl-migration/ are the copy (SKILL.md, reference/, scripts/vtl_migration.py only). scripts/skill-upstream.json pins dotCMS/agent-toolkit at 895ba10e8d639276099e674eb59d7a7f25b0c4d8 (main when this was taken, which contains merged PR dotCMS/agent-toolkit#1). scripts/check-skill-drift.mjs runs before xmcp build, downloads those four files, applies the allowed edits below, and fails if the served bytes differ.

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.

Allowed edits, each matched exactly once by the drift check:

  • Frontmatter name is dot-ui-vtl-migration, not upstream's dotcms-custom-field-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. Upstream's own directory is already dot-ui-vtl-migration; the frontmatter name does not match it, so an unmodified copy does not build.
  • The description is 1008 characters. Upstream's is 1476, and xmcp rejects a description over 1024. The served text keeps the opening sentences and a shorter form of the remaining triggers. The whole-instance procedure stays in the skill body.
  • reference/migration-guide.md no longer cites core-web/apps/dotcms-ui/src/daisyui-theme.css. It names the admin UI theme stylesheet instead.
  • A comment in scripts/vtl_migration.py no longer cites dotCMS/core's migrate_custom_fields.py. The logic is unchanged.

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, with the name caveat above. skills/list returns skill://dot-ui-vtl-migration/SKILL.md. The description matches the served SKILL.md (the shortened form of the agent-toolkit description). 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
  skill drift: 4 file(s) match dotCMS/agent-toolkit@895ba10e8d63
  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 (5 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

  • The drift check needs https://raw.githubusercontent.com on every build. A blocked network fails the build even when the vendored files are unchanged.
  • The served description is shorter than upstream (1008 vs 1476 characters) because xmcp enforces the Agent Skills 1024-character limit. The frontmatter name differs from upstream, as described above.
  • 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, skill manifest, digest/size, forbidden markers) and scripts/check-skill-drift.mjs on 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 43s —— View job


Claude Code Review

Reviewed the full diff (build config, drift/tools guard scripts, smoke test, and the vendored skill). This is a well-engineered spike: the smoke test boots the real bundle and verifies the seven tools, the skill manifest, per-file SHA-256/size, and forbidden markers; the drift check pins upstream and enforces the allowed-edit set exactly. I independently scanned the served skill files and confirmed no forbidden markers (uv, DOTCMS_TOKEN, BASE_URL, HTTPBasicAuth, core-local paths) are present.

No correctness, security, or convention bugs found. Two non-blocking design notes below, both tied to the build no longer being hermetic.

New Issues

  • 🟡 Medium: core-web/apps/mcp-server/project.json:20 — check-skill-drift.mjs runs as a build step and fetches four files from raw.githubusercontent.com on every (uncached) xmcp build. A blocked or offline network now fails the build even when the vendored files are unchanged. Acknowledged in the PR as a known limitation; raising only because it makes pnpm nx build mcp-server depend on GitHub availability — consider gating the network check behind a flag/env so a disconnected build can still succeed on the vendored bytes. Fix this →
  • 🟡 Medium: core-web/apps/mcp-server/project.json:10 — the drift check's purpose is to catch divergence between the committed copy and upstream, but it lives inside the Nx build target whose cache keys on file inputs, not network state. When the vendored files are unchanged the build is a cache hit and the drift script never runs, so upstream moving ahead of the pinned commit goes undetected until someone edits one of the skill files. If detecting upstream drift is a goal independent of local edits, it belongs in its own uncached target (or CI step) rather than piggybacking on build.

Everything else — the withAliases append (preserving zod/node:/.xmcp aliases), the single-BannerPlugin shebang+DOTENV_CONFIG_QUIET banner, the engines.node >=22.12.0 bump, the chokidar@4.0.3 trustPolicyExclude entry (justified with publish dates/provenance), and the applyReplacements literal-string match/replace (each edit asserted to match exactly once) — reads correctly.
· branch 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>

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

Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants