Skip to main content
Glama
lark-chat-mcp
by gitByEOS

lark-chat-mcp

飞书 ↔ Cursor / Claude 单会话远程聊天(v0.1.0)

你在飞书发消息,本机 Agent 通过 MCP 收到并流式回复——单群、单进程、零配置。

能做什么

方向

行为

飞书 → Agent

lark_chat_watch 收消息,自动开 ack 流式卡

Agent → 飞书

lark_chat_stream / lark_chat_progress 流式更新卡片

  • 暂不支持多群并行

Related MCP server: Claude Code Feishu Channel

如何使用

  1. 配置好mcp,会话中/mcp 确认是 Connected

  2. 输入:> 持续监听飞书群 <随便起个群名>

  3. 然后就可以远程指挥你的Claude/Cursor了

前置

  • Node.js 18+

  • lark-cli 已 auth login(user + bot 均 ready)

  • 飞书应用已订阅 im.message.receive_v1 并发布

首次接入完整步骤见 docs/how_to_work.md。

安装

npm(推荐)

以 Claude Code 为例:

# 当前项目
claude mcp add lark-chat-mcp -- npx -y @eos./lark-chat-mcp

# 全局
claude mcp add lark-chat-mcp -s user -- npx -y @eos./lark-chat-mcp

claude mcp list

Cursor / Claude Desktop 配置:

{
  "mcpServers": {
    "lark-chat-mcp": {
      "command": "npx",
      "args": ["-y", "@eos./lark-chat-mcp"]
    }
  }
}

重载 MCP 后 新开 Agent 会话,应看到 4 个工具。

源码开发

git clone https://github.com/gitByEOS/lark-chat-mcp
cd lark-chat-mcp
npm install
npm test    # 期望全部通过

本地调试时 args 用 server.mjs 绝对路径:

{
  "mcpServers": {
    "lark-chat-mcp": {
      "command": "node",
      "args": ["/绝对路径/lark-chat-mcp/server.mjs"]
    }
  }
}

MCP 工具

工具

作用

lark_chat_session

list 列群 · find 搜群 · create 建群并绑定

lark_chat_watch

阻塞等消息;timeout 时立即再调(单次最长 30s)

lark_chat_stream

流式卡片 append → close

lark_chat_progress

step 逐步汇报,done=true 关闭

单实例与事件消费

全机只能运行 一个 server.mjs:

  • 第二实例会因 ~/.lark-chat-mcp/server.lock 直接退出

  • 同进程并发 watch 返回 watch_busy

ps aux | grep server.mjs          # 应只有 1 个
lark-cli event status --json      # active_consumers 应为 1

环境变量(可选)

MCP 日常不用配。仅边缘场景:

变量

说明

LARK_PEER_OPEN_ID

群里只接收该用户(ou_xxx)的消息

Available Tools

4 tools
lark_chat_progressA

改代码时逐步汇报进度:首步 open 流式卡,后续 step 自动 append,done=true 关闭。

Inputs: step, done, stream_id, reply_to, +2 more.

lark_chat_sessionC

飞书单会话:list 列群 · find 按名搜 · create 自定义群名建群并绑定。

Inputs: action (required), name, query.

lark_chat_streamB

飞书 CardKit 流式卡片:append 累积更新 → close 终态。watch 已开卡时用返回的 stream_id。

Inputs: action (required), text, stream_id, reply_to, +1 more.

lark_chat_watchA

阻塞等待飞书用户新消息(单群)。 先 session(create/find) 拿 chat_id,或 watch(chat_id=oc_xxx) 绑定。 收到后自动开流式卡,timeout 时立即再 watch(单次最长 30s poll)。 探活:clear=true, timeout_ms=1000,响应额外含 guide。

Inputs: timeout_ms, clear, chat_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 4 tools

    Disambiguation3/5

    Tools have distinct names but functional overlap: lark_chat_progress and lark_chat_stream both involve streaming card updates, and lark_chat_watch also opens a streaming card on receiving messages. This could cause confusion for an agent selecting a tool for card operations.

    Naming Consistency5/5

    All tools follow a consistent 'lark_chat_<noun>' pattern in snake_case, making them predictable and easy to distinguish by name alone.

    Tool Count4/5

    With 4 tools, the set is slightly small but covers the essential functions of session management, progress updates, streaming cards, and message watching, which is reasonable for a focused chat integration.

    Completeness3/5

    The tool surface lacks basic messaging operations like sending plain text or media, and there is no explicit delete or edit. While progress and stream cover some updates, there are notable gaps for a general chat server.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers