Hacker News new | ask | show | jobs
Show HN: Webmcp-react – React hooks that turn your website into an MCP server (github.com)
5 points by kashishhora 107 days ago
Chrome recently shipped navigator.modelContext in Early Preview. It's a browser API that lets any website expose typed, callable tools to AI agents.

I built webmcp-react because we wanted a simple way to add tools to our React app and figured others could benefit from it as well. You wrap your app in <WebMCPProvider>, call useMcpTool with a Zod schema, and that's it. Handles StrictMode, SSR, dynamic mount/unmount, and all of the React lifecycle.

It also comes with a Chrome extension in the repo that acts as a bridge for MCP clients (Claude Code, Cursor, etc.), since they can't access navigator.modelContext directly. Once Chrome ships native bridging, will depracate the extension.

I expect the spec may evolve, but contributions, feedback, and issues welcome!

2 comments

Do you know when Chrome intends to GA WebMCP?
No idea! It was just released in early preview a week ago
Sweet!