#2475·mcp-use

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:

typescript
import { MCPClient } from "@mcp-use/client";

Per src/index-browser.ts:27, web bundlers resolve this to BrowserMCPClient.

According to the official documentation:

  1. MCP Apps UI Capability (docs/typescript/client/migration.mdx:180):

    "MCP Apps capability: pass clientOptions: { capabilities: { views: true } } instead of hand-writing extension capabilities."

  2. Server Configuration (docs/typescript/api-reference/client/mcp-client.mdx): ServerConfig (HTTP) explicitly documents support for roots (Root[]) and defaultRequestOptions (RequestOptions).

The Problem

When initializing an MCP connection via BrowserMCPClient:

typescript
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:

  1. MCP Apps UI Capability is Silently Dropped:

    • resolveClientOptions() in config.ts:311 is designed to expand the capabilities.views: true shorthand into the official extension:
      json
      {
        "capabilities": {
          "extensions": {
            "io.modelcontextprotocol/ui": {
              "mimeTypes": ["text/html;profile=mcp-app"]
            }
          }
        }
      }
    • Both NodeMCPClient (node.ts:520) and createConnectorFromConfig (config.ts:373) call resolveClientOptions(serverConfig.clientOptions).
    • BrowserMCPClient.createConnectorFromConfig (browser.ts:123) passes raw clientOptions without resolveClientOptions(). As a result, the browser client advertises raw { views: true } during the initialize handshake instead of the official extension URI. Upstream MCP servers checking ctx.client.supportsViews() return false and decline to serve interactive views to browser clients.
  2. roots is Dropped:

    • roots from serverConfig is not extracted or forwarded to HttpConnector. As a result, client roots are never advertised to the server and connector.rootsCache remains empty.
  3. defaultRequestOptions is Dropped:

    • defaultRequestOptions from serverConfig is not extracted or forwarded to HttpConnector, causing custom default request timeouts or cancellation policies to be ignored.

Expected Behavior

BrowserMCPClient.createConnectorFromConfig should:

  1. Wrap clientOptions with resolveClientOptions(clientOptions).
  2. Extract and forward roots and defaultRequestOptions into connectorOptions.