Skip to content

AI-driven import: let AI sessions run Create from Source (endpoint / UpDoc MCP server) #106

Description

@deanleigh

Future work / nice to have. No build committed yet. This issue captures the design so it is not lost.

Full design record: planning/AI_DRIVEN_IMPORT_ROUTES.md (30 July 2026).

The problem

Importing a tour is the only step an AI session cannot do.

Everything after import already runs over the Umbraco MCP server: content fixes, publish, all of it. Everything before it is a human driving the Create from Source dialog. The Tailored Travel migration has ~135 tours left, each starting with the same manual sequence.

Goal: "make TTM5175" becomes a single instruction to an AI session. One page at a time, human review between each. Batch imports are explicitly not wanted.

The key architectural fact

The workflow is a recipe, not a machine. The engine that executes it is split:

There is no server-side "run the workflow" command. Any automation route must either drive the browser or relocate the page-filling half.

Routes considered

Route What Effort Notes
0 Playwright "keep the document" variant of smoke-test-pdf.spec.ts ~1 day Interim migration aid. No regrets. Works now.
A C# import endpoint (POST /updoc/.../import) + thin MCP tool ~1 month Port TS apply logic to C#. Proper long-term home. Plain HTTP API for any consumer.
B UpDoc MCP server orchestrates via existing APIs, reusing apply logic extracted into a shared TS module ~1-2 weeks Same pattern as the Umbraco MCP server. Fixes #41 as a side effect. No plain API.
C Session-only skill making the same HTTP calls days Private stepping stone, not a product.
D Mapping endpoint + generic Umbraco MCP writes ruled out No blueprint scaffold over MCP; block-grid writes via generic tools are unsafe.

Routes are compatible: B first, A later if demand for a plain API appears. The MCP tool would swap its internals for one endpoint call, invisibly.

Decisions made

  1. Umbraco-only, forever. No multi-CMS ambitions.
  2. Mirror the Umbraco MCP server's conventions exactly: TypeScript, npm/npx distribution, API user client credentials in env vars. First implementation step is reading its source.
  3. Same repo, own folder for the MCP server (e.g. src/UpDoc.Mcp/), versioned with the endpoint contract.
  4. Save, not publish. Import returns the document key; publish stays with the session flow and human review.
  5. No blueprintId parameter: a workflow folder already belongs to exactly one blueprint.
  6. Dialog switchover to any new endpoint is out of scope for a first build (that is the eventual endgame of Route A only).
  7. Client-facing use (Claude Desktop + Umbraco MCP + UpDoc MCP against the live site) is real but "later, deliberately": needs packaged guardrails, a tightly scoped API user, and a human eye in the loop.

Current recommendation

  • Now: nothing built. The planning doc is the deliverable.
  • When migration pressure bites: Route 0.
  • When ready to invest: Route B.
  • Route A: only if demand for a plain HTTP API materialises.

The playing field is moving (Umbraco now has editor and developer MCP servers). The core idea is durable because no one else's MCP server will ever run UpDoc workflows; only packaging conventions might need to follow the ecosystem. Re-check the ecosystem state before building.

Open questions

  • What should import return beyond the document key (warnings, unmapped fields, unmatched sections)?
  • Partial-failure behaviour: delete the half-made document or leave it flagged?
  • Does the shared apply module (Extract duplicated apply logic from the two bridge files #41 extraction) run cleanly in Node, or do browser-only dependencies run deeper than the initial scan suggested?
  • Confirm the client-credentials API user flow against UpDoc's backoffice-secured controller routes.

Related: #41 (duplicated apply logic), #42 / #43 (TypeScript markdown converter bugs, relevant to Route A's Markdig divergence).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions