Skip to main content
@mcp-use/client connects your app to one or more MCP servers. The client negotiates legacy (v1 sessionful) and modern (v2 sessionless) servers automatically and exposes one connection API for both.

Install

Node.js 20+ required. The package is ESM-only.

Entry points

MCP App view hooks (useToolContext, useCallTool, …) live in mcp-use/react, not the client package.

Quick start

Core types

  • MCPClient — holds server config and opens connections.
  • MCPConnection — call tools, read resources, fetch prompts. Check connection.info for protocolEra, protocolVersion, capabilities, and instructions.
  • MCPSession — deprecated alias for MCPConnection.
Prefer client.connect(name) over createSession(). Use client.connectAll() for every configured server.

Configure servers

HTTP servers support OAuth (automatic by default), bearer tokens, and custom headers. Stdio is Node-only. Upgrading from v1? See the v2 migration guide.

Next steps

Tools

List and call server tools.

v2 Migration

Breaking changes and upgrade checklist.

Authentication

OAuth and bearer tokens.

React

McpClientProvider and hooks.

Environments

Node, browser, and React differences.