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
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:| Status | Description |
|---|---|
idle | Not connected yet (autoConnect={false}) |
connecting | server.connect() in progress |
connected | Client ready, tools/resources/prompts populated |
error | Connection failed — see error field |
useFrontMcp():
What’s Next
Provider & Context
Deep dive into FrontMcpProvider props and ServerRegistry
Hooks Reference
Full API for all hooks