A Swagger UI plugin that turns an OpenAPI docs page into a session-scoped tool set for browser agents. The agent calls the API through the login, server and request pipeline you already have open. No MCP server, no AI SDK, no token copied anywhere.
npm install swagger-ui-webmcpPublished on npm as swagger-ui-webmcp. Peers: swagger-ui >=5.32.0 <5.34.0 and react >=18 <20. Add it as a Swagger UI plugin:
import SwaggerUI from "swagger-ui";
import SwaggerUIWebMCP from "swagger-ui-webmcp";
import "swagger-ui/dist/swagger-ui.css";
SwaggerUI({
dom_id: "#swagger-ui",
url: "/openapi.yaml",
plugins: [SwaggerUIWebMCP],
webMcp: { exposure: "write" },
});The plugin registers tools on document.modelContext when the browser provides it, and registers none when it does not. See Getting started for the full walkthrough.
This is the deployed demo, a stateful Waypoint project-tracker API with Sandbox and Production data stores. No sign-in needed. Agent tools appear only in a browser that implements WebMCP; everything else works for humans either way.
Prefer a full tab? Open the demo. The demo guide has a prompt to paste into your agent.



specActions.execute, so login, selected server and interceptors are inherited.x-webmcp), page owner, the person at the page, and the WebMCP client each narrow access. Levels are hidden < read < write; the tightest wins.agentExecution lets a page's request interceptor tag agent traffic. It is a hint, not an identity proof.Start with Getting started, then read who decides what an agent may touch, the x-webmcp extension, security and limitations, and the tool reference. Source is on GitHub (Apache-2.0).