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

claude-wechat-channel

v0.1.2

Published

Claude Code 微信 Channel — 让 Claude Code 通过微信收发消息

Readme

claude-wechat-channel

微信 Channel for Claude Code

让 Claude Code 直接通过微信收发消息 — 微信消息到达后,Claude Code 在当前 session 中处理并回复,完整保留上下文和工具能力。

工作原理

本项目是一个 MCP server,声明了 claude/channel capability(Claude Code Channel v2.1.80+ 的官方扩展机制)。三方各司其职:

| 角色 | 职责 | |------|------| | 微信 | 用户发送/接收消息的 IM 平台 | | claude-wechat-channel | 轮询微信 API 获取新消息,推送 MCP notification 给 Claude Code;接收 Claude Code 的 reply tool 调用,将回复发送到微信(自动分段、markdown 转纯文本) | | Claude Code | 接收 channel 推送的消息,在当前 session 中处理(可使用所有工具能力),通过 reply tool 回复,原生管理会话上下文 |

快速开始

前置条件

1. 注册 MCP server

在你想让 Claude Code 工作的目录下,创建或编辑 .mcp.json

{
  "mcpServers": {
    "wechat": {
      "command": "npx",
      "args": ["claude-wechat-channel"]
    }
  }
}

Windows 用户请改用以下配置:

{
  "mcpServers": {
    "wechat": {
      "command": "cmd",
      "args": ["/c", "npx", "claude-wechat-channel"]
    }
  }
}

2. 启动 Claude Code

claude --dangerously-load-development-channels server:wechat

**首次启动会自动弹出微信登录二维码图片,用微信扫码登录, 可能要稍等几秒, 不要着急。**登录凭证会保存到 ~/.wechat-claude/,后续启动自动恢复。

如需重新登录,删除凭证目录即可:rm -rf ~/.wechat-claude/accounts/

3. 开始使用

从「微信ClawBot」发消息,Claude Code 会自动接收并回复。

配置

通过环境变量配置,在 .mcp.json 中传入:

{
  "mcpServers": {
    "wechat": {
      "command": "npx",
      "args": ["claude-wechat-channel"],
      "env": {
        "DATA_DIR": "~/.wechat-claude",
        "DEBUG": "1"
      }
    }
  }
}

Windows 用户"command""args" 替换为:"command": "cmd", "args": ["/c", "npx", "claude-wechat-channel"]

| 变量 | 默认值 | 说明 | |------|--------|------| | DATA_DIR | ~/.wechat-claude | 数据持久化目录(账号凭证、同步状态) | | DEBUG | 未设置 | 设置任意值开启调试日志 |

内置处理

  • 自动分段:微信单条消息限制 4000 字符,超长回复会自动拆分为多条发送
  • Markdown 转纯文本:Claude 的回复会自动去除 markdown 格式(微信不支持渲染)
  • 凭证持久化:微信登录凭证保存在 DATA_DIR 目录下,重启自动恢复登录状态
  • 二维码自动打开:登录二维码会保存为图片并自动用系统默认程序打开(macOS / Linux / Windows)

注意事项

  • Channel 功能目前是 Claude Code 的实验性特性,需要 --dangerously-load-development-channels 标志
  • DATA_DIR 下的凭证文件请妥善保管

License

MIT