Content
[](https://lobehub.com/mcp/ztxtxwd-open-feishu-mcp-server)
[](https://archestra.ai/mcp-catalog/ztxtxwd__open-feishu-mcp-server)
# Feishu MCP Server
[English Documentation](README.en.md)
This is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server that supports remote connections and has built-in Feishu OAuth authentication.
This project is modified from [cloudflare/ai/demos/remote-mcp-github-oauth](https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-github-oauth), replacing GitHub OAuth with Feishu OAuth.
You can deploy it to your own Cloudflare account and, after creating your own Feishu OAuth client application, have a fully functional remote MCP server. Users can log in to your MCP server via their Feishu account.
## 📋 Table of Contents
- [Differences from the Official Feishu MCP Server](#-differences-from-the-official-feishu-mcp-server)
- [Features](#-features)
- [Quick Start](#-quick-start)
- [Deployment](#-deployment)
- [Production Deployment](#production-deployment)
- [Local Development Environment](#local-development-environment)
- [Client Integration](#-client-integration)
- [Testing with Inspector](#testing-with-inspector)
- [Using Cursor](#using-cursor)
- [Using ChatWise](#using-chatwise)
- [Access Control](#-access-control)
- [Tool Development Roadmap](#-tool-development-roadmap)
- [Technical Principles](#-technical-principles)
- [Development Guide](#-development-guide)
## 🆚 Differences from the Official Feishu MCP Server
Although Feishu officially launched the MCP Server, this project has significant advantages in the following aspects:
### 🎯 Zero-Configuration Experience
- **This Project**: Users do not need to manually configure any parameters and use `user_access_token` throughout, which is automatically refreshed upon expiration.
- **Official Project**: Users need to manually configure multiple parameters, making the configuration complex.
### 🚀 Ultimate Availability Optimization
- **This Project**: Deeply optimizes tool size and structure, especially complex functions such as document creation block tools and nested block creation tools, ensuring normal use in clients such as Cursor.
- **Official Project**: Simple API to MCP tool conversion, some tools are too large, and there are availability issues in actual use.
### 🌐 Cutting-Edge Infrastructure
- Supports deployment on Cloudflare Workers, enjoying the industry's most cutting-edge edge computing infrastructure.
## ✨ Features
- 🎯 **Zero-Configuration Experience**: Users do not need to manually configure parameters, automatically manage `user_access_token` and refresh.
- 🔐 **Feishu OAuth Authentication**: Secure user authentication
- 🌐 **Remote MCP Server**: Supports multiple client connections
- 🚀 **Cloudflare Workers**: High-performance, globally distributed deployment, enjoying the industry's most cutting-edge edge computing infrastructure
- 🛠️ **Deeply Optimized Toolset**: Specifically optimized complex tools such as document creation and nested blocks to ensure normal use in various clients
- 🔧 **Local Development Support**: Easy-to-use local environment for development and testing
- ⚡ **Ultimate Availability**: Significantly improves actual usage experience and stability compared to the official MCP Server
## 🚀 Quick Start
### Prerequisites
- Node.js 18+ and npm
- Cloudflare account
- Feishu Open Platform account
### Installation
```bash
# Clone the repository
git clone <repository-url>
cd open-feishu-mcp-server
# Install dependencies
npm install
```
## 🚀 Deployment
### Production Deployment
#### Step 1: Create a Feishu Application
1. Visit [Feishu Open Platform](https://open.feishu.cn/) and log in
2. Click "Developer Console" and create a new application
3. Configure permissions in the application settings:
- Go to "Permissions & Features" and add the following permissions:
- "Get User ID" (auth:user.id:read)
- "Get User Task Information" (task:task:read)
- "Get User Authorization Credential" (offline_access)
- "Get User Basic Information" (user_profile)
...
4. Note down your **Application ID** and **Application Secret**
#### Step 2: Configure Cloudflare Environment
```bash
# Set the necessary secrets
wrangler secret put FEISHU_APP_ID
wrangler secret put FEISHU_APP_SECRET
wrangler secret put COOKIE_ENCRYPTION_KEY # Use openssl rand -hex 32 to generate
# Create KV namespace
wrangler kv namespace create "OAUTH_KV"
```
#### Step 3: Update Configuration File
Use the KV ID obtained in step 2 to update the KV namespace configuration in the `wrangler.toml` file.
#### Step 4: Deploy the Server
```bash
npm run deploy
```
After deployment, note down your actual subdomain (displayed in the deployment logs).
#### Step 5: Configure Redirect URL
Return to the Feishu application settings:
1. Go to "Security Settings"
2. Add the redirect URL: `https://feishu-mcp-server.<your-actual-subdomain>.workers.dev/callback`
### Local Development Environment
#### Configure Local Environment
1. **Configure Feishu Application**:
- In the "Security Settings" of the Feishu application, add: `http://localhost:8788/callback`
- Ensure you have the required permissions (same as production environment)
2. **Create Environment Variable File**:
Create a `.dev.vars` file in the project root directory:
```
FEISHU_APP_ID=your_development_feishu_app_id
FEISHU_APP_SECRET=your_development_feishu_app_secret
COOKIE_ENCRYPTION_KEY=any_random_string_here
```
#### Start Local Server
```bash
npm run dev
```
The server will run on `http://localhost:8788`.
## 🔌 Client Integration
### Testing with Inspector
Use the official MCP Inspector to test your server:
```bash
npx @modelcontextprotocol/inspector@latest
```
**Connection Address**:
- Production Environment: `https://feishu-mcp-server.<your-subdomain>.workers.dev/sse`
- Local Environment: `http://localhost:8788/sse`
### Using Cursor
Quickly configure with the one-click installation button:
[](https://cursor.com/install-mcp?name=feishu&config=eyJ1cmwiOiJodHRwOi8vbG9jYWxob3N0Ojg3ODgvc3NlIn0%3D)
Or configure manually:
```json
{
"mcpServers": {
"feishu": {
"url": "http://localhost:8788/sse"
}
}
}
```
### Using ChatWise
1. **Configuration Steps**:
- Open the ChatWise settings interface
- Navigate to the tool options
- Add command-line input/output (stdio)
- Command: `npx -y mcp-remote ${URL}`
2. **Connection Address**:
- Local: `http://localhost:8788/sse`
- Production: `https://feishu-mcp-server.<your-subdomain>.workers.dev/sse`
3. **First Use**:
- After saving the configuration, the Feishu OAuth login page will automatically open
- Complete the authorization to use Feishu-related functions
## 🔐 Access Control
- **Authentication**: Use Feishu OAuth for user authentication
- **Permission Scope**: All authenticated Feishu users can access all tools
## 📋 Tool Development Roadmap
### 🚧 Currently in Development (Feishu Documents)
- **🔧 Development Assistance Tools**
- ✅ Development document content search and recall
- **📄 Document Basic Operations**
- ✅ Document block tree structure acquisition
- ✅ Get block type creation parameter schema
- ✅ Create document blocks (supports various block types)
- ✅ Update document block content
- ✅ Batch delete document blocks
- **🔧 Document Advanced Features**
- ✅ Table creation and operation
- ✅ Image, video, and file upload and insertion
- ✅ Markdown import function
- ✅ Material upload and management
- ✅ Document search
### 🎯 Future Plans
- **📊 Spreadsheets (Sheets)**
- 📋 Worksheet basic operations (create, delete, rename)
- 📋 Cell data read and write
- 📋 Formula calculation and application
- 📋 Chart creation and editing
- 📋 Data filtering and sorting
- 📋 Collaboration and permission management
- **🗃️ Multi-dimensional Tables (Base/Bitable)**
- 📋 Data table basic operations
- 📋 Record CRUD
- 📋 Field type management
- 📋 View creation and configuration
- 📋 Automation rule settings
- 📋 Data import and export
...
**Legend**: ✅ Completed | 🔄 In Development | 📋 Planned
## 🛠️ Technical Principles
### Architecture Components
#### OAuth Provider
Complete OAuth 2.1 server implementation, handling:
- MCP client authentication
- Feishu OAuth service connection management
- Secure token management in KV storage
#### Durable MCP
MCP extension based on Cloudflare Durable Objects:
- Persistent state management
- Authentication context storage
- Access user information via `this.props`
- Conditional tool availability based on user identity
#### MCP Remote
Supports remote MCP client connections:
- Defines client-server communication protocol
- Provides structured tool definition methods
- Handles request/response serialization
- Maintains SSE connections
## 👨💻 Development Guide
### MCP Server (Powered by [Cloudflare Workers](https://developers.cloudflare.com/workers/))
This project implements a dual OAuth role:
* Acts as an OAuth **server** for MCP clients
* Acts as an OAuth **client** for Feishu OAuth services
### Tool Development
Current tools use user access tokens for authentication, ensuring:
- Secure access to Feishu APIs
- Feature access based on user permissions
- Complete error handling and logging
---
**📝 Note**: Ensure that all environment variables and Feishu application settings are correctly configured before deployment. If you encounter any issues, please check the Feishu application permission configuration and redirect URL settings.
## Star History
[](https://star-history.com/#ztxtxwd/open-feishu-mcp-server&Date)
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
explore-claude-code
Learn Claude Code by exploring it as it was designed - interactive IDE-style...
machi
A Web3-native AI Agent Framework.
AutoRedTeam-Orchestrator
🔥 AI-driven automated penetration testing framework | 80+ security tools |...