WebMCP — Make Any Website Agent-Ready

io.github.up2itnow0822由 GitHub 账号 up2itnow0822 发布v0.5.0更新于 Oct 27, 2026

W3C WebMCP toolkit for Chrome 146. Expose any website as a structured MCP server for AI agents.

发布方自己的服务:Make

概览

AI 生成的概览

面向浏览器代理的 TypeScript SDK,通过实验性 W3C WebMCP 接口把网站工具暴露给 AI 代理,并附带授权、限额与钱包演示。

可以做什么
  • 通过实验性的 document.modelContext 接口在网页中注册和调用工具,也可选择启用旧版 navigator 适配器。
  • 为工具加上确认弹窗、速率限制和审计钩子,并按受限的 JSON schema 校验输入。
  • 在 React 应用中限定会话策略,并通过显式的可信处理器映射注册带注解的 HTML 表单。
  • 由 Express 中间件提供发现元数据,并运行本地交易工作室,由代理提出钱包操作、由人工审批。
适用场景
适合正在开发网站或 React 应用、希望借助 WebMCP 向 AI 代理开放自身工具的场景,也适合研究“代理提议、人工批准”的钱包交易参考实现。
运行要求
需从代码仓库本地运行,要求 Node 22.22.2+ 或 24.15+ 及 npm;目前尚未发布软件包,必须自行构建。原生 WebMCP 仍属实验性,取决于浏览器与来源。实时钱包演示需要注入式 EIP-1193 钱包,并运行在 Base 链 8453 上。
安装前请注意
README 说明安全修复仅存在于未发布的 0.6.0 候选版本,已发布的注册表版本不含这些修复。实时钱包模式可提交真实转账和兑换;单笔提案限额不限制累计支出,已提交的交易哈希在核实前一直处于待定状态。x402 支付已暂停,不得用于生产环境。通用 kit 回调与日志可能包含输入内容,并非脱敏的审计存储。

安装

在 SourceWeft 中

  1. 打开 控制台中的 WebMCP — Make Any Website Agent-Ready,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

webmcp-sdk

TypeScript tools for browser agents, with explicit authorization, bounded execution, React lifecycle support and a non-custodial transaction reference app.

0.6.0 is a breaking security release candidate. Existing registry releases do not contain these repairs. Read the migration guide. The candidate is unpublished; this project provides neither custody nor a guarantee against attacks.

Try the transaction studio

From a repository checkout, with Node 22.22.2+ (22 LTS) or 24.15+ (24 LTS) and npm:

sh
npm ci --ignore-scriptsnpm run buildnpm run studio:dev

Open Vite's localhost URL. Practice mode uses invented balances, prices and receipts; it never signs or broadcasts. Live wallet mode uses an injected EIP-1193 wallet on Base chain 8453. The candidate supports ETH, native Base USDC and WETH transfers, and USDC/WETH exact-input swaps through the configured Uniswap V3 router and fee tier 500. Agents read state and propose actions; humans separately review each exact approval or transaction and authorize it in their external wallet.

Proposals bind account, chain, saved policy version, exact amount, minimum output and a 120-second expiry. Slippage is capped at 1%. Per-proposal limits do not cap aggregate spending. No key/seed input, arbitrary agent calldata, unlimited approval or agent signing tool is provided. Saved policy survives mode changes; memory-only activity clears on reload or mode change.

A submitted hash is pending. Matching transaction fields, receipt and token events must be checked before confirmation. Ambiguous submissions and RPC failures remain pending. Mined inclusion is not irreversible finality; inspect pending wallet activity before retrying. See the threat model and release runbook.

SDK quickstart

Install the reviewed package after publication, or build this branch locally. Public subpaths provide CommonJS, ES modules and TypeScript declarations.

