@mcp-use/client/react:
McpClientProvider for multi-server apps. Use standalone useMcp only for a single server.
Provider setup
Connection states
OAuth does not auto-start by default (
preventAutoAuth: true). Show a sign-in button when state === "pending_auth".
OAuth callback
Create a route (default:/oauth/callback):
defaultCallbackUrl on the provider or callbackUrl per server.
Proxy fallback
When direct browser connections fail (CORS / FastMCP), retry through a proxy:Persistence
Standalone useMcp
For one server without the provider:
Types
McpServerConfig— server options passed toaddServer(replaces deprecatedMcpServerOptions).displayName— your label for the server in UI.serverInfo.name— name returned by the server at init.
McpServer (pendingSamplingRequests, pendingElicitationRequests, notifications). See Sampling and Elicitation.