Skip to main content

ides_adapter_weixin

微信(WeChat iLink Bot)adapter for IDES channel——让微信消息驱动 IDES agent。

按 IDES 的 外挂配置哲学:这是一个独立的 Python 进程,通过 MCP(stdio)接入 IDES,用 channel 机制收发消息。底座(Rust)不碰微信协议,翻译全在这。


Quick Start(给 agent 看:怎么装、怎么连)

1. 注册 MCP server

IDES 通过 mcp/*.toml 注册 MCP server。在 IDES_HOME 的 mcp/ 目录下放 weixin.toml

name = "weixin"
transport = "stdio"
command = "uvx"
args = ["ides-adapter-weixin"]
enabled = true
exclude = []

[env]
IDES_HOME = "<你的 IDES_HOME>"
WEIXIN_ACCOUNT_ID = "default"

本地开发版(还在迭代不想发布):把 command 换成 uvargs 换成 ["run", "--with", "<项目路径>", "ides-adapter-weixin"]

agent 也可以用 mcp_manager 工具自动注册(mcp_manager add weixin ...),不用手改 toml。

2. 连接

IDES 启动时自动拉起 MCP server(stdio)。注册后,IDES 会暴露 3 个工具,命名 mcp_weixin_<tool>

工具 作用
mcp_weixin_weixin_qrcode_login 登录:拿二维码 → 用户微信扫码 → 自动拿 token
mcp_weixin_channel_ingest 收消息:增量拉微信消息
mcp_weixin_channel_emit 发消息:回微信用户

3. 登录(必须做,否则收不到消息)

agent 调 weixin_qrcode_login

mcp_weixin_weixin_qrcode_login

返回一个二维码(qr_image_path 是落盘的图片,qrcode_url 是完整 liteapp URL)。agent 自行决定展示方式——转成图片给用户扫 / 直接给 URL / 命令行渲染,都行。

二维码会自动渲染落盘到 <IDES_HOME>/weixin/qrcode.png,agent 直接展示这张图即可。

用户用微信扫码,确认后工具自动拿到 token 存起来(后登录,不用启动时登录)。

4. 收发消息

登录成功后:

  • :调 mcp_weixin_channel_ingest,返回 {"messages":[{"msg_id","from","text","timestamp"}]}。未登录时返回 {"messages":[]}(零打扰,感知层自动过滤)。
  • :调 mcp_weixin_channel_emit,传 text(要发的文本)+ to_user_id(收件人,用消息里的 from)。

环境变量

变量 作用 默认
IDES_HOME 存 token / 游标的目录 环境变量或当前目录
WEIXIN_ACCOUNT_ID 账号标识 default

单账号即可,不用多账号(微信 iLink Bot 本身不支持多 claw 绑定)。


实现参考

核心 API 参考 hermes-agent 的 gateway/platforms/weixin.py(已验证的 iLink Bot API),按 IDES channel 契约精简重做,不依赖 hermes-agent 生态。

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ides_adapter_weixin-0.1.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ides_adapter_weixin-0.1.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file ides_adapter_weixin-0.1.2.tar.gz.

File metadata

  • Download URL: ides_adapter_weixin-0.1.2.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ides_adapter_weixin-0.1.2.tar.gz
Algorithm Hash digest
SHA256 99aa4fa9cd37fe55a10746d10dba9e14fb524530b67e1b5dbd4cea86acf03781
MD5 bc7448c94b9219a77fd3de4ab4f9ba8d
BLAKE2b-256 11163aaa95ad0ca359c74662b2bf104a1ade0108c3a326378fec52d9d4202054

See more details on using hashes here.

File details

Details for the file ides_adapter_weixin-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ides_adapter_weixin-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ides_adapter_weixin-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 01230a96c6f4fc1e9dc92f1539c818bf2c635f8352a3fe307ca0227241548ffc
MD5 9b09dba1cae1f2f2ea307d3e4a86b604
BLAKE2b-256 4ac80ff587b98f13d621978eee3e81a4a012b0c98c621847451d0c62762f471f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

2 files

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page