feishu_mcp_create_doc
Call
via MCP to create a new Feishu Cloud Document from Lark-flavored Markdown content.
Return Value
After successful execution of the tool, a JSON object is returned containing the following fields:
- (string): Unique identifier (token) of the document, formatted like
- (string): Access link of the document, which can be opened directly in a browser, formatted like
https://www.feishu.cn/docx/doxcnXXXXXXXXXXXXXXXXXXX
- (string): Operation result message, e.g., "Document created successfully"
Parameters
markdown (required)
Markdown content of the document, using Lark-flavored Markdown format.
The markdown content used to call this tool should be as structurally clear, stylistically rich, and highly readable as possible. Use callout highlight blocks, columns, tables, etc., appropriately, and make use of image insertion and Mermaid capabilities to achieve a combination of text and images..
You need to follow these principles:
- Clear Structure: Title levels ≤ 4, use Callout to highlight key information
- Visual Rhythm: Use dividers, columns, and tables to break up large blocks of plain text
- Text-Image Integration: Prioritize visualization of processes and architectures using Mermaid/PlantUML
- Restrained White Space: Do not overuse Callout, only bold core terms for emphasis
When users have clear style and format requirements, those requirements shall take precedence!!
Important Notes:
- Duplicate Titles Prohibited: Do not write a level 1 title in the markdown content that is the same as the title parameter! The title parameter already serves as the document title, so the markdown should start directly with the body content
- Table of Contents: Automatically generated by Feishu, no need to add manually
- Markdown syntax must comply with Lark-flavored Markdown specifications, see the "Content Format" section below
- When creating longer documents, it is strongly recommended to use the append mode in update-doc for segmented creation to improve success rate.
title (optional)
Title of the document.
folder_token (optional)
Token of the parent folder. If not provided, the document will be created in the root directory of the user's personal space.
folder_token can be obtained from the Feishu folder URL, formatted like:
https://xxx.feishu.cn/drive/folder/fldcnXXXX
, where
is the folder_token.
wiki_node (optional)
Token or URL of the knowledge base node (optional; if provided, the document will be created under this node, mutually exclusive with folder_token and wiki_space)
wiki_node can be obtained from the Feishu knowledge base page URL, formatted like:
https://xxx.feishu.cn/wiki/wikcnXXXX
, where
is the wiki_node token.
wiki_space (optional)
Knowledge space ID (optional; if provided, the document will be created in the root directory of this space. The special value
refers to the user's personal knowledge base. Mutually exclusive with wiki_node and folder_token)
wiki_space can be obtained from the knowledge space settings page URL, formatted like:
https://xxx.feishu.cn/wiki/settings/7448000000000009300
, where
is the wiki_space ID.
Parameter Priority: wiki_node > wiki_space > folder_token
Examples
Example 1: Create a Simple Document
json
{
"title": "Project Plan",
"markdown": "# Project Overview\n\nThis is a new project.\n\n## Objectives\n\n- Objective 1\n- Objective 2"
}
Example 2: Create in a Specified Folder
json
{
"title": "Meeting Minutes",
"folder_token": "fldcnXXXXXXXXXXXXXXXXXXXXXX",
"markdown": "# Weekly Meeting 2025-01-15\n\n## Discussion Topics\n\n1. Project Progress\n2. Next Week's Plan"
}
Example 3: Use Feishu Extended Syntax
Use Feishu-specific features like highlight blocks, tables, etc.:
json
{
"title": "Product Requirements",
"markdown": "<callout emoji=\"💡\" background-color=\"light-blue\">\nImportant Requirement Notes\n</callout>\n\n## Feature List\n\n<lark-table header-row=\"true\">\n| Feature | Priority |\n|------|--------|\n| Login | P0 |\n| Export | P1 |\n</lark-table>"
}
Example 4: Create Under a Knowledge Base Node
json
{
"title": "Technical Documentation",
"wiki_node": "wikcnXXXXXXXXXXXXXXXXXXXXXX",
"markdown": "# API Interface Description\n\nThis is a knowledge base document."
}
Example 5: Create in the Root Directory of a Knowledge Space
json
{
"title": "Project Overview",
"wiki_space": "7448000000000009300",
"markdown": "# Project Overview\n\nThis is a level 1 document in the root directory of the knowledge space."
}
Example 6: Create in Personal Knowledge Base
json
{
"title": "Study Notes",
"wiki_space": "my_library",
"markdown": "# Study Notes\n\nThis is a document created in the personal knowledge base."
}
Content Format
Document content uses Lark-flavored Markdown format, an extended version of standard Markdown that supports all block types and rich text formats of Feishu Documents.
General Rules
- Use standard Markdown syntax as the base
- Use custom XML tags to implement Feishu-specific features (see respective feature sections for specific tags)
- Use backslashes to escape special characters when needed: $ [ ] < > { } | ^`
📝 Basic Block Types
Text (Paragraph)
markdown
Normal text paragraph
**Bold text** within a paragraph
Separate multiple paragraphs with blank lines.
Centered text {align="center"}
Right-aligned text {align="right"}
Paragraph Alignment: Supports
{align="left|center|right"}
syntax. Can be combined with color:
{color="blue" align="center"}
Headings
Feishu supports 9 levels of headings. H1-H6 use standard Markdown syntax, H7-H9 use HTML tags:
markdown
# Level 1 Heading
## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading
##### Level 5 Heading
###### Level 6 Heading
<h7>Level 7 Heading</h7>
<h8>Level 8 Heading</h8>
<h9>Level 9 Heading</h9>
# Colored Heading {color="blue"}
## Red Heading {color="red"}
# Centered Heading {align="center"}
## Blue Centered Heading {color="blue" align="center"}
Heading Attributes: Supports
and
{align="left|center|right"}
syntax, which can be used in combination. Color values: red, orange, yellow, green, blue, purple, gray. Use this capability cautiously.
Lists
Use tabs or 2-space indentation for nested ordered and unordered lists
markdown
- Unordered item 1 (
- Unordered item 1.a
- Unordered item 1.b
1. Ordered item 1
2. Ordered item 2
- [ ] To-do
- [x] Completed
Quote Blocks
markdown
> This is a quote
> It can span multiple lines
> Quotes support **bold** and *italic* formats
Code Blocks
⚠️ Only fence code blocks (```) are supported; indented code blocks are not supported.
markdown
```python
print("Hello")
```
Supported languages: python, javascript, go, java, sql, json, yaml, shell, etc.
Dividers
🎨 Rich Text Formats
Text Styles
Text Colors
<text color="red">Red</text>
<text background-color="yellow">Yellow Background</text>
Supported colors: red, orange, yellow, green, blue, purple, gray
Links
[Link Text](https://example.com)
(anchor links are not supported)
Inline Formulas (LaTeX)
(spaces are required before and after
) or
<equation>E = mc^2</equation>
(no restrictions, recommended)
🚀 Advanced Block Types
Highlight Block (Callout)
html
<callout emoji="✅" background-color="light-green" border-color="green">
Content with **formatting** support, can contain multiple blocks
</callout>
Attributes: emoji (use emoji characters like ✅ ⚠️ 💡), background-color, border-color, text-color
Background Colors: light-red/red, light-blue/blue, light-green/green, light-yellow/yellow, light-orange/orange, light-purple/purple, pale-gray/light-gray/dark-gray
Common Uses: 💡light-blue (tip) ⚠️light-yellow (warning) ❌light-red (danger) ✅light-green (success)
Restrictions: Callout child blocks only support text, headings, lists, to-dos, and quotes. Code blocks, tables, and images are not supported.
Grid Columns
Suitable for comparison and side-by-side display scenarios. Supports 2-5 columns:
Two Columns (Equal Width)
html
<grid cols="2">
<column>
Left column content
</column>
<column>
Right column content
</column>
</grid>
Three Columns with Custom Widths
html
<grid cols="3">
<column width="20">Left Column (20%)</column>
<column width="60">Middle Column (60%)</column>
<column width="20">Right Column (20%)</column>
</grid>
Attributes:
(number of columns, 2-5),
(column width percentage, sum must be 100; can be omitted for equal width)
Tables
Standard Markdown Tables
markdown
|------|------|------|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
Feishu Enhanced Tables
Use this when cells require complex content (lists, code blocks, highlight blocks, etc.).
Hierarchical Structure (must be strictly followed):
<lark-table> ← Table container
<lark-tr> ← Row (direct child elements can only be lark-tr)
<lark-td>Content</lark-td> ← Cell (direct child elements can only be lark-td)
<lark-td>Content</lark-td> ← The number of lark-td elements per row must be the same!
</lark-tr>
</lark-table>
Attributes:
- : Column widths, comma-separated pixel values, total width ≈730
- : Whether the first row is a header ( or )
- : Whether the first column is a header ( or )
Cell Writing: Must leave blank lines before and after content
html
<lark-td>
Write content here
</lark-td>
Complete Example (2 rows, 3 columns):
html
<lark-table column-widths="200,250,280" header-row="true">
<lark-tr>
<lark-td>
**Header 1**
</lark-td>
<lark-td>
**Header 2**
</lark-td>
<lark-td>
**Header 3**
</lark-td>
</lark-tr>
<lark-tr>
<lark-td>
Normal text
</lark-td>
<lark-td>
- List item 1
- List item 2
</lark-td>
<lark-td>
Code content
</lark-td>
</lark-tr>
</lark-table>
Restrictions: Grid and nested tables are not supported within cells
Cell Merging: Returns
attributes when reading; not supported for creation
Prohibited:
- Mixing Markdown table syntax ()
- Using for line breaks
- Omitting tags
Images
html
<image url="https://example.com/image.png" width="800" height="600" align="center" caption="Image description text"/>
Attributes: url (required, the system will automatically download and upload), width, height, align (left/center/right), caption
⚠️ Important: Direct use of the
attribute (e.g.,
) is not supported; only the URL method is allowed. The system will automatically download the image and upload it to Feishu.
Supports PNG/JPG/GIF/WebP/BMP, maximum 10MB
Image/File Insertion Options:
-
Publicly accessible image URL → Use
directly in the markdown of create-doc / update-doc for one-step completion
-
Local images or files (e.g., images/files sent by users in chats) → First use create-doc / update-doc to create or update the document text content, then use the
tool to append the local image or file to the end of the document. If the media needs to appear at a specific position in the middle of the document, first use create-doc to write the preceding content, call
to append the image/file, and finally use the append mode of update-doc to append the subsequent content
Files
html
<file url="https://example.com/document.pdf" name="Document.pdf" view-type="1"/>
Attributes:
- url (file URL, required, the system will automatically download and upload)
- name (file name, required)
- view-type (1=card view, 2=preview view, optional)
⚠️ Important: Direct use of the
attribute (e.g.,
) is not supported
Diagrams (Mermaid / PlantUML)
Supports two diagram syntaxes: Mermaid and PlantUML.
Mermaid Diagrams
Prioritize this format for diagrams. Mermaid diagrams will be rendered as visual diagrams; if a diagram can be implemented with Mermaid, Mermaid should be prioritized.
markdown
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Process]
B -->|No| D[End]
```
Supported Diagram Types: flowchart, sequenceDiagram, classDiagram, stateDiagram, gantt, mindmap, erDiagram
PlantUML Diagrams
PlantUML diagrams will be rendered as visual diagrams. Use PlantUML for scenarios that Mermaid cannot satisfy.
markdown
```plantuml
@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi!
@enduml
```
Supported Diagram Types: sequence, usecase, class, activity, component, state, object, deployment
Reading Diagrams
Returns
tag when reading:
html
<whiteboard token="xxx" align="center" width="800" height="600"/>
Attributes: token (diagram identifier), align (left/center/right), width, height
Important Notes:
- Use Mermaid/PlantUML code blocks when creating documents; the system will automatically convert them to diagrams; it is prohibited to write using !!
- Only the token can be obtained when reading; use the fetch-file tool to view the content. Original source code cannot be obtained
Bitable (Multidimensional Table)
html
<bitable view="table"/>
<bitable view="kanban"/>
Attributes: view (table/kanban, default table)
Note: token is a read-only attribute; only empty multidimensional tables can be created, and data must be added manually after creation.
ChatCard
html
<chat-card id="oc_xxx" align="center"/>
Attributes: id (formatted as oc_xxx, required), align (left/center/right)
Iframe (Embedded Webpage)
html
<iframe url="https://example.com/survey?id=123" type="12"/>
Attributes: url (required), type (component type number, required)
type Enumeration: 1=Bilibili, 2=Xigua, 3=Youku, 4=Airtable, 5=Baidu Maps, 6=Amap, 8=Figma, 9=MockingBot, 10=Canva, 11=CodePen, 12=Feishu Questionnaire, 13=JindoForm
Important Note: Only the webpage types listed above are supported. Other types of webpages are not supported for embedding, so do not use iframe. For regular webpage links, use the Markdown link format
instead.
LinkPreview
html
<link-preview url="Message Link" type="message"/>
Attributes: url (required, write-only attribute), type (message=message link)
Currently only supports message links; only supported for reading, not for creation
QuoteContainer
html
<quote-container>
Quote container content
</quote-container>
Unlike quote blocks, QuoteContainer is a container type that can contain multiple child blocks
🔧 Advanced Feature Blocks
Sheet (Spreadsheet)
html
<sheet rows="5" cols="5"/>
<sheet/>
Attributes: rows (number of rows, default 3, maximum 9), cols (number of columns, default 3)
Note: token is a read-only attribute; cannot be specified during creation. Only empty spreadsheets can be created, and data must be manipulated using the Sheet API after creation.
Read-Only Block Types 🔒
The following block types are only supported for reading, not for creation:
| Block Type | Tag | Description |
|---|
| Mindnote | | Only placeholder information can be obtained |
| Flowchart/UML | | type: 1=flowchart, 2=UML |
| AI Template | | Empty placeholder block |
Task Block
html
<task task-id="xxx" members="ou_123, ou_456" due="2025-01-01">Task Title</task>
Attributes: task-id, members (list of member IDs), due (due date)
Sync Blocks
html
<!-- Source Sync Block: Content is in child blocks -->
<source-synced align="1">Child block content...</source-synced>
<!-- Reference Sync Block: Automatically retrieves content from source document -->
<reference-synced source-block-id="xxx" source-document-id="yyy">Source content...</reference-synced>
Attributes: source-synced has align; reference-synced has source-block-id, source-document-id
Document AddOns
html
<add-ons component-type-id="blk_xxx" record='{"key":"value"}'/>
Attributes: component-type-id (add-on type ID), record (JSON data)
Includes multiple types: Q&A interactions, date reminders, etc. Some components like Mermaid have been specifically encapsulated as board blocks
Legacy ISV AddOns
html
<isv id="comp_xxx" type="type_xxx"/>
Attributes: component_id, component_type_id
Legacy open platform add-ons; use AddOns for new versions
WikiCatalog 🕰️
html
<wiki-catalog token="wiki_xxx"/>
Attributes: wiki_token (knowledge base node token)
🕰️ Legacy version; it is recommended to use the new sub-page-list
SubPageList
html
<sub-page-list wiki="wiki_xxx"/>
Attributes: wiki_token (wiki token of the current page)
Only supported for knowledge base document creation; must pass the wiki token of the current page
Agenda
html
<agenda>
<agenda-item>
<agenda-title>Agenda Title</agenda-title>
<agenda-content>Agenda Content</agenda-content>
</agenda-item>
</agenda>
Structure: agenda (container) → agenda_item (agenda item) → agenda_title (title) + agenda_content (content)
JiraIssue
html
<jira-issue id="xxx" key="PROJECT-123"/>
Attributes: id (Jira issue ID), key (Jira issue Key)
OKR Series ⚠️
html
<okr id="okr_xxx">
<objective id="obj_1">
<kr id="kr_1"/>
</objective>
</okr>
⚠️ Only supported for creation with user_access_token; detailed operations require using the OKR API
Structure: okr → okr_objective (objective) → okr_key_result (key result) + okr_progress (progress)
📎 Mentions and References
Mention User
html
<mention-user id="ou_xxx"/>
Attributes: id (user open_id, formatted as ou_xxx)
Note: Do not directly write formats like
in the document; instead, use search-user to obtain the user's id and use
.
Mention Document
html
<mention-doc token="doxcnXXX" type="docx">Document Title</mention-doc>
Attributes: token (document token), type (docx/sheet/bitable)
📅 Dates and Times
Reminder
html
<reminder date="2025-12-31T18:00+08:00" notify="true" user-id="ou_xxx"/>
Attributes:
- date (required): , ISO 8601 with time zone offset
- notify (true/false): whether to send notifications
- user-id (required): user ID of the creator
📐 Mathematical Expressions
Block-Level Formulas (LaTeX)
markdown
$$
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$
Inline Formulas
markdown
Einstein's equation: $E = mc^2$ (note that spaces are required before and after $; no spaces allowed in adjacent positions)
✍️ Writing Guidelines
Scenario Quick Reference
| Scenario | Recommended Component | Description |
|---|
| Key Tips/Warnings | Callout | Blue for tips, yellow for warnings, red for dangers |
| Comparison/Side-by-Side Display | Grid Columns | 2-3 columns are optimal; more eye-catching when combined with Callout |
| Data Summary | Table | Use Markdown for simple data, lark-table for complex nesting |
| Step-by-Step Instructions | Ordered List | Can nest sub-steps |
| Timeline/Version | Ordered List + Bold Dates | Or use Mermaid timeline |
| Code Display | Code Block | Label the language, add appropriate comments |
| Knowledge Cards | Callout + emoji | Used for concept explanations, tips |
| Reference Explanations | Quote Block > | Quote original text, famous sayings |
| Term Comparison | Two-Column Table | Chinese-English, abbreviations and full names, etc. |
🎯 Best Practices
- Blank Line Separation: Separate different block types with blank lines
- Escape Characters: Escape special characters with : ```
- Images: Use URLs; the system will automatically download and upload
- Grid Columns: The sum of column widths must be 100
- Table Selection: Use Markdown for simple data, for complex nesting
- Mentions: Use for @users, for @documents
- Table of Contents: Automatically generated by Feishu, no need to add manually
📖 Supplementary Notes
- Tokens are required for images, diagrams, and Bitable (URLs will be automatically uploaded and converted)
- Corresponding access permissions are required for mentioning users and ChatCards
- Fully compatible with standard Markdown