@react-profiler-mcp/react-collector
v0.1.0
Published
React Profiler wrapper that streams samples to the local MCP companion
Readme
@react-profiler-mcp/react-collector
Wrap a subtree with <ProfilerBridge> to stream render metrics to the local MCP companion.
Profiler label (profilerId)
React’s <Profiler> reports the id you pass in, not each child component’s name. Set profilerId to something meaningful (e.g. checkout-sidebar) so MCP session_summary shows that label instead of the default react-profiler-mcp-root. Use nested profilers or multiple bridges for finer breakdowns.
Production / disabled mode
Set enabled={false} to render children only:
- No
Profilersubscription. - No
fetch/sendBeaconcalls. - Safe when the companion is not running.
Bundlers should tree-shake the enabled path when you use a compile-time constant (e.g. import.meta.env.DEV in Vite or process.env.NODE_ENV === 'development' in webpack).
Peer dependency
Requires react >= 17.
