翻篇收录说明
翻篇网页快照

WebMCP and AI agents | AI in Chrome | Chrome for Developers

https://developer.chrome.com/docs/ai/agents

最近抓取:2026-12-04 14:45:01(北京时间)

最近内容变化:2026-12-02 00:24:38(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

正文摘录

Home Docs AI in Chrome WebMCP and Agents Agent-friendly websites Use WebMCP to build sites that work better with AI agents. Get started Join the origin trial Overview What is WebMCP and why should you care? Read the doc Imperative API Define WebMCP tools with standard JavaScript to execute site-specific functions, such as form input and site navigation. Read the doc Declarative API Transform your standard HTML forms into WebMCP tools by adding annotations. Read the doc WebMCP and MCP Together, WebMCP and MCP help agents accomplish personalized tasks on behalf of human users. Read the doc Step 1 Your site registers tools Your site declares the actions an agent can take, as WebMCP tools. Each tool has a name, description, and JSON schema. // Imperative API document.modelContext.registerTool({ name: "bookSlot", title: "Book a consultation slot", description: "Reserve a 30-minute consultation.", inputSchema: { type: "object", properties: { date: { type: "string", format: "date" }, time: { type: "string" }, name: { type: "string" }, email: { type: "string", format: "email" } }, required: ["date", "time", "name", "email"] }, annotations: { readOnlyHint: false }, execute: async (input, client) => { return await api.book(input); } }); Step 2 The browser exposes them The browser collects and presents these tools to the user's WebMCP-aware agent, alongside the page's URL, title, and origin permission scope. Step 3 The agent takes fast, reliable action The agent sees a contract, supplies structured arguments, and your code does the rest. The user stays in the loop for permission and confirmation. It's faster, more reliable than actuation. // the agent's view { "tool": "bookSlot", "arguments": { "date": "2026-07-31", "time": "14:00", "name": "Jerry Jones", "email": "jerry.jones@example.com" } } When to use WebMCP Read examples from a user and agent's perspective to understand what WebMCP tools to support a critical user journey (CUJ). Read the doc Plan your WebMCP strategy Just as you'd do for any software application, your first step should be to plan your tool strategy. Read the doc Build effective tools Learn how you can define and build WebMCP tools that are useful for your website or web application. Read the doc WebMCP tool security Read our early guidance on security for those building tools with WebMCP. Read the doc WebMCP evals Before releasing WebMCP tools, test to confirm agents understand when to call the tool, how to execute it, and what answers are acceptable. Read the doc Modern web guidance Use Modern Web Guidance with your favorite AI coding agents, so you can access web best practices in your preferred workflow. npx modern-web-guidance@latest install Read the docs Build extensions with coding agents Use Modern Web Guidance to build extensiopns faster, with the help of coding agents. Read the doc Meet Gemini in Chrome AI assistance, right in your browser. Get key takeaways, clarify concepts, and find answers based on the context of your open tabs. Gemini works across your Google apps to help you power through your day. Discover Gemini in Chrome web.dev What are AI agents? Understand the basics and definitions of the various emerging technologies, often referred to as AI. Read the doc web.dev Build agent-friendly websites As web practitioners, it's critical that we build new technology thoughtfully and responsibly. Read the doc web.dev Learn AI Build a foundation of knowledge about AI to add features to your websites and web applications. Take the course