Close Menu
  • Home
  • Life style
    • Celebrities
    • Exercise & Training
    • Healthline
  • Exploration
    • Beauty tips
    • Business
    • Travel guides
    • Fashion
    • Technology
  • Web tutorials
    • Hosting & Servers
    • Blogger guides
    • WordPress guides
  • English
    • Tiếng Việt
    • Hmoob
    • English
Facebook YouTube X (Twitter) Instagram
Trending
  • WebMCP for Websites: Turn an HTML Form into an AI Agent Tool
  • Passkeys in 2026: Create, Sync, and Recover After Losing a Device
  • PCI SPoC 2026: Prepare Your Phone-Based PIN Payments Before Sunset
  • Entering Schengen with EES: Who Must Provide Biometric Data?
  • Let’s Encrypt SSL on Vultr: Enable HTTPS and Auto-Renewal
  • Install WordPress on a Vultr VPS with Secure HTTPS
  • How to Connect a Domain to a Vultr VPS: A–Z Guide
  • How to Register and Set Up a Vultr VPS: A–Z Guide
Facebook YouTube X (Twitter) Instagram
SaibABCSaibABC
Chú thích cho quảng cáo
  • Home
  • Life style
    1. Celebrities
    2. Exercise & Training
    3. Healthline
    4. View All

    Unprecedented: Argentina to Honour Messi in the 10th Minute

    05/09/2026

    Messi vs. Ronaldo at 1,000 Goals: Who Will Reach the Milestone?

    30/08/2026

    Comparing Lionel Messi and Cristiano Ronaldo: Their Complete Careers

    30/08/2026

    Celebrities Move to Video Podcasts: The New Era of Talk Shows

    30/08/2026

    Five-Minute Office Exercises: A Snack-Sized Movement Schedule

    30/08/2026

    Best Exercises to Strengthen Your Core: From Beginner to Advanced

    30/08/2026

    Wearable Workouts: Use Data to Exercise Safely

    01/09/2026

    Diagnosing and Treating Severe Pneumonia: A Practical Guide

    30/08/2026

    Preventing Dengue at Home: A Safety Checklist

    30/08/2026

    Using Wearables for Health Monitoring: Safe Use and Limits

    30/08/2026

    Unprecedented: Argentina to Honour Messi in the 10th Minute

    05/09/2026

    Wearable Workouts: Use Data to Exercise Safely

    01/09/2026

    Messi vs. Ronaldo at 1,000 Goals: Who Will Reach the Milestone?

    30/08/2026

    Diagnosing and Treating Severe Pneumonia: A Practical Guide

    30/08/2026
  • Exploration
    1. Beauty tips
    2. Business
    3. Travel guides
    4. Fashion
    5. Technology
    Featured

    Passkeys in 2026: Create, Sync, and Recover After Losing a Device

    By Nuj Coom11/09/2026
    Recent

    Passkeys in 2026: Create, Sync, and Recover After Losing a Device

    11/09/2026

    PCI SPoC 2026: Prepare Your Phone-Based PIN Payments Before Sunset

    11/09/2026

    Entering Schengen with EES: Who Must Provide Biometric Data?

    10/09/2026
  • Web tutorials
    1. Hosting & Servers
    2. Blogger guides
    3. WordPress guides
    4. View All

    Let’s Encrypt SSL on Vultr: Enable HTTPS and Auto-Renewal

    09/09/2026

    Install WordPress on a Vultr VPS with Secure HTTPS

    08/09/2026

    How to Connect a Domain to a Vultr VPS: A–Z Guide

    08/09/2026

    How to Register and Set Up a Vultr VPS: A–Z Guide

    07/09/2026

    Blogger Permissions for Collaborators: Keep Control

    07/09/2026

    Add a Blogger Report Abuse Button to Custom Themes

    07/09/2026

    Optimizing Blogger Images for Google Images: File Names to Landing Pages

    07/09/2026

    Blogger Image Lazy Loading for SEO: Crawlable Pages

    05/09/2026

    Install WordPress on a Vultr VPS with Secure HTTPS

    08/09/2026

    WordPress 7.1 AVIF & HEIC: Reduce Server Load

    02/09/2026

    WordPress 7.1 Responsive Breakpoints: How to Test Them

    02/09/2026

    Protecting WordPress Against AI Bots and Unknown Crawlers

    30/08/2026

    WebMCP for Websites: Turn an HTML Form into an AI Agent Tool

    11/09/2026

    Let’s Encrypt SSL on Vultr: Enable HTTPS and Auto-Renewal

    09/09/2026

    Install WordPress on a Vultr VPS with Secure HTTPS

    08/09/2026

    How to Connect a Domain to a Vultr VPS: A–Z Guide

    08/09/2026
  • English
    • Tiếng Việt
    • Hmoob
    • English
