Happycapy Feishu logo

Happycapy Feishu

Community
happycapy-ai
happycapy-feishu

为 HappyCapy 安装并授权飞书(Lark)MCP,让 Claude 直接操作飞书消息、文档、多维表格、日历等。当用户提到安装飞书 MCP、配置飞书、接入飞书、飞书 MCP setup、connect feishu/lark、飞书重新授权、飞书 token 过期、lark mcp 失效等场景时,必须使用此 skill。

Overview

Publisherhappycapy-ai
RepositoryHappycapy-skills
Skill namehappycapy-feishu
Stars
138
Forks
30
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by happycapy-ai on GitHub. Read the source before you install it.

Installation

Install the Happycapy Feishu AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/happycapy-ai/Happycapy-skills.git /tmp/Happycapy-skills
mkdir -p .claude/skills
cp -r /tmp/Happycapy-skills/skills/happycapy-feishu .claude/skills/happycapy-feishu
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Happycapy Feishu in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Happycapy Feishu on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Happycapy Feishu is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

飞书 MCP 安装向导

首先询问用户: 你是否已经有飞书应用的 App IDApp Secret

  • 有的话:直接告知你,Claude 立即进入第二步执行安装和 OAuth 授权。
  • 没有的话:按第一步引导用户创建应用。

第一步:引导用户创建飞书应用(仅在用户没有凭证时执行)