ts
import { createKit, defineTool } from "webmcp-sdk";
const kit = createKit({ prefix: "demo" });kit.register(  defineTool(    "hello",    "Return a greeting for the supplied name.",    {      type: "object",      properties: { name: { type: "string", maxLength: 100 } },      required: ["name"],      additionalProperties: false,    },    ({ name }) => ({ message: `Hello, ${name}!` }),  ),);console.log(await kit.invoke("demo.hello", { name: "Bill" }));// { message: 'Hello, Bill!' }await kit.ready();// Later: kit.unregisterAll();

Direct invocation works without a native browser API. The default adapter uses document.modelContext, execute, asynchronous registration and registration AbortSignals. Await ready() to observe registration errors. Native WebMCP is experimental and browser/origin dependent. Use the canonical browser example to distinguish local execution from native readiness. A legacy navigator adapter requires explicit browserAdapter: 'legacy' and separate compatibility testing. Annotations are advisory metadata, not authorization.

Execution and authorization

Inputs are finite own-data JSON snapshots, recursively frozen before asynchronous hooks. Dangerous keys, cycles, arbitrary prototypes, accessors and invalid schemas reject. Validation works without unsafe-eval; supported schema restrictions are intentional compatibility limits.

Defaults: 10 concurrent executions, 100 queued/admitted waits, 30-second deadlines, 65,536 input bytes, 1,000 nodes and depth 10. Handlers receive an optional second { signal } argument. Propagate cancellation and check current authority at the operation boundary. A deadline cannot preempt synchronous JavaScript or force an uncooperative promise to stop; unresolved work retains its capacity/lease until it settles.

ts
import { withConfirmation, withSecurity } from "webmcp-sdk/security";
// reviewedTool, showReviewDialog and writeAuditEvent are application-owned.const secured = withSecurity(  withConfirmation(    reviewedTool,    "Approve these reviewed terms?",    showReviewDialog,  ),  {    rateLimit: { maxInvocations: 10, windowMs: 60_000 },    audit: true,    onAudit: writeAuditEvent,  },);kit.register(secured);

withConfirmation requires its explicit provider to return literal true. kit.requestUserInteraction independently requires kit configuration confirmationProvider. Financial review must bind immutable terms; a generic boolean dialog is insufficient by itself. audit: true needs a reliable synchronous sink. Security audit omits input by default and never logs raw handler results/errors; explicitly allowed fields receive credential-key redaction. General kit callbacks/logs can contain input and are not a redacted audit store. blockedPatterns are bounded literal substrings, not a comprehensive prompt-injection filter.

React and declarative forms

Use WebMCPProvider from webmcp-sdk/react to scope session policy. Tool hooks publish committed handlers/metadata, revoke old registrations when callback authority changes, and remove only their owned registrations. Config-owned providers reject changed configuration; remount to replace policy. Supplied kits may be replaced. Stable callbacks avoid unnecessary revocation but must retain all account/policy dependencies.

registerDeclarativeTools(kit, root, { handlers }) registers annotated forms through an explicit trusted handler map and returns cleanup. HTML cannot define executable handlers. See declarative tools for supported fields and authorization responsibilities.

x402 and discovery

x402 payments: Paused for security maintenance. Do not use in production.

webmcp-sdk/middleware/express serves discovery metadata, not an execution transport or authentication system. Catalogs deny by default: supply an authorizer returning literal true, or deliberately choose publicManifest: true. Catalog responses use private, no-store. Actual operations need separate authentication and authorization.

Python discovery is a separate source distribution; npm does not install Python imports. No stdio server, webmcp-sdk serve, ProxyRelay or AuditLog class is supplied.

Verification

sh
npm run verify:release

The release record distinguishes historical evidence from freshly reconstructed checks. The complete gate covers formatting, types, SDK/Studio tests and builds, packed consumers, native browser/CSP, deterministic wallet flows, accessibility/mobile checks, Python tests and dependency audit. Python installation has a separate wheel-import check. No automated check publishes, deploys or sends real funds. See SECURITY.md for reporting. MIT license.

来源:README.md,提交 44a3899

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.5.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Make 集成