
在Zulip中运行AI代理作为@mentionable机器人——或者连接到任何MCP客户端。
概览
在Zulip中运行AI代理作为@mentionable机器人——或者连接到任何MCP客户端。也可以作为Python库使用。 2. 在你的项目根节点添加一个 .zuliprc 文件,并使用你的 Zulip 机器人凭证。关于如何制作机器人,请参见“添加机器人或集成”。机器人类型必须是“通用”的。 3. 将MCP服务器添加到您的.mcp.json: 4. 重启你的MCP客户端。Zulip工具现在应该可用了。 - Python >=3.10,用 uv 管理 - 用于 Zulip API 认证的 .zuliprc 文件(见快速启动)- 监听器模式:选择的后端 CLI 已安装并认证(默认为 claude,codex 带有 --backend codex,或 opencode 为 --backend opencode) zulipmcp 也可以直接导入为 Python 库: Hermes 使用原生的 hermes_plugin/zulip 网关适配器,而非子进程监听器。每个流/主题映射到其自身的持久 Hermes 会话,而 zulipmcp 则作为显式的 Zulip API 工具层继续使用。
概述(AI 翻译)
在Zulip中运行AI代理作为@mentionable机器人——或者连接到任何MCP客户端。也可以作为Python库使用。
快速开始
-
安装该软件包:
-
在你的项目根节点添加一个包含 Zulip 机器人凭证的文件
.zuliprc。关于如何制作机器人,请参见添加机器人或集成。机器人类型必须是“通用”的。 -
将MCP服务器添加到你的
.mcp.json: -
重启你的MCP客户端。Zulip工具现在应该可用了。
要求
- Python >=3.10,用 uv 管理
- 用于 Zulip API 认证的
.zuliprc文件(见快速启动) - 监听器模式:所选后端CLI默认安装并认证(
claude,codex与--backend codex,或opencode为[--backend opencode)
入口点
| 入口 | 描述 |
|---|---|
uv run python -m zulipmcp.mcp |
Claude Code、Codex 及其他 MCP 客户端的 MCP 服务器 |
uv run python -m zulipmcp.mcp --transport sse |
通过SSE的MCP服务器(用于远程/网页客户端) |
uv run python -m zulipmcp.launch_agent |
启动一个没有监听器的MCP支持的编码会话 |
uv run python -m zulipmcp.listener |
听者:守望@mentions,生成特工会话 |
图书馆使用
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
zulipmcp
Run AI agents in Zulip as @mentionable bots — or wire into any MCP client. Also works as a Python library.
Quickstart
-
Install the package:
uv add zulipmcp --git https://github.com/windborne/zulipmcp.git -
Add a
.zuliprcfile to your project root with your Zulip bot credentials. See Add a bot or integration for instructions on making a bot. The bot type must be “generic.” -
Add the MCP server to your
.mcp.json:{ "mcpServers": { "zulip": { "command": "uv", "args": ["run", "python", "-m", "zulipmcp.mcp"] } } } -
Restart your MCP client. The Zulip tools should now be available.
Requirements
- Python >=3.10, managed with uv
- A
.zuliprcfile for Zulip API auth (see Quickstart) - For listener mode: the selected backend CLI installed and authenticated (
claudeby default,codexwith--backend codex, oropencodewith--backend opencode)
Entry Points
| Entry Point | Description |
|---|---|
uv run python -m zulipmcp.mcp |
MCP server for Claude Code, Codex, and other MCP clients |
uv run python -m zulipmcp.mcp --transport sse |
MCP server over SSE (for remote/web clients) |
uv run python -m zulipmcp.launch_agent |
Launch one MCP-backed coding session without a listener |
uv run python -m zulipmcp.listener |
Listener: watches for @mentions, spawns agent sessions |
Library Usage
zulipmcp can also be imported directly as a Python library:
import zulipmcp
# Fetch and format recent messages
messages = zulipmcp.get_messages(hours_back=24, channels=["engineering"])
print(zulipmcp.format_messages(messages))
# Send a message
zulipmcp.send_message("engineering", "general", "Hello from Python!")
# Configure MCP hooks before starting the server
zulipmcp.configure(
message_prefix=lambda: "[bot] ",
on_session_end=lambda session: print(f"Session ended in #{session.stream}"),
)
Hermes Gateway
Hermes uses the native hermes_plugin/zulip gateway
adapter instead of the subprocess listener. Each stream/topic maps to its own
persistent Hermes session, while zulipmcp remains available as the explicit
Zulip API tool layer.
- Mention the bot once to activate a topic; follow-ups do not need a mention.
- Each user message is a fresh Hermes turn with a fresh iteration budget.
- Typing, normal response delivery, status reactions, approval reactions,
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"zulip": {
"command": "uv",
"args": ["run", "python", "-m", "zulipmcp.mcp"]
}
}
}