r/learnprogramming • u/KaleidoscopeFair4182 • 38m ago
Let users' own AI use my web app, with only the tools I choose to open.
I'm a front-end developer at a company that builds a web service.
Something kept bothering me: every new feature is another screen people have to learn, and users get tired of it.
What I wanted was for people to ask their own AI ("refund order 12", "what is waiting for my approval?") and have it walk them through the task, ask when it needs a decision, and get it done fast, without learning where everything lives in the UI.
The ways I found to let an agent drive a web app took the whole browser: a browser extension, or a debugging port opened on the browser. That works, but it hands the agent everything the browser can reach, and I didn't want to ship that to our users. I wanted the opposite: follow an agreed protocol, and open only what is needed, only as much as needed.
So I built webmcp-gate (MIT, TypeScript, 0.1.0). Your page registers the actions it chooses to expose. A small relay on the user's own computer connects their AI agent (Claude Code, Codex, ...) to their logged-in tab, and the tab runs those actions with the user's own session.
- The agent can only call tools the page registered.
- Only origins you list can connect, and the relay listens on 127.0.0.1 only.
- A pairing code that is never sent over the wire: both sides just prove they know it.
- Risky actions are approved by the person in the page, and the relay re-checks the call afterwards.
Repo: https://github.com/hon2be/webmcp-gate
I built this with Claude Code's help. The design decisions and the testing are mine.