Skip to content

feat(core): opt out of the MCP auto-mount for Vite-plugin consumers - #559

Merged
antfu merged 1 commit into
mainfrom
deep-lizards-try
Sep 4, 2026
Merged

feat(core): opt out of the MCP auto-mount for Vite-plugin consumers#559
antfu merged 1 commit into
mainfrom
deep-lizards-try

Conversation

@antfubot

@antfubot antfubot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Description

@devframes/hub@0.9.9 flipped 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. The Vite plugin builds its initHub({...}) call from a fixed field list that never included mcp, and none of DevToolsConfig/DevToolsPluginOptions/DevToolsOptions exposed one — so a Vite-plugin consumer inherited the new auto-mount with no supported way to turn it off, even when MCP is already bridged elsewhere.

This adds mcp?: McpSetting to DevToolsConfig and forwards it into initHub({...}), mirroring the existing allowedOrigins pass-through. Omitting it preserves the hub's 'auto' default; mcp: false disables the route, true mounts it unconditionally, and an object opts into an identity check.

Linked Issues

fixes #557

Additional context

The value flows through normalizeDevToolsConfig into the resolved config and is read back in createDevToolsHub, so it covers both the Vite dev-server and standalone/CLI paths. Only forwarded when set, keeping the hub's own default intact.

This PR was created with the help of an agent.

Hub 0.9.9 flipped the aggregate MCP route's default to 'auto', mounting
a Streamable-HTTP endpoint at <base>__mcp as soon as any agent-flagged
action exists. The Vite plugin built its initHub call from a fixed field
list with no mcp slot, so consumers inherited the auto-mount with no
supported way to turn it off.

Expose mcp on DevToolsConfig and forward it into initHub, mirroring the
allowedOrigins pass-through.

Closes #557
@antfu
antfu merged commit 3f8b9c4 into main Sep 4, 2026
9 checks passed
@antfu
antfu deleted the deep-lizards-try branch September 4, 2026 01:50
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.

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

2 participants