feishu-mcp 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md DELETED
@@ -1,201 +0,0 @@
1
- # Feishu MCP Server
2
-
3
- Provides access to Feishu (Lark) documents for [Cursor](https://cursor.sh/), [Windsurf](https://codeium.com/windsurf), [Cline](https://cline.bot/), and other AI-driven coding tools, implemented based on the [Model Context Protocol](https://modelcontextprotocol.io/introduction) server.
4
-
5
- When Cursor can access Feishu document data, it can understand and process document content more accurately, making it more efficient than other methods (such as copying and pasting text).
6
-
7
- ## Core Features
8
-
9
- ### Document Management
10
- - **Create Feishu Documents**: Support for creating new Feishu documents in specified folders
11
- - **Folder Management**:
12
- - Get root folder information
13
- - View folder contents and file lists
14
- - Create new folders
15
-
16
- ### Document Content Operations
17
- - **Get Document Information**:
18
- - Get basic document information (title, version, etc.)
19
- - Get document block structure and hierarchy
20
- - Get detailed content of specific blocks
21
- - **Get Document Plain Text Content**: Support for extracting complete plain text content from documents for analysis and processing
22
- - **Edit Document Content**:
23
- - **Text Block Operations**:
24
- - Create and update text blocks with rich styles (bold, italic, underline, strikethrough, inline code)
25
- - Support for text color settings (gray, brown, orange, yellow, green, blue, purple)
26
- - Support for text alignment adjustment (left-aligned, centered, right-aligned)
27
- - **Heading Block Operations**: Create headings from level one to level nine
28
- - **Code Block Operations**:
29
- - Create code blocks for multiple programming languages
30
- - Support for code syntax highlighting
31
- - Support for automatic line wrapping settings
32
- - **List Operations**:
33
- - Create ordered lists (numbered lists)
34
- - Create unordered lists (bullet point lists)
35
- - **Block Management Operations**:
36
- - Batch content creation: Support for creating multiple different types of content blocks in a single operation
37
- - Delete document blocks: Support for deleting one or more consecutive document blocks
38
- - **Wiki Document Support**:
39
- - Convert Feishu Wiki links to compatible document IDs for use with other document operation tools
40
- - **Image Resource Processing**:
41
- - Download images from Feishu using media IDs
42
-
43
- ### Planned Features
44
- - **Advanced Content Insertion**:
45
- - Table insertion: Support for row and column structured data
46
- - Insert charts: Support for various data visualization charts
47
- - Insert flowcharts: Support for flowcharts and mind maps
48
- - Insert formulas: Support for mathematical formulas and scientific symbols
49
- - Recognition and parsing of charts and flowcharts
50
-
51
- Quick start, see the [Configuration](#configuration) section for details:
52
-
53
- ```bash
54
- npx feishu-mcp --feishu-app-id=<YOUR_FEISHU_APP_ID> --feishu-app-secret=<YOUR_FEISHU_APP_SECRET>
55
- ```
56
-
57
- ## How It Works
58
-
59
- 1. Open the editor in Cursor's Agent mode.
60
- 2. Paste a Feishu document link.
61
- 3. Ask Cursor to perform operations based on the Feishu document—for example, analyze document content or create related code.
62
- 4. Cursor will retrieve relevant metadata from Feishu and use it to assist in writing code.
63
-
64
- This MCP server is designed specifically for Cursor. Before responding with content from the [Feishu API](https://open.feishu.cn/document/home/introduction-to-lark-open-platform/overview), it simplifies and transforms the responses, ensuring that only the most relevant document information is provided to the model.
65
-
66
- ## Installation
67
-
68
- ### Quickly Run the Server Using NPM
69
-
70
- You can quickly run the server using NPM without installing or building the repository:
71
-
72
- ```bash
73
- npx feishu-mcp --feishu-app-id=<YOUR_FEISHU_APP_ID> --feishu-app-secret=<YOUR_FEISHU_APP_SECRET>
74
-
75
- # or
76
- pnpx feishu-mcp --feishu-app-id=<YOUR_FEISHU_APP_ID> --feishu-app-secret=<YOUR_FEISHU_APP_SECRET>
77
-
78
- # or
79
- yarn dlx feishu-mcp --feishu-app-id=<YOUR_FEISHU_APP_ID> --feishu-app-secret=<YOUR_FEISHU_APP_SECRET>
80
-
81
- # or
82
- bunx feishu-mcp --feishu-app-id=<YOUR_FEISHU_APP_ID> --feishu-app-secret=<YOUR_FEISHU_APP_SECRET>
83
- ```
84
-
85
- **Published to the Smithery platform, available at: https://smithery.ai/server/@cso1z/feishu-mcp**
86
-
87
- Instructions on how to create a Feishu application and obtain application credentials can be found in the [official tutorial](https://open.feishu.cn/document/home/develop-a-bot-in-5-minutes/create-an-app).
88
-
89
- **Detailed Feishu application configuration steps**: For detailed guidance on registering a Feishu application, configuring permissions, and adding document access permissions, please refer to [Step-by-step tutorial FEISHU_CONFIG.md](FEISHU_CONFIG.md).
90
-
91
- ### JSON Configuration for Tools Using Configuration Files
92
-
93
- Many tools such as Windsurf, Cline, and [Claude Desktop](https://claude.ai/download) use configuration files to start servers.
94
-
95
- The `feishu-mcp` server can be configured by adding the following to the configuration file:
96
-
97
- ```json
98
- {
99
- "mcpServers": {
100
- "feishu-mcp": {
101
- "command": "npx",
102
- "args": ["-y", "feishu-mcp", "--stdio"],
103
- "env": {
104
- "FEISHU_APP_ID": "<YOUR_FEISHU_APP_ID>",
105
- "FEISHU_APP_SECRET": "<YOUR_FEISHU_APP_SECRET>"
106
- }
107
- }
108
- }
109
- }
110
- ```
111
-
112
- ### Run the Server from Local Source Code
113
-
114
- 1. Clone the repository
115
- 2. Install dependencies using `pnpm install`
116
- 3. Copy `.env.example` to `.env` and fill in your [Feishu application credentials](https://open.feishu.cn/document/home/develop-a-bot-in-5-minutes/create-an-app).
117
- 4. Run the server using `pnpm run dev`, with any flags from the [Command Line Arguments](#command-line-arguments) section.
118
-
119
- ### Run the Server Using Docker
120
-
121
- You can use Docker to run the server, which avoids installing Node.js and other dependencies locally:
122
-
123
- 1. Build the Docker image:
124
- ```bash
125
- docker build -t feishu-mcp .
126
- ```
127
-
128
- 2. Run the Docker container:
129
- ```bash
130
- docker run -p 3333:3333 --env FEISHU_APP_ID=<YOUR_FEISHU_APP_ID> --env FEISHU_APP_SECRET=<YOUR_FEISHU_APP_SECRET> feishu-mcp
131
- ```
132
-
133
- Alternatively, you can use docker-compose:
134
-
135
- 1. Edit the `.env` file and add your Feishu application credentials:
136
- ```
137
- FEISHU_APP_ID=<YOUR_FEISHU_APP_ID>
138
- FEISHU_APP_SECRET=<YOUR_FEISHU_APP_SECRET>
139
- ```
140
-
141
- 2. Run docker-compose:
142
- ```bash
143
- docker-compose up -d
144
- ```
145
-
146
- This will start the server in the background and expose it on port 3333.
147
-
148
- ## Configuration
149
-
150
- The server can be configured using environment variables (via the `.env` file) or command line arguments. Command line arguments take precedence over environment variables.
151
-
152
- ### Environment Variables
153
-
154
- - `FEISHU_APP_ID`: Your [Feishu application ID](https://open.feishu.cn/document/home/develop-a-bot-in-5-minutes/create-an-app) (required)
155
- - `FEISHU_APP_SECRET`: Your [Feishu application secret](https://open.feishu.cn/document/home/develop-a-bot-in-5-minutes/create-an-app) (required)
156
- - `PORT`: The port to run the server on (default: 3333)
157
-
158
- ### Command Line Arguments
159
-
160
- - `--version`: Show version number
161
- - `--feishu-app-id`: Your Feishu application ID
162
- - `--feishu-app-secret`: Your Feishu application secret
163
- - `--port`: The port to run the server on
164
- - `--stdio`: Run the server in command mode instead of the default HTTP/SSE
165
- - `--help`: Show help menu
166
-
167
- ## Connecting to Cursor
168
-
169
- ### Configuring Cursor
170
-
171
- 1. Open Cursor settings
172
- 2. Navigate to `Settings > AI > MCP Servers`
173
- 3. Add a new server with the URL `http://localhost:3333` (or your configured port)
174
- 4. Click "Verify Connection" to ensure the connection is successful
175
-
176
- ## Usage
177
-
178
- 1. In Cursor, open the AI panel (default shortcut `Cmd+K` or `Ctrl+K`)
179
- 2. If you need to create a new Feishu document, you should explicitly specify a folderToken, which you can find by opening a Feishu document directory like: `https://vq5xxxxx7bc.feishu.cn/drive/folder/FPKvfjdxxxxx706RnOc`
180
- 3. If you need to modify Feishu document content, you should explicitly provide the Feishu document link, for example: `https://vq5ixxxx7bc.feishu.cn/docx/J6T0d6exxxxxxxDdc1zqwnph`
181
- 4. Ask questions about the document or request operations based on the document content
182
- 5. Creating and editing documents requires permissions, and you can test your account on the Feishu open platform: `https://open.feishu.cn/api-explorer/cli_a75a8ca0ac79100c?apiName=tenant_access_token_internal&from=op_doc&project=auth&resource=auth&version=v3`
183
-
184
- ## Document Permissions and Troubleshooting
185
-
186
- ### Permission Types
187
- Permissions are divided into two types: robot permissions and document access permissions.
188
-
189
- ### Permission Verification and Troubleshooting
190
- 1. Get token: [https://open.feishu.cn/api-explorer/cli_a7582508c93ad00d?apiName=tenant_access_token_internal&project=auth&resource=auth&version=v3](https://open.feishu.cn/api-explorer/cli_a7582508c93ad00d?apiName=tenant_access_token_internal&project=auth&resource=auth&version=v3)
191
- 2. Using the token obtained in step 1, verify whether you have permission to access the document: [https://open.feishu.cn/api-explorer/cli_a7582508c93ad00d?apiName=get&project=docx&resource=document&version=v1](https://open.feishu.cn/api-explorer/cli_a7582508c93ad00d?apiName=get&project=docx&resource=document&version=v1)
192
-
193
- ### Troubleshooting Method
194
- Test permissions normally on the Feishu development platform (when debugging on the open platform, there will be sufficient prompt information and guidance in case of failure).
195
-
196
- ### Document Authorization
197
- If you encounter permission issues, please refer to [Cloud Document FAQ](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN), [Knowledge Base FAQ](https://open.feishu.cn/document/server-docs/docs/wiki-v2/wiki-qa), especially focusing on how to grant document permissions to applications or users.
198
-
199
- ## License
200
-
201
- MIT