Open source MCP server

Let AI call functions
in your browser

A daemon that bridges any MCP–compatible AI tool to your browser tabs over WebSocket. Register JavaScript functions as tools. The AI calls them.

$ npm i -g @businessmaps/bifrost
How it works

Three components, one bridge

stdio

MCP Client

Any MCP-compatible AI tool. Sends tool calls over JSON-RPC.

daemon

bifrost

Routes calls between stdio and WebSocket. Zero dependencies.

ws://localhost

Your Browser App

Registers tools as JS functions. Handlers run with full browser API access.

Usage

Drop in and connect

$ npm i @businessmaps/bifrost-browser
or <script src="https://unpkg.com/@businessmaps/bifrost-browser">
import { BifrostBrowser } from "@businessmaps/bifrost-browser";

const bridge = new BifrostBrowser({
  port: 3099,
  token: "TOKEN",  // check daemon stderr
});

bridge.registerTools([{
  name: "get_selection",
  description: "Returns selected text",
  inputSchema: { type: "object", properties: {} },
  handler: async () => window.getSelection().toString(),
}]);

bridge.connect();
Details

What you get

Zero dependencies

No node_modules. The daemon is one Node.js script with a hand-rolled WebSocket server. Just needs Node 18+.

Full browser access

Handlers run in the browser tab. DOM, Canvas, IndexedDB, Clipboard, fetch, WebGL, Geolocation—whatever the platform exposes.

Multi-tab

Connect multiple tabs at once. Each registers its own tools. Calls route to the tab that owns the tool.

Token auth

Random token generated on startup. Connections without it are rejected. Binds to localhost only.

Auto-reconnect

Client library handles disconnects. Tools re-register automatically when the connection comes back.

Any MCP client

Standard MCP over stdio. Works with any tool that speaks the protocol. Not locked to a single vendor.