Skip to main content
Widget hooks (useWidget, useCallTool, …) are in mcp-use/react, not here.

McpClientProvider

Wraps the app to manage multiple HTTP MCP connections.

Props

useMcpClient()

Must run inside McpClientProvider.

useMcpServer(id)

Returns McpServer | undefined for one server.

useMcp(options)

Standalone hook for a single HTTP connection. Returns UseMcpResult. Key options: url, headers, enabled, callbackUrl, oauth, oauthProxyUrl, preventAutoAuth, detectMixedAuth, useRedirectFlow, autoProxyFallback, autoReconnect, reconnectionOptions, onSampling, onElicitation, onNotification, clientInfo, fetch. detectMixedAuth defaults to true. After an anonymous connection discovers RFC 9728 protected-resource metadata, authorization is { mode: "mixed", authenticated: false, resource?, scopesSupported? } while the connection remains ready.

McpServer

Extends connection state with provider metadata:

McpServerConfig

Server config for addServer. Extends UseMcpOptions with: McpServerOptions is a deprecated alias for McpServerConfig. Persistence helpers: pickPersistedServerConfig, toPersistedServerConfig, PersistedMcpServerConfig.

StorageProvider

Built-in: LocalStorageProvider(storageKey?), MemoryStorageProvider(). Both read and write PersistedMcpServerConfig, which intentionally excludes request headers, proxy headers, auth tokens, client secrets, callbacks, providers, and other runtime-only values.

RPC logging

onMcpAuthorization()

Call on your OAuth callback page. Handles popup postMessage and redirect flows.

Telemetry

Tel, Telemetry, setTelemetrySource — browser telemetry re-exports.