Back to Skills

mcp-feishu

verified

当用户提供飞书 MCP URL 并请求配置时触发。自动同时配置到 Claude Code 和 Cursor,简化团队成员的环境设置流程。

View on GitHub

Marketplace

taptap-plugins

taptap/claude-plugins-marketplace

Plugin

sync

productivity

Repository

taptap/claude-plugins-marketplace
1stars

plugins/sync/skills/mcp-feishu/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/taptap/claude-plugins-marketplace/blob/main/plugins/sync/skills/mcp-feishu/SKILL.md -a claude-code --skill mcp-feishu

Installation paths:

Claude
.claude/skills/mcp-feishu/
Powered by add-skill CLI

Instructions

# 飞书 MCP 配置辅助

当用户提供飞书 MCP URL 并请求配置时,自动应用此 skill,**同时配置到 Claude Code 和 Cursor**。

## 触发场景

用户消息同时满足以下条件时触发:
1. 包含飞书 MCP URL(`https://open.feishu.cn/mcp/stream/mcp_xxxxx`)
2. 包含配置相关关键词:
   - 「配置」「设置」「添加」「同步」
   - 「MCP」「飞书 MCP」
   - 「setup」「config」「add」「sync」

## 核心原则

⚠️ **强制要求:必须完成两个任务**

此 skill 的目标是同时配置 Claude Code 和 Cursor。**只有两个任务都成功完成才算真正完成。**

**任务清单:**
1. ✅ 配置 Claude Code (`~/.claude.json`)
2. ✅ 配置 Cursor (`~/.cursor/mcp.json`)

**如果任一任务失败,必须:**
- 明确告知用户哪个任务失败
- 提供具体的错误信息和解决方案
- 不能只完成一个任务就结束

## 执行流程

### 阶段 0:准备工作

**0.1 提取 URL**

从用户消息中提取飞书 MCP URL:
```regex
https://open\.feishu\.cn/mcp/stream/mcp_[A-Za-z0-9_-]+
```

如果未找到有效 URL,提示用户提供正确格式的 URL 并终止流程。

**0.2 创建任务清单**

使用 TodoWrite 创建任务清单:
```
- 配置 Claude Code
- 配置 Cursor
```

### 阶段 1:配置 Claude Code

**1.1 检查现有配置**

执行命令:
```bash
claude mcp get feishu-mcp
```

**判断逻辑:**
- 输出包含 `Status: ✓ Connected` → 已配置,跳至 1.4
- 输出包含 `No MCP server found` 或错误 → 需要配置,继续 1.2

**1.2 添加配置**

执行命令:
```bash
claude mcp add --transport http feishu-mcp "<提取的 URL>"
```

**1.3 验证配置**

执行命令:
```bash
claude mcp get feishu-mcp
```

**验证标准:**
- ✅ 输出包含 `Status: ✓ Connected`
- ✅ 输出包含 `Type: http`
- ✅ 输出包含正确的 URL

如果验证失败,记录错误并继续执行 Cursor 配置(不要因为一个失败就放弃另一个)。

**1.4 更新任务清单**

使用 TodoWrite 标记 "配置 Claude Code" 为 completed。

### 阶段 2:配置 Cursor

**2.1 检查配置文件**

使用 Read 工具读取 `~/.cursor/mcp.json`。

**判断逻辑:**
- 文件不存在 → 需要创建,跳至 2.2
- 文件存在 → 检查内容,跳至 2.3

**2.2 创建配置文件**

使用 Write 工具创建 `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "feishu-mcp": {
      "type": "http",
      "url": "<提取的 URL>"
    }
  }
}
```

完成后跳至 2.4。

**2.3 更新现有配置**

**情况 A:文件存在但 mcpServers 为空或没有 feishu-mcp**

使用 Edit 工具添加 `feishu-mcp` 配置:

```json
{
  "mcpServers": {
    "feishu-mcp": {
      "type": "http",
      "url": "<提取的 URL>"
    }
  }
}
```

**情况 B:文件存在且已有 feishu-mcp**

检查 URL 是否与新 URL 一致:
- 一致 → 已配置,无需修改,跳至 2.4
- 不一致 → 询问用户是否覆盖:
  - 用户确认 → 使用 Edit 工具更新 URL
  - 用户拒绝 → 保持原配置,跳至 2.4

**情况 C:文件存在且已有其他 MCP 配置**

使用 Edit 工具在 `mcpServers` 中添加 `feishu-mcp`,保持其他配置不变:

```j

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4125 chars