告知用户按以下步骤操作,完成后把 App IDApp Secret 发给你:

  1. 打开 https://open.feishu.cn/app 并登录
  2. 右上角点击创建应用自建应用,填写任意名称(如 Claude MCP
  3. 进入应用后,凭证与基础信息页面找到 App IDApp Secret
  4. 左侧菜单进入安全设置重定向 URL → 添加:http://localhost:3000/callback
  5. 左侧菜单进入权限管理 → 右上角点击批量导入权限 → 粘贴以下 JSON 后确认导入:

重要: 每次引导用户时,必须读取 assets/feishu-permissions.json 并将其完整内容全量输出,不得省略、截断或用省略号代替任何内容。

  1. 左侧菜单进入添加应用能力 → 务必开启 机器人 能力

  2. 左侧菜单进入事件与回调事件配置

    • 请求方式选择:使用长连接接收事件(无需公网服务器)
    • 点击添加事件,搜索 im.message.receive_v1(接收消息),勾选添加
  3. 左侧菜单进入版本管理与发布,创建版本并发布(内部测试版即可)


第二步:自动安装配置(收到凭证后 Claude 执行)

2.1 注册 MCP 到全局配置

直接编辑 ~/.claude.json,向其中写入 mcpServers 字段(保留已有内容):

bash
python3 -c "
import json, os
f = os.path.expanduser('~/.claude.json')
with open(f) as fp:
    cfg = json.load(fp)
cfg.setdefault('mcpServers', {})['lark-mcp'] = {
    'command': 'npx',
    'args': ['-y', '@larksuiteoapi/lark-mcp', 'mcp',
             '-a', '<APP_ID>', '-s', '<APP_SECRET>',
             '--oauth',
             '--tools', 'preset.default,im.v1.message.reply,im.v1.message.get,im.v1.message.patch,im.v1.message.delete,im.v1.chat.get,im.v1.chat.search']
}
with open(f, 'w') as fp:
    json.dump(cfg, fp, indent=2, ensure_ascii=False)
print('MCP 注册完成')
"

2.2 定位 lark-mcp 缓存目录(后续步骤共用)

无桌面 Linux 环境中 keytar 依赖 dbus-launch,导致 token 只存内存、重启即丢失。先触发下载并定位目录:

bash
# 触发一次确保包已下载
npx -y @larksuiteoapi/lark-mcp --version 2>/dev/null || true

# 定位缓存目录,后续 2.3 和 2.4 共用此变量
LARK_DIR=$(find ~/.npm/_npx -name "package.json" 2>/dev/null \
  | xargs grep -l '"@larksuiteoapi/lark-mcp"' 2>/dev/null \
  | grep -v node_modules | head -1 | xargs dirname)
echo "LARK_DIR: $LARK_DIR"

2.3 修复 headless 环境 token 持久化(替换 keytar 为文件存储)

使用 skill 内置的预置文件替换 keytar(token 保存在 ~/.lark-mcp-keychain.json):

bash
KEYTAR_PATH="$LARK_DIR/node_modules/keytar/lib/keytar.js"
cp "$KEYTAR_PATH" "${KEYTAR_PATH}.bak"
cp ~/.claude/skills/happycapy-feishu/assets/keytar-file-storage.js "$KEYTAR_PATH"
echo "keytar 替换完成: $KEYTAR_PATH"

2.4 延长 OAuth 超时至 5 分钟

lark-mcp 有两处独立超时需要同时修改,必须用 perl -i 而非 sed -i(后者在此环境会截断文件):

bash
# 修复 handler-local.js(HTTP 服务器超时)
HANDLER="$LARK_DIR/node_modules/@larksuiteoapi/lark-mcp/dist/auth/handler/handler-local.js"
perl -i -pe 's/this\.stopServer\(\), 60 \* 1000/this.stopServer(), 300 * 1000/g' "$HANDLER"

# 修复 login-handler.js(token 轮询超时)
LOGIN_HANDLER="$LARK_DIR/node_modules/@larksuiteoapi/lark-mcp/dist/cli/login-handler.js"
perl -i -pe 's/timeout = 60000/timeout = 300000/g' "$LOGIN_HANDLER"

echo "handler-local: $(grep -o '[0-9]* \* 1000' $HANDLER)"
echo "login-handler: $(grep -o 'timeout = [0-9]*' $LOGIN_HANDLER)"

第三步:OAuth 授权(用户只需做一个操作)

3.1 启动 login 进程,获取 code_challenge

bash
kill $(lsof -ti:3000) 2>/dev/null; sleep 1
nohup npx -y @larksuiteoapi/lark-mcp login \
  -a <APP_ID> -s <APP_SECRET> > /tmp/lark-oauth.log 2>&1 &
sleep 5 && cat /tmp/lark-oauth.log

从日志的 Authorization URL 中提取 code_challenge= 后面的值。

3.2 服务端 curl /authorize(必须执行,存储 PKCE 状态)

跳过此步会导致 callback 时报错 PKCE validation failed: code challenge not found

bash
FEISHU_URL=$(curl -s -w "%{redirect_url}" -o /dev/null \
  "http://localhost:3000/authorize?client_id=client_id_for_local_auth&response_type=code&code_challenge=<CODE_CHALLENGE>&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fcallback&state=reauthorize")
echo "$FEISHU_URL"

3.3 让用户完成授权

把上一步输出的 https://open.feishu.cn/... 链接发给用户,明确告知以下三点

第一步: 在浏览器打开上面的链接,用飞书账号登录并点击授权。

第二步: 授权完成后,浏览器会自动跳转到一个以 http://localhost:3000/callback?code=... 开头的地址,并显示"无法访问此网站"或"连接被拒绝"的错误页面——这是完全正常的,不要关闭页面。

第三步: 忽略错误提示,直接复制浏览器地址栏的完整 URL(以 http://localhost:3000/callback 开头),粘贴发给我。

3.4 收到 callback URL 后立即提交

bash
curl -s "<用户发来的完整 URL>"
# 返回 "success, you can close this page now" 即成功

3.5 验证

bash
npx -y @larksuiteoapi/lark-mcp whoami

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Happycapy Feishu AI skill do?

为 HappyCapy 安装并授权飞书(Lark)MCP,让 Claude 直接操作飞书消息、文档、多维表格、日历等。当用户提到安装飞书 MCP、配置飞书、接入飞书、飞书 MCP setup、connect feishu/lark、飞书重新授权、飞书 token 过期、lark mcp 失效等场景时,必须使用此 skill。

Why use Happycapy Feishu on TypingMind?

Because you install it once and use it with any model. Happycapy Feishu is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Happycapy Feishu in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/happycapy-ai/Happycapy-skills/tree/main/skills/happycapy-feishu. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Happycapy Feishu?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Happycapy Feishu?

As many as you like. As long as a model supports skills, you can use Happycapy Feishu with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Happycapy Feishu AI skill free?

Yes. It is published on GitHub by happycapy-ai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