SaibABCSaibABC
Home»Web tutorials»WebMCP for Websites: Turn an HTML Form into an AI Agent Tool
Web tutorials 11 Mins ReadNo Comments

WebMCP for Websites: Turn an HTML Form into an AI Agent Tool

Nuj CoomBy Nuj CoomUpdated:11/09/2026
Facebook Twitter Pinterest LinkedIn Tumblr Email
Chú thích cho quảng cáo

Contents

  1. How Is WebMCP Different from an Agent Clicking Through the Interface?
  2. Choose and Standardize a Form Before Exposing It to Agents
  3. Add the Declarative API to the HTML Form
    1. 1. Declare the Name, Description, and Parameters
    2. 2. Restrict choices with select
    3. 3. Enable automatic submission only for low-risk actions
  4. If you need to return structured results to the agent
  5. Show status and allow cancellation
  6. Test in a compatible environment
  7. Risks that must be handled in the backend
    1. A tool description is not a security mechanism
    2. Do not trust data submitted by the agent
    3. Control prompt injection and untrusted data
    4. Distinguish read actions from write actions
  8. When should you use WebMCP, and when should you use a backend API?
  9. Minimum implementation path
  10. Reference source

WebMCP for websites lets you describe a web action—such as searching, filtering products, or submitting a support request—as a tool with a name, description, and structured parameters. With the Declarative API, you start with an HTML <form> element, add WebMCP attributes, and let the browser provide that form to a compatible agent.

The target outcome of this article is a search form that continues to work for ordinary users while a WebMCP-aware agent can identify the tool, fill in its fields query and submit it according to the policy you choose. WebMCP is still an experimental proposal, not a W3C Standard; the draft documentation was published on September 10, 2026 (according to webmachinelearning.github.io).

How Is WebMCP Different from an Agent Clicking Through the Interface?

WebMCP is a proposed web API that allows applications to expose selected functions as tools for AI agents. Without this descriptive layer, an agent typically has to inspect the interface, find buttons, fill in fields, and simulate user actions. With WebMCP, the website declares the action name, purpose, and input data in advance, so the agent can submit parameters in a clearer structured format (according to developer.chrome.com).

WebMCP does not automatically turn a website into a public API for every external server, nor does it replace the backend. Tools are registered in the browser context; their visibility and execution depend on the browser, agent, login session, and the website’s policies.

Interaction methodWhat must the agent do?What does the website provide?
Interface simulationInspect the page, infer the button, fill in the fields, and click SubmitHTML, CSS, and visible state
WebMCP Declarative APICall a tool with structured parametersA tool name, description, and schema inferred from the form
Backend API or MCPCall a server-side serviceAn endpoint, authentication, and backend logic

WebMCP is therefore a good fit when the action already exists on the website and you want an agent to go through that flow. Authentication, authorization, data validation, rate limiting, and transaction confirmation must still be handled independently.

Chú thích cho quảng cáo

Choose and Standardize a Form Before Exposing It to Agents

Start with an action that has a narrow scope, an easily verifiable result, and low risk. Search forms, product filters, and support requests are generally more suitable than payments, data deletion, or account-permission changes.

  • The form has one clear purpose, such as “search for products by keyword.”
  • Each field has a name stable name that can serve as a parameter name.
  • Important fields have label, an appropriate input type, and required when needed.
  • The server still validates the data, access permissions, login status, and rate limits.
  • The traditional form-submission flow continues to work when the browser or agent does not support WebMCP.

This is a required step, not merely an accessibility improvement. Labels, input types, and option values help users, assistive technologies, and agents understand the meaning of the data correctly.

Add the Declarative API to the HTML Form

1. Declare the Name, Description, and Parameters

Open the interface source code or template containing the form in a development or staging environment, then add toolname and tooldescription. According to the Declarative API documentation, if either of these attributes is missing, the form is not registered through this mechanism (according to developer.chrome.com).

<form
  method="get"
  action="/search"
  toolname="searchProducts"
  tooldescription="Tìm sản phẩm theo từ khóa và mở trang kết quả tìm kiếm."
>
  <label for="query">Từ khóa sản phẩm</label>
  <input
    id="query"
    name="query"
    type="search"
    required
    toolparamdescription="Tên hoặc đặc điểm của sản phẩm cần tìm."
  >

  <button type="submit">Tìm kiếm</button>
</form>

Insert the code above into the page’s HTML/template; do not run it in the server console. If the actual path is not /search, replace it with your form-processing endpoint. The expected result is that the form can still be submitted using the Search button, while a compatible agent sees a tool named searchProducts with the parameter query.

  • toolname is the identifier; use a stable, distinctive name without spaces.
  • tooldescription describes the action and its result, not an advertising slogan.
  • name="query" becomes the field name in the input data.
  • toolparamdescription explains the parameter’s business meaning.
  • action="/search" Retain the traditional HTML fallback.

