npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dasaying/feishu-doc-mcp

v1.1.1

Published

飞书云文档 MCP 服务器 - 支持 Markdown 文档上传、读取和批量操作。Feishu (Lark) Document MCP Server - Support Markdown upload, read and batch operations.

Downloads

318

Readme

@dasaying/feishu-doc-mcp

飞书云文档 MCP 服务器 - 支持 Markdown 文档上传、读取和批量操作

npm version License MCP

English | 中文


中文

简介

feishu-doc-mcp 是一个功能完整的 Model Context Protocol (MCP) 服务器,专门用于飞书(Lark)云文档集成。它提供了强大的 Markdown 文档上传、读取和批量操作功能,让你可以轻松地在 AI 工作流中管理飞书文档。

核心功能

📤 文档上传

  • ✅ 单个 Markdown 文档上传
  • ✅ 批量文档上传(支持并发控制)
  • ✅ 自动转换 Markdown 为飞书格式
  • ✅ 自动上传本地图片和附件
  • ✅ Front Matter 处理
  • ✅ 支持云空间和知识库

📥 文档读取

  • ✅ 读取单个文档并转换为 Markdown
  • ✅ 批量读取多个文档
  • ✅ 递归读取整个知识库
  • ✅ 自动下载图片和附件
  • ✅ 保持文档结构和格式

🔐 认证管理

  • ✅ 完整的 OAuth 2.0 流程
  • ✅ 自动 token 刷新
  • ✅ 多应用支持
  • ✅ 安全的凭证存储

📁 资源管理

  • ✅ 列出云空间文件夹
  • ✅ 列出知识库空间
  • ✅ 浏览知识库节点
  • ✅ 获取用户信息

快速开始

使用 npx(推荐)

无需安装,直接使用:

{
  "mcpServers": {
    "@dasaying/feishu-doc-mcp": {
      "command": "npx",
      "args": ["-y", "@dasaying/feishu-doc-mcp"],
      "env": {
        "FEISHU_DEFAULT_APP_ID": "your_app_id",
        "FEISHU_DEFAULT_APP_SECRET": "your_app_secret",
        "FEISHU_OAUTH_CALLBACK_URL": "http://localhost:3010/oauth/feishu/callback"
      }
    }
  }
}

全局安装

npm install -g @dasaying/feishu-doc-mcp

配置 MCP 客户端:

{
  "mcpServers": {
    "@dasaying/feishu-doc-mcp": {
      "command": "@dasaying/feishu-doc-mcp",
      "args": [],
      "env": {
        "FEISHU_DEFAULT_APP_ID": "your_app_id",
        "FEISHU_DEFAULT_APP_SECRET": "your_app_secret",
        "FEISHU_OAUTH_CALLBACK_URL": "http://localhost:3010/oauth/feishu/callback"
      }
    }
  }
}

配置说明

必需环境变量

| 变量 | 说明 | 示例 | |------|------|------| | FEISHU_DEFAULT_APP_ID | 飞书应用 ID | cli_a9e211f948381bdf | | FEISHU_DEFAULT_APP_SECRET | 飞书应用密钥 | your_app_secret | | FEISHU_OAUTH_CALLBACK_URL | OAuth 回调地址 | http://localhost:3010/oauth/feishu/callback |

可选环境变量

| 变量 | 说明 | 默认值 | |------|------|--------| | MCP_LOG_LEVEL | 日志级别 | debug | | STORAGE_PROVIDER_TYPE | 存储类型 | filesystem | | STORAGE_FILESYSTEM_PATH | 存储路径 | ~/.feishu-doc-mcp/storage |

可用工具

认证相关

  • feishu_auth_url - 生成授权 URL
  • feishu_auth_callback - 处理授权回调
  • feishu_get_user_info - 获取用户信息
  • feishu_list_apps - 列出已配置的应用
  • feishu_set_default_app - 设置默认应用

文档上传

  • feishu_upload_markdown - 上传单个 Markdown 文档
  • feishu_batch_upload_markdown - 批量上传文档
  • feishu_update_document - 更新已存在的文档

文档读取

  • feishu_read_document - 读取单个文档
  • feishu_batch_read_documents - 批量读取文档
  • feishu_read_wiki_recursive - 递归读取知识库

资源浏览

  • feishu_list_folders - 列出云空间文件夹
  • feishu_list_wikis - 列出知识库空间
  • feishu_list_wiki_nodes - 列出知识库节点

使用示例

1. 授权飞书账号

