client: BrowserMCPClient drops capabilities.views shorthand resolution and omits roots/defaultRequestOptions
Author: rohith500Created Sep 7, 2026Updated Sep 11, 2026
LabelsbugdocumentationTypeScriptserverclientmcp-use/mcp-use
Background & Context
In @mcp-use/client, developers building browser applications (Vite, Next.js client components, web apps) import MCPClient:
import { MCPClient } from "@mcp-use/client";Per src/index-browser.ts:27, web bundlers resolve this to BrowserMCPClient.
According to the official documentation:
- MCP Apps UI Capability (
docs/typescript/client/migration.mdx:180):"MCP Apps capability: pass
clientOptions: { capabilities: { views: true } }instead of hand-writing extension capabilities." - Server Configuration (
docs/typescript/api-reference/client/mcp-client.mdx):ServerConfig (HTTP)explicitly documents support forroots(Root[]) anddefaultRequestOptions(RequestOptions).
The Problem
When initializing an MCP connection via BrowserMCPClient:
const client = new BrowserMCPClient({
mcpServers: {
dashboard: {
url: "https://mcp.example.com",
clientOptions: {
capabilities: { views: true },
},
roots: [{ uri: "app://workspace", name: "Workspace" }],
defaultRequestOptions: { timeout: 15000 },
},
},
});
await client.connect("dashboard");Three configuration values are dropped or un-normalized:
MCP Apps UI Capability is Silently Dropped:
resolveClientOptions()inconfig.ts:311is designed to expand thecapabilities.views: trueshorthand into the official extension:{ "capabilities": { "extensions": { "io.modelcontextprotocol/ui": { "mimeTypes": ["text/html;profile=mcp-app"] } } } }- Both
NodeMCPClient(node.ts:520) andcreateConnectorFromConfig(config.ts:373) callresolveClientOptions(serverConfig.clientOptions). BrowserMCPClient.createConnectorFromConfig(browser.ts:123) passes rawclientOptionswithoutresolveClientOptions(). As a result, the browser client advertises raw{ views: true }during theinitializehandshake instead of the official extension URI. Upstream MCP servers checkingctx.client.supportsViews()returnfalseand decline to serve interactive views to browser clients.
rootsis Dropped:rootsfromserverConfigis not extracted or forwarded toHttpConnector. As a result, client roots are never advertised to the server andconnector.rootsCacheremains empty.
defaultRequestOptionsis Dropped:defaultRequestOptionsfromserverConfigis not extracted or forwarded toHttpConnector, causing custom default request timeouts or cancellation policies to be ignored.
Expected Behavior
BrowserMCPClient.createConnectorFromConfig should:
- Wrap
clientOptionswithresolveClientOptions(clientOptions). - Extract and forward
rootsanddefaultRequestOptionsintoconnectorOptions.
Source: mcp-use/mcp-use