Skip to main content
@mcp-use/client connects your app to one or more MCP servers. It negotiates the server’s supported MCP protocol automatically and exposes the same connection API across sessionful and sessionless servers.

Install

The package requires Node.js >=22.22.2 for Node applications and is ESM-only.

Quick start

connect(name) returns a ready MCPConnection. Always close the client when your application is finished so its active connections and transports are released.

Core types

  • MCPClient — holds server configuration and opens connections.
  • MCPConnection — calls tools, reads resources, and fetches prompts. connection.info exposes the negotiated protocol, server metadata, capabilities, and instructions.
  • MCPSession — deprecated compatibility alias for MCPConnection.
Use client.connect(name) for one configured server or client.connectAll() to connect to every configured server.

Configure servers

HTTP servers support automatic OAuth, bearer tokens, and custom headers. Stdio connections are available only in Node.js. Migrating existing client code? Follow the client migration guide.

Next steps

Tools

List and call server tools.

Migration guide

Update packages, imports, configuration, and connection code.

Authentication

Configure OAuth and bearer tokens.

React

Manage connections with McpClientProvider and hooks.

Environments

Compare Node, browser, and React support.