// 生成授权 URL
const { authUrl } = await mcp.call('feishu_auth_url');
// 在浏览器中打开 authUrl 完成授权

2. 上传 Markdown 文档

// 上传到知识库
await mcp.call('feishu_upload_markdown', {
  filePath: './docs/README.md',
  targetType: 'wiki',
  targetId: 'wiki_space_id',
  uploadImages: true,
  uploadAttachments: true
});

3. 读取文档

// 读取文档并保存为 Markdown
await mcp.call('feishu_read_document', {
  documentId: 'doc_id',
  documentType: 'wiki',
  wikiSpaceId: 'space_id',
  outputPath: './output/document.md',
  downloadImages: true
});

4. 批量操作

// 批量上传
await mcp.call('feishu_batch_upload_markdown', {
  documents: [
    { filePath: './doc1.md', targetType: 'wiki', targetId: 'space_id' },
    { filePath: './doc2.md', targetType: 'wiki', targetId: 'space_id' }
  ],
  concurrency: 3
});

// 递归读取知识库
await mcp.call('feishu_read_wiki_recursive', {
  wikiSpaceId: 'space_id',
  outputPath: './output',
  downloadImages: true,
  preserveStructure: true
});

飞书应用配置

  1. 访问 飞书开放平台
  2. 创建企业自建应用
  3. 配置应用权限:
    • drive:drive - 云空间操作
    • wiki:wiki - 知识库操作
    • contact:user.base - 用户信息
  4. 配置 OAuth 回调地址:http://localhost:3010/oauth/feishu/callback
  5. 获取 App ID 和 App Secret

开发

# 克隆仓库
git clone https://github.com/yourusername/feishu-doc-mcp.git
cd feishu-doc-mcp

# 安装依赖
npm install

# 构建
npm run build

# 本地测试
npm link
feishu-doc-mcp

技术栈

  • TypeScript - 类型安全
  • MCP SDK - Model Context Protocol
  • Hono - 轻量级 Web 框架
  • tsyringe - 依赖注入
  • Zod - 运行时验证
  • Pino - 结构化日志

许可证

Apache-2.0


English

Introduction

feishu-doc-mcp is a full-featured Model Context Protocol (MCP) server specifically designed for Feishu (Lark) document integration. It provides powerful Markdown document upload, read, and batch operation capabilities, making it easy to manage Feishu documents in AI workflows.

Core Features

📤 Document Upload

  • ✅ Single Markdown document upload
  • ✅ Batch document upload (with concurrency control)
  • ✅ Automatic Markdown to Feishu format conversion
  • ✅ Automatic local image and attachment upload
  • ✅ Front Matter processing
  • ✅ Support for Drive and Wiki

📥 Document Read

  • ✅ Read single document and convert to Markdown
  • ✅ Batch read multiple documents
  • ✅ Recursively read entire wiki space
  • ✅ Automatic image and attachment download
  • ✅ Preserve document structure and formatting

🔐 Authentication

  • ✅ Complete OAuth 2.0 flow
  • ✅ Automatic token refresh
  • ✅ Multi-app support
  • ✅ Secure credential storage

📁 Resource Management

  • ✅ List Drive folders
  • ✅ List Wiki spaces
  • ✅ Browse Wiki nodes
  • ✅ Get user information

Quick Start

Using npx (Recommended)

No installation required:

{
  "mcpServers": {
    "@dasaying/feishu-doc-mcp": {
      "command": "npx",
      "args": ["-y", "@dasaying/feishu-doc-mcp"],
      "env": {
        "FEISHU_DEFAULT_APP_ID": "your_app_id",
        "FEISHU_DEFAULT_APP_SECRET": "your_app_secret",
        "FEISHU_OAUTH_CALLBACK_URL": "http://localhost:3010/oauth/feishu/callback"
      }
    }
  }
}

Global Installation

npm install -g @dasaying/feishu-doc-mcp

Configure MCP client:

{
  "mcpServers": {
    "@dasaying/feishu-doc-mcp": {
      "command": "@dasaying/feishu-doc-mcp",
      "args": [],
      "env": {
        "FEISHU_DEFAULT_APP_ID": "your_app_id",
        "FEISHU_DEFAULT_APP_SECRET": "your_app_secret",
        "FEISHU_OAUTH_CALLBACK_URL": "http://localhost:3010/oauth/feishu/callback"
      }
    }
  }
}

Available Tools

See Chinese section above for detailed tool list.

License

Apache-2.0