If there is no toolparamdescription, the browser can use the contents of label to describe the field. For parameters with domain-specific meaning, write a separate description to reduce the chance of the agent making an incorrect assumption (according to developer.chrome.com).

2. Restrict choices with select

If a parameter accepts only a fixed set of values, use <select> instead of allowing the agent to generate an arbitrary string. The value values are sent to the server; the text displayed between the <option> tags may be different.

<label for="category">Danh mục</label>
<select
  id="category"
  name="category"
  required
  toolparamdescription="Danh mục sản phẩm cần tìm."
>
  <option value="laptop">Laptop</option>
  <option value="monitor">Màn hình</option>
  <option value="keyboard">Bàn phím</option>
</select>

The backend must verify again that category is laptop, monitor or keyboard. HTML validation and the schema generated by the browser are not security boundaries.

3. Enable automatic submission only for low-risk actions

Do not add toolautosubmit at the initial stage if you want users to review the data before submission. When this Boolean attribute is enabled, a tool call can trigger form submission and continue through the form’s workflow (according to developer.chrome.com).

<form
  method="get"
  action="/search"
  toolname="searchProducts"
  tooldescription="Tìm sản phẩm theo từ khóa."
  toolautosubmit
>
  <label for="query">Từ khóa</label>
  <input id="query" name="query" type="search" required>
  <button type="submit">Tìm kiếm</button>
</form>

The example above is appropriate only when the search does not create, modify or delete data. Do not enable automatic submission for payments, orders, email delivery, data deletion, permission changes or actions that create a financial obligation. For these workflows, retain a user review step and require explicit confirmation.

If you need to return structured results to the agent

A conventional GET form can navigate to a results page without requiring separate JavaScript. If you want to process the request through an API and return a short result to the agent, register the processing promise as soon as the event is received; do not wait until after await fetch() before calling respondWith().

Place the following code in the JavaScript for the page containing the form, after the DOM includes the form. Replace /api/search with the actual endpoint, and ensure that the endpoint verifies the login session, access permissions and input data, and includes protection against duplicate submissions.

const form = document.querySelector('form[toolname="searchProducts"]');

if (form) {
  form.addEventListener('submit', (event) => {
    if (!event.agentInvoked) {
      return;
    }

    event.preventDefault();
    event.respondWith(handleAgentSearch(form));
  });
}

async function handleAgentSearch(form) {
  const data = new FormData(form);
  const query = String(data.get('query') || '').trim();

  if (query.length < 2) {
    return {
      ok: false,
      error: 'Từ khóa phải có ít nhất 2 ký tự.'
    };
  }

  try {
    const response = await fetch('/api/search', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ query })
    });

    if (!response.ok) {
      return {
        ok: false,
        error: 'Không thể hoàn tất tìm kiếm lúc này.'
      };
    }

    const result = await response.json();

    return {
      ok: true,
      resultUrl: result.resultUrl,
      count: result.count
    };
  } catch (error) {
    return {
      ok: false,
      error: 'Không thể kết nối đến dịch vụ tìm kiếm.'
    };
  }
}

This is an illustrative example, not code that can be deployed unchanged with every backend. Check the response structure before reading resultUrl and count; do not include tokens, internal error details, personal data or sensitive data in the result returned to the agent. If the website uses a CSRF token, session cookie or required custom header, retain those mechanisms in the existing backend flow.

Show status and allow cancellation

Show status and allow cancellation

An agent should not make an action invisible. The Declarative API documentation describes the events toolactivated, toolcancel and pseudo-classes such as :tool-form-active, :tool-submit-active so that the interface can indicate the corresponding state (according to developer.chrome.com).

form:tool-form-active {
  outline: 2px dashed #2563eb;
  outline-offset: 4px;
}

form:tool-form-active::before {
  content: "AI agent đang chuẩn bị biểu mẫu — hãy kiểm tra trước khi gửi";
  display: block;
  margin-bottom: 0.75rem;
  color: #1d4ed8;
  font-size: 0.9rem;
}

This CSS snippet is only a visual indicator. Check contrast, do not obscure input fields, and do not use color as the sole signal. For consequential actions, provide clear text, a confirmation button and an obvious way to cancel.

Test in a compatible environment

Test on staging before deploying to production. Because WebMCP is still under development, the fact that an agent or browser works in this environment does not mean that every environment supports it (according to webmachinelearning.github.io).

  1. Fallback: without an agent, submit the form as a regular user and confirm that the page or response remains correct.
  2. Recognition: confirm that the agent sees the correct searchProducts and that no tools have duplicate names.
  3. Schema: test a required field, an overly short string, an invalid data type and each value of select.
  4. Confirmation: for data-writing actions, verify that the user can review, edit and cancel before submission.
  5. Errors: simulate an expired login session, network errors, 4xx responses and 5xx responses; messages returned to the agent must be brief and contain no secrets.
  6. Repeated calls: call the same tool multiple times to verify that it does not create duplicate records or transactions.
  7. Logging: Log the tool name, timestamp, session or user, and outcome to the extent necessary; do not record all sensitive data.

