Skip to main content

Installation

Wrap Your App

Every @frontmcp/react app starts with a FrontMcpProvider. It takes a pre-created DirectMcpServer and manages the MCP client lifecycle.
src/App.tsx
By default the provider auto-connects on mount. Pass autoConnect={false} to connect manually later.

Your First Hook

Use useCallTool to invoke an MCP tool:
src/Dashboard.tsx

Multi-Server Setup

Connect to multiple MCP servers by passing a servers prop:
src/App.tsx
Target a specific server from any hook:

Connection Lifecycle

The provider status progresses through: Monitor status with useFrontMcp():

What’s Next

Provider & Context

Deep dive into FrontMcpProvider props and ServerRegistry

Hooks Reference

Full API for all hooks