What is WebMCP?

WebMCP is an emerging web standard that lets websites expose their own functionality as tools AI agents can discover and call directly in the browser - no separate backend server required, and the interface stays visible to the user.

Tools, Built Into the Web

WebMCP is a proposed web standard, incubated by the W3C Web Machine Learning Community Group, that gives websites a native way to tell AI agents what they can do. Instead of an agent guessing its way through a page's UI, the page itself registers tools the agent can call. WebMCP is:

In-Browser

Tools run in the page's own JavaScript context - no separate server to host

User-in-the-Loop

The agent and the person see the same UI update in real time

Origin-Scoped

Tools are scoped to the page that registers them, with explicit opt-in for cross-origin access

Complementary to MCP

Designed to work alongside backend MCP servers, not replace them

Why WebMCP Matters

Shared Context

The agent and the user see identical UI updates simultaneously, so nothing happens off-screen or out of sight.

No Separate Backend

Reuse the authentication, session state, and business logic your frontend already has instead of standing up a new integration server.

Secure by Origin

Tools are scoped to the page's origin and disabled by default in cross-origin iframes unless explicitly permitted.

Shares MCP's Vocabulary

Tools, schemas, and inputs follow the same concepts as MCP, so existing knowledge and tooling largely transfer.

How WebMCP Works

WebMCP centers on a single browser API, document.modelContext, that pages use to register tools and agents use to find and call them:

1

Registration

A page calls registerTool() to expose a JavaScript function as a tool, with a name, a natural-language description, and a JSON Schema describing its inputs.

2

Discovery

An AI agent calls getTools() to see what's available on the current page, including tools exposed from trusted cross-origin frames.

3

Execution

The agent calls executeTool() with structured arguments. The browser runs the tool's callback in the page's own context and returns a structured result.

A Tool, in a Few Lines of Code

Here's a minimal example of a page registering a tool that adds an item to a todo list:

app.js
await document.modelContext.registerTool({
  name: "add-todo",
  description: "Add a new item to the user's active todo list",
  inputSchema: {
    type: "object",
    properties: {
      text: { type: "string", description: "The todo item text" }
    },
    required: ["text"]
  },
  async execute({ text }) {
    await addTodoItemToCollection(text);
    return {
      content: [{ type: "text", text: `Added todo item: "${text}"` }]
    };
  }
});

Who Uses WebMCP

Web Developers

Expose existing app functionality to agents without building a separate backend integration

AI Agent Builders

Give agents a reliable, structured way to act on web pages instead of scraping the DOM

E-Commerce & SaaS Teams

Let agents filter, configure, and complete tasks inside the product's real UI

Browser Vendors

Standardize a safe, permissioned surface for agentic browsing across the web platform

WebMCP in Action

Design Collaboration

A design tool lets users describe template changes in natural language. WebMCP tools filter templates and apply edits while the user watches the same canvas update.

E-Commerce Filtering

Storefronts expose tools that return structured product data and update the page directly, so an agent can filter inventory - even by an uploaded photo - instantly.

Developer Platforms

Code review tools expose tools like get-status and get-failure-snippet, so agents can summarize CI failures without parsing raw infrastructure logs.

Productivity Apps

Todo, note-taking, and project tools expose simple add and complete tools agents can call directly instead of clicking through forms.

WebMCP 与 MCP

两者都为智能体提供结构化工具,但工作在不同层级。MCP 将 AI 应用连接到独立服务;WebMCP 则让智能体与用户已经打开的网页协同工作。

MCP 服务器与 WebMCP 对比
方面MCP 服务器WebMCP
运行环境页面之外的本地进程或远程服务。当前浏览器页面中的客户端代码。
连接方式MCP 客户端通过受支持的协议传输连接。浏览器或页面内智能体通过 document.modelContext 发现工具。
上下文与认证服务器管理自己的凭据,并重建所需的上下文。工具可以复用页面当前的会话、状态和前端逻辑。
能力可以公开由 API、文件或数据库支持的工具、资源和提示词。当前提案聚焦于以命令式或声明式工具公开页面操作。
用户体验通常在 AI 对话背后运行,不一定有配套的网站界面。让用户、智能体和可见页面保持在同一个共享工作流中。
适用场景后端数据访问、无头自动化和可复用的服务集成。在有状态的 Web 应用中进行有人参与的交互式任务。

两者可以配合使用。 MCP 服务器可以处理持久的后端访问,而 WebMCP 负责更新页面、保留可见上下文,并将关键步骤交还给用户。

Where WebMCP Stands Today

WebMCP remains an evolving proposal with experimental implementations and browser trials rather than universal browser support. Its explainer and draft specification were first published in August 2025 by contributors from Microsoft, Google, and the web standards community, incubated within the W3C Web Machine Learning Community Group.

The API surface - document.modelContext, registerTool(), getTools(), and executeTool() - is still evolving through public discussion, with open questions around multimodal inputs, streaming results, and long-running tasks.

从原型到 Web 提案

Jason McGhee 最初的开源 WebMCP 项目和 webmcp.dev 演示使用仅限本机的 WebSocket 桥接与注册令牌,证明网页可以公开 MCP 风格的能力。维护者现在将其标注为早期且不兼容当前规范的实现,并建议新项目采用 W3C 提案。

WebMCP 常见问题

Curious how this fits with the rest of the MCP ecosystem?