1. Conduid
  2. Browser
  3. Browser Transport
MCP server · Browser

Browser Transport

mcp-browser-transport

Unclaimed MIT last commit a year ago browser
49Fair

Scored 3 months ago · breakdown

About Browser Transport

Browser Transport is an MCP server published by RaindropSaber in the Browser category: mcp-browser-transport. It has been installed 0 times through Conduid.

The repository has 3 stars and 0 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.

Install

Install
npx mcp-browser-transport

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about Browser Transport

Powered by Claude · Grounded in docs

I know everything about Browser Transport. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ·README presentNot checked yet.
  • ·License declaredNot checked yet.
  • ·Tests presentNot checked yet.
  • ·Dependencies pinnedNot checked yet.
  • ·No dynamic code executionNot checked yet.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

README

mcp-browser-transport

基于浏览器 MessageChannel API 的 Transport 实现,适配 @modelcontextprotocol/sdk,用于不同浏览器上下文(iframe、worker、tab、window 等)之间通信。


安装

npm install mcp-browser-transport @modelcontextprotocol/sdk

快速开始

1. 在同一上下文中模拟 Client/Server 通信

import { createSameContextTransports } from 'mcp-browser-transport';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';

// 初始化 SDK
const client = new Client({ name: 'browser-client', version: '1.0.0' });
const server = new McpServer({ name: 'browser-server', version: '1.0.0' });

// 创建一对 transport
const { clientTransport, serverTransport } = createSameContextTransports();

await client.connect(clientTransport);
await server.connect(serverTransport);

// 注册工具
server.tool('add', { a: z.number(), b: z.number() }, async ({ a, b }) => ({
  content: [{ type: 'text', text: String(a + b) }],
}));

// 发起请求
const result = await client.listTools();
console.log(result);

2. 跨上下文通信(如 iframe、worker)

父页面

import { BrowserTransport } from 'mcp-browser-transport';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';

const iframe = document.createElement('iframe');
document.body.appendChild(iframe);
const channel = new MessageChannel();
iframe.contentWindow.postMessage('init', '*', [channel.port2]);

const client = new Client({ name: 'browser-client', version: '1.0.0' });
const transport = new BrowserTransport(channel.port1);
await client.connect(clientTransport);

子页面(iframe 内)

import { BrowserTransport } from 'mcp-browser-transport';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';

window.addEventListener('message', async (event) => {
  if (event.data === 'init' && event.ports[0]) {
    const server = new McpServer({ name: 'browser-server', version: '1.0.0' });
    const transport = new BrowserTransport(event.ports[0]);
    // 这里可以初始化 Server
    await server.connect(transport);
  }
});

API 说明

  • BrowserTransport:基于 MessagePort 的 Transport 实现
  • createSameContextTransports():快速创建一对可互通的 Transport 实例(适用于同一上下文)

依赖


License

MIT


如需更详细的用法或遇到问题,欢迎提 Issue 或 PR!

README mirrored from the source repository 3 months ago. The original is authoritative.

Questions

About Browser Transport

How do I install Browser Transport?

Run npx mcp-browser-transport, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is Browser Transport safe to use with an AI agent?

Its trust score is 49 out of 100 (fair). It passes 0 of 1 static security checks; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Browser Transport still maintained?

The last commit was a year ago, with 0 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.