Skip to content

Bug: MCP auto-mount has no opt-out for Vite-plugin consumers #557

Description

@dvcolomban

Describe the bug

@devframes/hub@0.9.9 changed the aggregate MCP route's default from off to 'auto', mounting a Streamable-HTTP endpoint at <base>__mcp as soon as any agent-flagged action exists.

@vitejs/devtools's Vite plugin builds its initHub({...}) call from a fixed list of fields (base, context, ui, renderers, clientModuleResolution, auth, allowedOrigins, server/ws, host), unchanged from 0.6.1 through 0.7.1:

// dist/server-*.js
const hub = initHub({
  base: DEVTOOLS_MOUNT_PATH,
  context,
  ui: createViteDevToolsUi(options.ui),
  renderers: resolveDockRendererRegistrations(options.renderers),
  ...context.viteServer ? { clientModuleResolution: "/@id/{specifier}" } : {},
  auth: authDisabled ? false : getAuthHandler(context),
  ...allowedOrigins ? { allowedOrigins } : {},
  ...options.server ? { server: options.server } : { ws: ... },
  ...options.host ? { host: options.host } : {}
});

mcp never appears there, and none of DevToolsConfig, DevToolsPluginOptions, or DevToolsOptions/CreateDevToolsHubOptions expose a field for it. So a Vite-plugin consumer inherits the new auto-mount with no supported way to turn it off, even if they bridge MCP through something else already.

Maybe we should add mcp?: McpSetting to DevToolsOptions/DevToolsPluginOptions and forward it into initHub({...}) ?

Reproduction

No hosted repro, since this only shows up once a devframe-based Vite plugin is wired up with agent-flagged actions and something is watching /__devtools/__mcp. Steps:

  1. pnpm add @vitejs/devtools@0.6.1 @devframes/hub@0.9.10 (or any hub >=0.9.9) in a project using the Vite plugin.
  2. Register at least one action with agent: {...} metadata (any devframe capability that ships one works).
  3. Run vite dev and request <devtools-base>__mcp.
  4. It answers, and there's no option anywhere in the plugin's config to make it not.

System Info

System:
  OS: macOS 26.5.1
  CPU: (11) arm64 Apple M3 Pro
  Memory: 79.97 MB / 36.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 24.20.0
  npm: 11.19.0
  pnpm: 11.22.0
  bun: 1.3.14
Browsers:
  Chrome: 152.0.7977.65
  Safari: 26.5

Used package manager

pnpm

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions