Skip to content

window.mcp

Choose a tag to compare

@MiguelsPizza MiguelsPizza released this 26 Jul 19:52
· 90 commits to main since this release

🚀 New Feature: Script Tag Integration (@mcp-b/global)

Add MCP support to any website with just one script tag!

We've added the easiest way ever to integrate MCP-B into your website. No build tools, no complex setup—just drop in a script tag and your site becomes MCP-B.

✨ What's New

  • Zero-config setup: Works instantly in any modern browser
  • CDN-ready: Available via unpkg for immediate use
  • Global API: Automatically exposes window.mcp for tool registration
  • Complete example: Interactive todo app demo included

🎯 Quick Start

<!-- Add this to any HTML page -->
<script src="https://unpkg.com/@mcp-b/global@latest"></script>

<script>
    
  window.mcp.registerTool("getPageInfo", {
    title: "Get Page Info",
    description: "Returns current page details"
  }, async () => ({
    content: [{ type: "text", text: JSON.stringify({
      title: document.title,
      url: location.href
    })}]
  }));
}
</script>

🎮 Try the Demo

Check out /examples/script-tag/ for a complete working example with:

  • Todo management tools
  • Calculator functionality
  • Real-time AI integration
  • Visual feedback for tool calls

Perfect for prototypes, MVPs, or adding AI to existing sites without refactoring!

Install the MCP-B Extension and try saying: "Add a todo: Buy groceries" or "What's 15 * 23?"