Skip to content

Introduction

@casys/mcp-bridge brings MCP Apps from developer tools (Claude Desktop, VS Code) to messaging platforms with 2+ billion users — without changing a single line of your MCP App code.

MCP Apps (interactive UIs served via ui:// resources) only work inside developer tools. Your users on Telegram, LINE, and other messaging platforms can’t access them.

Building custom integrations for each platform means:

  • Rewriting UI code for each platform’s SDK
  • Implementing auth, session management, and security from scratch
  • Maintaining separate codebases per platform
  • Losing the MCP protocol’s built-in tool execution

@casys/mcp-bridge is a transparent bridge that:

  1. Intercepts postMessage calls from your MCP App (via injected bridge.js)
  2. Routes JSON-RPC messages through WebSocket to a Resource Server
  3. Forwards tool calls to your unmodified MCP Server
  4. Maps platform-specific features (themes, auth, viewport) automatically
import { startResourceServer } from "@casys/mcp-bridge";
const server = startResourceServer({
assetDirectories: { "my-app": "./ui-dist" },
platform: "telegram",
telegramBotToken: Deno.env.get("TELEGRAM_BOT_TOKEN"),
});
// Your MCP App now works inside Telegram!

Bridge Client

Browser-side IIFE injected into served HTML. Monkey-patches postMessage to intercept MCP JSON-RPC calls.

Resource Server

HTTP + WebSocket server. Serves ui:// resources, injects bridge.js, manages sessions, forwards tool calls.

Platform Adapters

Telegram and LINE adapters handle auth, theme mapping, viewport, and lifecycle events.

MCP Server

Your existing MCP server stays completely unmodified. The bridge acts as an MCP client.

  • Zero code changes — existing MCP Apps work as-is
  • Telegram Mini Apps — full WebApp SDK integration (theme, viewport, safe areas, auth)
  • LINE LIFF — Coming soon
  • Security by default — CSP enforcement, HMAC-SHA256 auth, crypto-secure sessions
  • 107 tests — comprehensive test coverage
  • Extensible — add Discord, WhatsApp, or any platform via the adapter pattern