Skip to content

refactor(devframe): move cli.mcp to createCac options - #337

Merged
antfu merged 1 commit into
mainfrom
refactor/cli-mcp-to-createcac
Sep 3, 2026
Merged

refactor(devframe): move cli.mcp to createCac options#337
antfu merged 1 commit into
mainfrom
refactor/cli-mcp-to-createcac

Conversation

@antfubot

@antfubot antfubot commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Whether to expose an MCP route is a hosting decision made at the CLI assembly stage, not a capability of the tool itself. This moves the MCP toggle to where hosting decisions belong.

What changed

  • Add mcp?: boolean | McpRouteOptions to CreateCacOptions; createCac reads it as the default for the --mcp flag, with precedence --mcp/--no-mcp > createCac({ mcp }) > deprecated def.cli?.mcp.
  • Deprecate DevframeCliOptions.mcp on the definition. It is still honored as a fallback for now and will be removed in a future release.
  • Point the MCP adapter docs at the new createCac({ mcp }) pattern.
  • Move the files-inspector example's mcp: true from its definition to its createCac call so the reference example models the current pattern.

The programmatic-host fallbacks (initDevframe / initHub / createDevServer reading def.cli?.mcp) and the hub's DF8005 warning stay in place for the deprecation window and will be dropped once the field is removed.

This PR was created with the help of an agent.

Whether to expose an MCP route is a hosting decision made at the CLI
assembly stage, not a capability of the tool. Add `mcp` to
CreateCacOptions and read it as the flag default; deprecate the
definition's `cli.mcp` (still honored as a fallback for now).
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 3, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +0 new · 🟠 ~2 changed · 🔴 -0 removed · 1 flow · 7 files · commit 410b5c0


Architecture

Architecture diagram for devframes/devframe at 410b5c0

2 components touched across 2 lanes.

Open full size


Data flow

Data flow diagram for devframes/devframe at 410b5c0

Configuring and mounting MCP HTTP route via CLI adapter

Open full size


Drill down
Devframe Core Engine — 2 components
🟡 CHANGED Host & Build Adapters

Provides CLI and build adapters; `createCac` now accepts `mcp` in `CreateCacOptions` and forwards it to `createDevServer`.

🟡 CHANGED MCP HTTP Route Handler

Mounts and handles Streamable-HTTP MCP endpoints; deprecates `cli.mcp` on `DevframeCliOptions` in favor of adapter-level configuration.


View

  • Architecture lens
  • Data flow lens
  • Expand every detail
  • Show unchanged neighbours

Tip

The diagrams follow your GitHub theme, so dark mode gets the dark render and light mode the light one, and the moving dots show this pull request's data in motion.

🪧 More tips
  • Run PR Lens on your own machine: npx skills add coldteadotai/pr-lens installs the agent skill. Then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Draw a diff before it is even a pull request: npx @coldtea/pr-lens-cli analyze --base origin/main reads the diff with your own model key, and npx @coldtea/pr-lens-cli render .pr-lens/graph.json draws the same lenses on your machine.
  • The boxes under View are live. Tick Architecture lens or Data flow lens to choose which diagrams appear, or Expand every detail to open every drill-down at once. The comment redraws in place a few seconds later.
  • Show unchanged neighbours lists the components this change did not touch alongside the ones it did, so the drill-down shows what the changed code sits next to.
  • GitHub will not let you zoom an image in a comment. The link under each diagram opens it full size on a page of its own, where you can.
  • The CLI's render picks up .github/pr-lens.yml automatically and applies your corrections (renames, exclusions, lane pins) at draw time.
  • Would you rather run it from CI on a key of your own? Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and a model key in your repository secrets, say GEMINI_API_KEY. The Action asks Gemini by default, or OpenAI and any endpoint speaking /chat/completions through its provider input.
  • PR Lens is free for open source. A star on the repository is what keeps it going.
  • Push a new commit and the whole comment re-renders for the new head. An older run never overwrites a newer one, so a slow render cannot put a stale diagram back.

◈ Rendered by PR Lens · crafted with ❤️ by the Coldtea team · Something drawn wrong?

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
devframe Ready Ready Preview Sep 3, 2026 3:14am UTC

@antfu
antfu merged commit fecbf1f into main Sep 3, 2026
14 checks passed
@antfu
antfu deleted the refactor/cli-mcp-to-createcac branch September 3, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants