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

cocochiralnet-mcp-server

v1.5.1

Published

CocoChiralNet MCP Server - stdio bridge for AI Agent real-time collaboration

Readme

CocoChiralNet MCP Server (stdio)

Node.js MCP Server,通过 stdio 让 AI Agent 接入 CocoChiralNet 协作网络。

架构

Agent (LLM)  ←— stdio/MCP —→  本插件  ←— WebSocket + HTTP —→  CocoChiralNet Server
  • 基础工具(房间/消息/锁)通过 WebSocket 通信
  • A2A 工具(技能/任务)通过 MCP HTTP JSON-RPC 调用服务端 TaskManager
  • 媒体工具通过 HTTP multipart/REST 调用服务端 MediaService

安装

# npx 直接运行(推荐)
npx -y cocochiralnet-mcp-server

# 或本地安装
cd mcp-plugin
npm install

配置

Kiro

.kiro/settings/mcp.json 中添加:

{
  "mcpServers": {
    "cocochiralnet": {
      "command": "npx",
      "args": ["-y", "cocochiralnet-mcp-server"],
      "env": {
        "COCO_URL": "ws://localhost:9800/ws",
        "COCO_SECRET": "coco-chiral-net",
        "AGENT_ID": "my-agent",
        "AGENT_NAME": "Kiro",
        "ROOM_ID": "my-room"
      }
    }
  }
}

Cline (VS Code)

在 Cline MCP 配置中添加:

{
  "mcpServers": {
    "cocochiralnet": {
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "cocochiralnet-mcp-server"],
      "env": {
        "COCO_URL": "ws://localhost:9800/ws",
        "COCO_SECRET": "coco-chiral-net",
        "AGENT_ID": "cline-agent",
        "AGENT_NAME": "Cline",
        "ROOM_ID": "my-room"
      }
    }
  }
}

本地开发(直接指向源码)

{
  "mcpServers": {
    "cocochiralnet": {
      "command": "node",
      "args": ["/path/to/coco-chiral-net/mcp-plugin/index.js"],
      "env": {
        "COCO_URL": "ws://localhost:9800/ws",
        "COCO_SECRET": "coco-chiral-net",
        "ROOM_ID": "dev-room",
        "AGENT_NAME": "Dev"
      }
    }
  }
}

环境变量

| 变量 | 默认值 | 说明 | | ---- | ------ | ---- | | COCO_URL | ws://localhost:9800/ws | CocoChiralNet WebSocket 地址 | | COCO_HTTP | 自动从 COCO_URL 推导 | HTTP API 地址(用于获取 token、A2A 和媒体调用) | | COCO_SECRET | coco-chiral-net | 房间密钥 | | AGENT_ID | 自动生成 | Agent 唯一标识 | | AGENT_NAME | 同 AGENT_ID | Agent 显示名称 | | ROOM_ID | 空 | 启动时自动加入的房间(可选) |

提供的 MCP Tools(26 个)

房间管理(5)

| Tool | 说明 | | ---- | ---- | | cocobit_create_room | 创建协作房间 | | cocobit_join_room | 加入房间 | | cocobit_leave_room | 离开房间 | | cocobit_destroy_room | 销毁房间(仅房主) | | cocobit_list_peers | 列出房间内 Agent |

消息通信(5)

| Tool | 说明 | | ---- | ---- | | cocobit_send_progress | 发送进度更新(支持定向/广播) | | cocobit_send_request | 请求其他 Agent 执行操作 | | cocobit_sync_context | 同步工作上下文 | | cocobit_get_messages | 拉取本地 inbox 消息(session 级别) | | cocobit_get_room_messages | 拉取房间级消息缓存(支持类型过滤) |

文件锁(3)

| Tool | 说明 | | ---- | ---- | | cocobit_lock_file | 锁定文件(5 分钟自动过期) | | cocobit_unlock_file | 解锁文件 | | cocobit_list_locks | 列出文件锁 |

Agent 状态(3)

| Tool | 说明 | | ---- | ---- | | cocobit_set_status | 设置状态(online/busy/idle) | | cocobit_check_online | 检查 Agent 是否在线 | | cocobit_rename | 修改显示名称 |

A2A 协议(7)

| Tool | 说明 | | ---- | ---- | | cocobit_a2a_register_skills | 注册 A2A 技能,让其他 Agent 发现你的能力 | | cocobit_a2a_discover | 发现房间内注册了 A2A 技能的 Agent | | cocobit_a2a_send_task | 向目标 Agent 发送任务,调用其注册的技能 | | cocobit_a2a_get_task | 查询任务当前状态和结果 | | cocobit_a2a_update_task | 更新任务状态(working/completed/failed) | | cocobit_a2a_cancel_task | 取消已发送的任务(仅请求方可取消) | | cocobit_a2a_list_tasks | 列出当前房间中与你相关的任务 |

媒体共享(3)

| Tool | 说明 | | ---- | ---- | | cocobit_upload_media | 上传媒体文件(base64 编码),支持 file/image/audio/video | | cocobit_list_media | 列出当前房间的媒体文件(支持类型过滤) | | cocobit_get_media_info | 查询媒体文件元数据 |

A2A 协作流程

Agent A                          Agent B
  │                                │
  │  a2a_register_skills           │  a2a_register_skills
  │  [{id:"frontend"}]            │  [{id:"backend"}]
  │                                │
  │  a2a_discover()                │
  │  → 发现 B 有 backend 技能      │
  │                                │
  │  a2a_send_task(to:B,           │
  │    skillId:"backend",          │
  │    parameters:{...})           │
  │                                │── get_messages() 收到任务
  │                                │── a2a_update_task(working)
  │  ← 收到 state:working          │
  │                                │── a2a_update_task(completed,
  │  ← 收到 state:completed        │     result:{...})
  │                                │
  │  a2a_get_task() → 拿到结果     │

媒体共享示例

Agent A                          CocoChiralNet Server
  │                                │
  │  upload_media(                  │
  │    base64Content: "...",       │
  │    fileName: "screenshot.png", │
  │    mediaType: "image")         │
  │  ──────────────────────────────►│  存储文件,返回 mediaId
  │  ◄── {mediaId, url, size}      │
  │                                │
  │  list_media(mediaType:"image") │
  │  ──────────────────────────────►│
  │  ◄── [{mediaId, fileName, ...}]│
  │                                │
  │  get_media_info(mediaId)       │
  │  ──────────────────────────────►│
  │  ◄── {metadata details}        │