Skip to content

feat(rolldown): mcp#455

Draft
webfansplz wants to merge 3 commits into
mainfrom
feat/mcp
Draft

feat(rolldown): mcp#455
webfansplz wants to merge 3 commits into
mainfrom
feat/mcp

Conversation

@webfansplz

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 22, 2026 07:07
@webfansplz
webfansplz marked this pull request as draft July 22, 2026 07:07

Copilot AI 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.

Pull request overview

Adds MCP (Model Context Protocol) support to Vite DevTools by introducing a headless Rolldown “agent” plugin that registers analysis tools, and a new vite-devtools mcp CLI command that exposes those tools over stdio via the devframe MCP adapter.

Changes:

  • Add @vitejs/devtools-rolldown/node/agent entrypoint that registers Rolldown build analysis / tracing / comparison tools on ctx.agent.
  • Add core-side MCP server (packages/core/src/node/mcp.ts) plus a new vite-devtools mcp CLI command wired through cli.ts and cli-commands.ts.
  • Update workspace deps/lockfile and API snapshots to include the new MCP surface and new exported entrypoints.

Reviewed changes

Copilot reviewed 30 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.base.json Adds TS path alias for @vitejs/devtools-rolldown/node/agent.
alias.ts Adds repo alias for @vitejs/devtools-rolldown/node/agent.
pnpm-workspace.yaml Adds @modelcontextprotocol/sdk to the shared catalog.
pnpm-lock.yaml Locks @modelcontextprotocol/sdk@1.29.0 and transitive additions.
packages/rolldown/tsdown.config.ts Builds a new node/agent entrypoint.
packages/rolldown/package.json Exposes ./node/agent subpath export.
packages/rolldown/src/node/rpc/utils.ts Adjusts logs directory resolution logic for RolldownLogsManager.
packages/rolldown/src/node/rpc/tests/utils.test.ts Tests updated log directory selection behavior (no process.cwd() fallback).
packages/rolldown/src/node/rpc/functions/rolldown-get-session-compare-details.ts Factors out createSessionCompareDetails() for reuse.
packages/rolldown/src/node/agent/index.ts Adds DevToolsRolldownAgent() plugin entrypoint.
packages/rolldown/src/node/agent/tools.ts Registers Rolldown agent tools on ctx.agent.
packages/rolldown/src/node/agent/types.ts Defines the agent report/insight schema types.
packages/rolldown/src/node/agent/utils.ts Shared helpers for agent analysis (clamping, stats, sizing).
packages/rolldown/src/node/agent/context.ts Creates an analysis context over Rolldown sessions/logs.
packages/rolldown/src/node/agent/analysis.ts Composes the analysis modules into createRolldownAnalysis().
packages/rolldown/src/node/agent/modules/build-analysis.ts Implements first-pass heuristic build analysis.
packages/rolldown/src/node/agent/modules/build-time-analysis.ts Implements build-time breakdown analysis.
packages/rolldown/src/node/agent/modules/bundle-size-analysis.ts Implements bundle-size contributor analysis.
packages/rolldown/src/node/agent/modules/dependency-trace.ts Implements module/package/asset inclusion tracing.
packages/rolldown/src/node/agent/modules/build-comparison.ts Implements session-to-session comparison using shared compare logic.
packages/rolldown/src/node/agent/tests/plugin.test.ts Tests that the agent plugin registers the expected tools.
packages/core/package.json Adds @modelcontextprotocol/sdk dependency (via catalog).
packages/core/tsconfig.json Disables composite for core package TS config.
packages/core/src/node/standalone.ts Allows injecting additional headless plugins + toggling builtin devtools.
packages/core/src/node/mcp.ts Implements MCP server that mirrors the DevTools agent surface over stdio.
packages/core/src/node/cli.ts Adds mcp CLI command.
packages/core/src/node/cli-commands.ts Adds mcp() command implementation.
packages/core/src/node/tests/standalone.test.ts Tests that injected plugins’ devtools.setup hooks run in standalone mode.
packages/core/src/node/tests/context-capabilities.test.ts Tests that plugin-contributed agent tools are registered.
test/snapshots/tsnapi/@vitejs/devtools/cli-commands.snapshot.js Updates public API snapshot for new mcp CLI command.
test/snapshots/tsnapi/@vitejs/devtools/cli-commands.snapshot.d.ts Updates public API snapshot types for mcp options/function.
test/snapshots/tsnapi/@vitejs/devtools-rolldown/node/agent.snapshot.js Adds new public API snapshot for rolldown agent entrypoint.
test/snapshots/tsnapi/@vitejs/devtools-rolldown/node/agent.snapshot.d.ts Adds new public API snapshot types for rolldown agent entrypoint.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

diagnostics.RDDT0001()
}
manager = new RolldownLogsManager(dir ?? dirs[0]!)
manager = new RolldownLogsManager(dir)
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