How WebMCP is enabled and the level of support may vary by environment. OpenAI describes testing WebMCP in ChatGPT’s integrated browser and in Chrome through experimental features or an origin trial; read the documentation for the environment you intend to support rather than hard-coding a browser flag into your product documentation (according to openai.com).

Risks that must be handled in the backend

A tool description is not a security mechanism

tooldescription It only helps the agent understand the tool’s purpose. The server must still authenticate the session, enforce authorization for each user and record, validate data types and ranges, and apply rate limits.

Do not trust data submitted by the agent

Limit string lengths, item counts, and request sizes. Reject values outside the allowed set, normalize data on the server, and recheck the business state immediately before execution.

Control prompt injection and untrusted data

Product content, comments, or API responses may contain instructions intended to mislead the agent. The WebMCP draft identifies prompt injection, unintended action execution, and privacy leakage caused by overly broad parameters as risk categories that require consideration (according to webmachinelearning.github.io).

Distinguish read actions from write actions

Searching or filtering is generally easier to control than placing an order, submitting a legal form, or deleting an account. Require confirmation at the final step, use an idempotency key when necessary, and design for cancellation or undo where the business process allows it.

When should you use WebMCP, and when should you use a backend API?

NeedMore suitable optionReason
Let an agent use an existing form or browser flowWebMCP Declarative APIRequires fewer interface changes while preserving the HTML fallback.
Provide functionality to multiple external applicationsBackend API or MCP serverProvides more centralized control over authentication, versioning, limits, and monitoring.
Perform transactions involving significant value or elevated privilegesBackend with an explicit confirmation stepDo not hand over full control to the form description or automatic submission.
Allow an agent to read public content onlyStructured HTML, semantic data, or a read-only APINot every read-only task requires registering an executable tool.

Minimum implementation path

  1. Choose a low-risk action such as searching or filtering.
  2. Stabilize name, label, field types, and valid values.
  3. Add toolname, tooldescription and descriptions of the required parameters.
  4. Keep the manual confirmation step; do not enable toolautosubmit.
  5. Test the fallback, schema, access permissions, errors, logging, and repeated calls in staging.
  6. Expand to data-writing actions only after adding confirmation, idempotency protection, and a recovery plan.

In short, the safe way to begin with WebMCP for websites is to choose an HTML form with a clearly defined purpose, describe it with the Declarative API, and keep all important checks in the backend. Treat WebMCP as an agent-facing interaction layer, not a security layer or a replacement for an API. If the form has a fallback, clear parameters, an appropriate confirmation step, and realistic testing, the website will be easier for agents to use without excluding ordinary users.

Reference source

  • WebMCP — Web Machine Learning Community Group, Draft Community Group Report, 10 September 2026.
  • WebMCP and AI agents — Chrome for Developers.
  • Declarative API — Chrome for Developers.
  • WebMCP — webmachinelearning/webmcp GitHub repository.
  • The WebMCP Challenge — OpenAI.

Chú thích cho quảng cáo
AI agent Chrome Featured HTML MCP Trending en Web Development Web standards WebMCP
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticlePasskeys in 2026: Create, Sync, and Recover After Losing a Device
Nuj Coom
  • Website
  • Facebook
  • X (Twitter)
  • Instagram

I'm a doctor, for sure. But I also love writing and sharing knowledge, life experiences, web tricks, and useful lectures. Let's cheer for your passion.

Related Posts

Let’s Encrypt SSL on Vultr: Enable HTTPS and Auto-Renewal

09/09/2026

Install WordPress on a Vultr VPS with Secure HTTPS

08/09/2026

How to Connect a Domain to a Vultr VPS: A–Z Guide

08/09/2026
Add A Comment
Leave A Reply Cancel Reply

Latest posts

Entering Schengen with EES: Who Must Provide Biometric Data?

How to Block OTA Updates on iPhone and iPad

What Is an Agent Plugin? Package AI Skills Across Tools

Optimizing a Blog for Google AI Overviews and AI Mode

Docker Minimus Migration: Move to Docker Hardened Images

Advertisement
Chú thích cho quảng cáo

SUBSCRIBE TO UPDATES

Get the latest creative news from SaibABC.Com on web tips, design, and business.

Copyright © 2024. Designed by NujCoom.
  • Home
  • Contact
  • Privacy
  • Tiếng Việt
  • Hmoob

Type above and press Enter to search. Press Esc to cancel.