WO

webmcp-org/npm-packages

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

110 stars 23 forks 品質 86 トレンド 21MIT

MCP-B用のNPMパッケージ:トランスポート層、Reactフック、モデルコンテキストプロトコル用のブラウザツール

概要

Web Model Context APIはW3Cコミュニティグループのドラフト仕様です。これにより、すべてのブラウザタブが、ウェブページに登録されるツールがAIエージェントが発見し呼び出せるようにしています。 ネイティブサポートのないブラウザ(ChromeやFirefox 126+、Safari 18+)でそのAPIをMCP-bし、完全なModel Context Protocolに移行させ、ツールソースをプロンプト、リソース、ブラウザトランスポートを備えた完全なMCPサーバーに変換します。 MCP-bによって構築されました。公式のW3CやMCPプロジェクトではありません。 もしChrome 155以降で--enable-experimental-web-platform-featuresを使っているなら、document.modelContextはすでに存在します。とにかく使ってください: コアブラウザコントラクトや入力スキーマ推論には上流のWebMCP-typeを使用します。MCP-Bアダプター拡張やスキーマヘルパーは@mcp-b/webmcp-ts-SDKに存在します。 Chromeフラグなしで、FirefoxやSafariでも動作させたいですか?ポリフィルを追加してください — 同じAPIで同じコード: モデルコンテキストプロトコル(Props)、リソース、トランスポート、Claude Desktop、カーソル、または他のMCPクライアントとの相互運用性が必要な場合?

概要(AI 翻訳)

WebモデルコンテキストAPIのためのポリフィルおよびMCPブリッジ(document.modelContext)


ウェブスタンダード

Web Model Context APIはW3Cコミュニティグループのドラフト仕様です。すべてのブラウザタブをツールソースにし、ウェブページはAIエージェントが発見し呼び出せるツールを登録します:

MCP-b ポリフィルはネイティブサポートのないブラウザ(ChromeやFirefox 126+、Safari 18+)でそのAPIを埋め込み、完全なModel Context Protocolに接続して、ツールソースをプロンプト、リソース、ブラウザトランスポートを備えた完全なMCPサーバーに変えます。

MCP-bによって構築されました。公式のW3CやMCPプロジェクトではありません。

始めて

1.ウェブ標準を直接使う

Chrome 155以降で--enable-experimental-web-platform-featuresを使っているなら、document.modelContextはすでに存在します。とにかく使ってください:

コアブラウザにはアップストリームのwebmcp-typesを使います 契約および入力スキーマ推論。MCP-Bアダプタ拡張とスキーマヘルパーは @mcp-b/webmcp-ts-sdk。

2.ポリフィル

Chromeフラグなしで、FirefoxやSafariでも動作させたいですか?ポリフィルを追加してください — 同じAPIで同じコード:

またはReactではpnpm add usewebmcp

3.フルMCPサーバー

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。


The Web Standard

The Web Model Context API is a W3C Community Group draft spec. It makes every browser tab a tool source — web pages register tools that AI agents can discover and call:

document.modelContext
├── .registerTool(tool, { signal })  Register a tool for AI agents
├── .getTools()                      Discover registered tools
└── .executeTool(tool, inputObject)  Execute a discovered tool

The Community Group publishes the official @w3c/webmcp-polyfill for browsers without native support and webmcp-types for TypeScript. MCP-b bridges that API to the full Model Context Protocol — turning that tool source into a complete MCP server with prompts, resources, and browser transports.

Built by MCP-b. Not an official W3C or MCP project.

Getting Started

1. Use the web standard directly

If you’re running Chrome 155 or later with WebMCP enabled (see Chrome’s WebMCP overview for the origin trial and the local testing flag), document.modelContext is already there. Just use it:

Use the official webmcp-types for core browser

GitHub で README 全文を見る

インストール

npx -y @mcp-b/webmcp-local-relay@latest
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "webmcp-local-relay": { "command": "npx", "args": ["-y", "@mcp-b/webmcp-local-relay@latest"] } } }