Configuration options for the MCP connection
MCP connection state and methods
const mcp = useMcp({
url: 'http://localhost:3000/mcp',
headers: { Authorization: 'Bearer YOUR_API_KEY' }
})
// Wait for connection
useEffect(() => {
if (mcp.state === 'ready') {
console.log('Connected!', mcp.tools)
}
}, [mcp.state])
// Call a tool
const result = await mcp.callTool('send-email', { to: '[email protected]' })
React hook for connecting to and interacting with MCP servers
Provides a complete interface for MCP server connections including: