npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

di-web-mcp

v0.2.1

Published

MCP Bridge Server — Daemon (stdio MCP) ↔ Browser (WebSocket) 桥接

Readme

@alife/di-web-mcp

MCP Bridge Server — 连接 AI Daemon(stdio MCP)与浏览器(WebSocket)的桥接服务

架构

qwen Daemon (stdio)
        ↕  JSON-RPC / stdio
  di-web-mcp Bridge Server
        ↕  WebSocket
  浏览器 (qwen-web-control WsClient)

Bridge Server 同时承担两个角色:

  • MCP Server:接收 Daemon 发来的 tools/listtools/call 请求
  • WebSocket Server:与浏览器端 WsClient 保持长连接,转发指令并接收执行结果

安装

tnpm install @alife/di-web-mcp

快速开始

CLI 启动

# 默认端口 9876
node node_modules/@alife/di-web-mcp/dist/cli.js

# 自定义端口和超时
di-web-mcp --port 8080 --timeout 60000

注册到 qwen Daemon

~/.qwen/settings.json 中添加:

{
  "mcpServers": {
    "di-web-mcp": {
      "command": "node",
      "args": ["/path/to/node_modules/@alife/di-web-mcp/dist/cli.js", "--port", "9876"]
    }
  }
}

编程式使用

import { MCPBridge } from '@alife/di-web-mcp';

const bridge = new MCPBridge({ wsPort: 9876, toolTimeout: 30000 });
await bridge.start();

CLI 参数

| 参数 | 类型 | 默认值 | 说明 | |---|---|---|---| | --port | number | 9876 | WebSocket Server 端口 | | --timeout | number | 30000 | 工具执行超时(ms)| | --help | - | - | 显示帮助 |

核心 API

MCPBridge

主入口,同时启动 stdio MCP Server 和 WebSocket Server。

const bridge = new MCPBridge({ wsPort: 9876, toolTimeout: 30000 });
await bridge.start();
bridge.stop();

McpStdioServer

stdio MCP Server,处理 Daemon 的 JSON-RPC 请求。

BrowserWSServer

WebSocket Server,管理浏览器连接,转发工具调用。

tools/list 等待机制

Bridge 启动后如果没有浏览器连接,tools/list无限等待直到第一个浏览器客户端上线,确保 Daemon 不会因为浏览器尚未就绪而拿到空工具列表。

运行时约束

  • 仅 Node.js 环境,无浏览器依赖
  • 唯一运行时依赖:ws
  • stdio 模式下所有日志输出到 stderr(stdout 保留给 MCP JSON-RPC)

License

MIT