Installation
browser export condition — with no Node polyfills and no aliases. A browser bundler resolves @frontmcp/sdk to its browser build (the browser export condition), which leaves the Node HTTP host (Express) and the stdio transports out of the bundle.
With Vite 7 (Rollup), call
create() from a function or a .then() rather than with a top-level await in your entry module: Rollup can place modules the SDK imports lazily in a chunk that imports the entry back, and a top-level await there waits on itself, so create() never settles.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
autoConnect={false} to connect manually later.
Your First Hook
UseuseCallTool to invoke an MCP tool:
src/Dashboard.tsx
Multi-Server Setup
Connect to multiple MCP servers by passing aservers prop:
src/App.tsx
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