TLDR Tech / Dev
Use WebMCP Tool
This is a React hook that exposes your app's functions as callable tools for browser AI agents via the experimental WebMCP spec, wrapping the imperative document.modelContext.registerTool API so tools register on mount and unregister on unmount. This means that the agent only ever sees tools for what's actually rendered, making it useful to prototype with.
Read the full story