Skip to content

WebMCP

Bringing the power of MCP to the web

Install

$npm install @mcp-b/transports @modelcontextprotocol/sdk zod

Install command taken from the project's README or registry entry. Always review code before running it.

[!IMPORTANT] 🚨 The WebMCP API has been accepted as a W3C deliverable and is transitioning to official web standard development. The community and all related work has moved to the WebMCP explainer repository. Please join us there! 🚨

[!IMPORTANT] 📝 Repository Status: The MCP-B extension is no longer open source. This repository represents an older version of the codebase and is maintained for historical reference only. All open source content (transports, etc.) have been ported to the WebMCP Github Org.

WebMCP:

🚀 Quick Start • ✨ Live Demo • 📚 Documentation • 🤝 Contributing

Join Our Community

The protocol

WebMCP is the underlying protocol which MCP-B implements. It is a protocol which exposes function in your browser javascript to LLM's as MCP tools.

For a more indepth understanding, refer here: https://mcp-b.ai/blogs

Live Demo

See MCP-B in action right away:

Examples

Check out our examples repository: MCP-B Examples

The examples repository contains:

  • Vanilla TypeScript Demo: A simple todo app where MCP tools allow AI to manage tasks
  • React Demo: Modern React application with MCP-B integration
  • Script Tag Demo: The simplest integration - add MCP-B to any website using just a script tag

Community Examples

These demos highlight how MCP-B integrates into websites without needing complex setups. Install the MCP-B Chrome Extension to interact with the tools via the extension's chat interface or tool inspector.

What is MCP-B?

MCP-B extends the Model Context Protocol (MCP) with browser-specific transports, allowing your website to act as an MCP server. Websites expose existing functionality (e.g., APIs, forms, or state) as structured tools that AI agents can call directly.

Key components:

  • Tab Transports: Use postMessage for communication between your website's MCP server and clients in the same tab.
  • Extension Transports: Use Chrome's runtime messaging for communication with browser extensions.

This setup enables AI to interact with your site deterministically, respecting user authentication (e.g., session cookies) and scoping tools to specific pages or user states.

Quick Start

Get MCP-B running on your website in minutes. This guide focuses on adding an MCP server to expose tools, using the examples as a blueprint.

Prerequisites

  • Node.js 22.12+ (check with node --version)
  • pnpm 10+ (install via npm install -g pnpm)
  • A website with JavaScript (vanilla, React, etc.)
  • MCP-B Chrome Extension installed for testing

Development Setup (Repository Contributors)

If you want to contribute to MCP-B or run the examples locally:

  1. Clone and install:

    git clone https://github.com/MiguelsPizza/WebMCP.git
    cd WebMCP
    pnpm install
    pnpm build:shared  # Build internal shared packages
    

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…