Feishu Codex MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Feishu Codex MCPsearch the Feishu knowledge base for onboarding docs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Feishu Codex MCP v26.08.25
Connect Feishu knowledge bases and authorized shared cloud drives to Codex through an enterprise self-built app. This MCP uses the App ID and App Secret to obtain an app identity, and can list, search, and read wiki bases, spreadsheets, bitables, and shared files. It can also create new documents or make small in-place edits within strict boundaries.
This repository is the source version that can be publicly uploaded to GitHub. It does not contain a real .env, any Feishu content, local backups, downloaded files, dependency directories, or release archives.
Features and Security Boundaries
Uses the Feishu app identity; you don't need to log in to a personal Feishu account in the browser.
The
App IDandApp Secretonly prove "which app this is"; the API permissions and target resource authorization together determine "what it can access".By default,
FEISHU_WIKI_READ_SCOPE=root; it only reads the specified root node and its descendants.You can change the read scope to
spaceto read all nodes in the wiki space containing the root node; write operations are still limited to the configured root node or shared folder.A local backup is saved before modifying a document; restore operations create a new draft and never directly overwrite the current document.
No destructive tools are provided, such as delete, move, share, or permission modification.
Codex uses the
writesapproval mode for write tools, and still asks for confirmation before executing.
Related MCP server: Feishu MCP Server
Prerequisites
You need:
A Feishu enterprise account with permission to create, publish, or approve an enterprise self-built app;
Windows 10/11;
Node.js 24 or higher;
Codex Desktop, Codex CLI, or the Codex IDE extension;
A wiki node that you plan to authorize to the app; a shared cloud drive folder is optional.
Official resources:
1. Create a Feishu Enterprise Self-built App
Open the Feishu Open Platform Developer Backend and select "Create Enterprise Self-built App".
Fill in the app name, description, and icon.
Go to "Credentials and Basic Information", copy the
App IDandApp Secret, and temporarily store them in a password manager.Do not send the
App Secretto chat, Issues, screenshots, or GitHub. If it has already leaked, reset it immediately in the Feishu backend.
This project uses the app identity to obtain a tenant_access_token, so no personal OAuth login is required. Being an enterprise admin or an app admin does not mean the app automatically has all wiki and drive permissions; resources still need to be authorized separately.
2. Configure and Publish Feishu Permissions
Go to the app's "Permission Management" and apply for the permissions you actually need. The Chinese names shown in the Feishu backend may change, so we recommend also searching by permission code.
Capability | Read-only permission | Permission when using write tools |
Wiki base |
|
|
Docs |
|
|
Spreadsheets |
| This project only reads these, so read-only is sufficient |
Base tables |
| This project only reads these, so read-only is sufficient |
Drive files |
| Equivalent writable permission when creating documents in a shared folder |
Principle of least privilege: if you only use read tools, do not apply for writable permissions. If the permission name shown in the Feishu backend differs from the table above, follow the latest "required permission" listed on the corresponding API page.
After adding permissions, you must also:
Create an app version;
Submit it for publishing;
Have the enterprise admin approve the newly added permissions;
Confirm the version is published.
Only checking permission boxes without publishing will not give the running app identity the new permissions.
3. Authorize the Knowledge Base and Shared Drive
API permissions are about app capabilities; resource authorization is about access to specific documents, and both are required.
Authorize the knowledge base
Open the knowledge base or target root node you plan to connect.
Add the newly created enterprise self-built app to the knowledge space members, permission settings, or document collaborators. Different Feishu versions may show the entry as "Add app to document".
Grant read-only permission when the app only needs to read; grant edit permission only when
feishu_editorfeishu_createis needed.If you can't find the app, first confirm that the app is published and approved, and that its available scope includes the current account.
Authorize a shared drive folder
Open the sharing or permission settings of the target shared folder.
Add this enterprise self-built app and grant view or edit permission as needed.
Only configure one explicit root folder; do not use the entire enterprise drive as the default boundary.
An admin role will not bypass the resource authorization for knowledge bases and folders. What the app can ultimately see is the intersection of "published API permissions" and "authorized resources".
4. Obtain the Wiki and Drive tokens
Wiki token
Copy the target wiki node link, for example:
https://your-tenant.feishu.cn/wiki/WIKI_NODE_TOKEN?from=copylinkThe part after /wiki/ and before the query parameter ? is the FEISHU_WIKI_ROOT_TOKEN. If you fill in FEISHU_WIKI_ROOT_URL with the full link, it will be used to generate clickable links.
Drive token
Copy an authorized shared folder link, for example:
https://your-tenant.feishu.cn/drive/folder/DRIVE_FOLDER_TOKENThe part after /folder/ and before the query parameter is the FEISHU_DRIVE_ROOT_TOKEN. Leave it empty if you do not need drive access.
Do not mix ordinary document tokens, wiki node tokens, and drive folder tokens. If the link structure differs from the example, first confirm the resource type in the browser address bar, or check the token through the Feishu API debug console.
5. Install the Project and Fill in .env
In PowerShell, go to the project directory:
npm ci
Copy-Item .env.example .env
notepad .envFill in your own values in .env:
FEISHU_APP_ID=<你的 App ID>
FEISHU_APP_SECRET=<你的 App Secret>
FEISHU_WIKI_ROOT_TOKEN=<知识库根节点 Wiki token>
FEISHU_WIKI_ROOT_URL=https://your-tenant.feishu.cn/wiki/<知识库根节点 Wiki token>
FEISHU_WIKI_READ_SCOPE=root
FEISHU_DRIVE_ROOT_TOKEN=<共享文件夹 Drive token;不用云盘时留空>
FEISHU_API_BASE_URL=https://open.feishu.cn/open-apis
FEISHU_BACKUP_DIR=data/backupsThe read scope has two options:
read: the default, only reads the configured root node and its children, suitable for public deployment and least privilege.space: reads all nodes in the wiki space to which the root node belongs, suitable for scenarios that truly need cross-directory search.
space only expands the read discovery scope, not the write boundary. .env is already excluded by .gitignore; you can only commit .env.example.
Usage Instructions
After completing the Feishu app configuration, connect in the following order:
Run
npm cito install the pinned dependencies.Copy
.env.exampleto.env.Fill in your own App ID, App Secret, and Wiki token for the knowledge base root node.
Keep
FEISHU_WIKI_READ_SCOPE=rootto limit reads to the root node and its descendants; only switch tospacewhen you really want to read other directories in the same knowledge space.Fill in
FEISHU_DRIVE_ROOT_TOKENwhen you need to read the shared drive; leave it empty if not.Double-click
connect-feishu.cmd, fully exit and restart Codex after you seeSetup completed.Tell Codex to run "list the Feishu wiki root directory" to confirm the MCP is connected.
After changing the app, directory, or read scope, edit
.envand restart Codex again.
Even if the knowledge base root node has no child pages, feishu_list_wiki still returns the root node itself. space mode lets listing, search, and reading cover the entire wiki space, but create, edit, and restore draft operations are still limited to the original FEISHU_WIKI_ROOT_TOKEN.
When reading a bitable in a wiki base, feishu_read can use the table parameter to specify the table, and max_tables / max_records to limit the returned volume. This requires bitable:app:readonly or an equivalent higher permission, and the target bitable must be authorized to the app.
Run the following command in the project directory to perform a read-only online diagnostic that does not write any Feishu content:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/test-live.ps16. Connect to Codex
Automatic configuration (Windows)
After installing dependencies and filling in .env, double-click:
connect-feishu.cmdThe script keeps the other settings in ~/.codex/config.toml and only updates the [mcp_servers.feishu] section. After it succeeds, fully quit and reopen Codex.
Manual configuration
Codex's MCP configuration file is located at ~/.codex/config.toml. Change the path to the absolute path on your machine; use / for Windows paths:
[mcp_servers.feishu]
command = "C:/Program Files/nodejs/node.exe"
args = ["C:/path/to/FeishuCodexMCP/src/server.js"]
cwd = "C:/path/to/FeishuCodexMCP"
startup_timeout_sec = 20
tool_timeout_sec = 120
default_tools_approval_mode = "writes"There is no need to write the App ID or Secret into config.toml. The server reads the configuration from the .env in the directory pointed to by cwd. Codex Desktop, CLI, and IDE extensions share this same configuration on the same machine.
You must restart Codex after modifying the configuration. After restarting, you can tell Codex to run list the Feishu wiki root directory to confirm the connection.
7. Check the Connection and Create a Release Package
Run the read-only diagnostic that requires real Feishu credentials:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/test-live.ps1The read-only diagnostic checks app authentication, the root node, the current read scope, spreadsheets, bitables, and the authorized shared drive, without modifying any Feishu content.
When you need to build a release package bundled with dependencies, run:
npm run package:safeThe script verifies the archive whitelist, scans for sensitive values, and performs an offline startup check, then generates 飞书MCP-v26.08.25.zip in the project's parent directory. That archive is a release artifact and should not be committed to GitHub.
MCP Tool List
Tool | Purpose | Type |
| List authorized root nodes, child nodes, or the wiki space directory | Read-only |
| Search titles and body content within the allowed scope | Read-only |
| Read documents, spreadsheets, bitables, or files | Read-only |
| Apply small in-place edit or insert existing blocks by revision, and back up before writing. | Write, requires approval |
| Create a new Docx in an allowed wiki node or shared folder | Write, requires approval |
| Traverse the authorized shared | Read-only |
| View locally saved snapshots of documents before changes | Read-only |
| Create a new restore draft from a backup without overwriting the original | Write, requires approval |
FAQ
I have App ID and App Secret, but still can't read content?
Credentials are only responsible for the app identity authentication. You also need the following at the same time: the app permission has been published and approved, the target resources are authorized for the app, the token type is correct, and the resource is in the configured read scope.
Why is browser login not required?
This project uses an enterprise self-built app identity and obtains the tenant_access_token and through App ID and Secret. Browser login is usually user OAuth, which is another authentication method and is not a required step for this project.
Why do I still need to configure permissions if I'm an admin?
Admin is the role of your account; API requests represent the enterprise self-built app. Feishu separates the account management, app API permissions, and specific resource permissions, so an app created by an admin does not automatically read all company data.
I can read the root node, but not other wiki pages
Check FEISHU_WIKI_READ_SCOPE. A value of root only traverses the descendants of the root node; if you really need to read other directories in the same wiki space, change it to space and restart Codex. If it is still not visible, check the authorization of the space to the app.
Bitable cannot be read
Confirm that the app has at least bitable:app:readonly or an equivalent higher permission, plus the permission version has been published, and that the bitable has been authorized to the app.
No Feishu tools appear in Codex
Check that the path in ~/.codex/config.toml exists, that npm ci has been run in the project, and that .env is in cwd; then fully exit and restart Codex. You can also run node src/server.js to check for startup errors; a normal std MCP server waits for input, not a error page.
Security Notes and Upload Checks
Neither the public repo nor the release package may include a real .env, App ID, App Secret, Wiki/Drive token, enterprise knowledge base URLs, downloaded files, or local backups. The secure packager verifies the archive whitelist and scans local .env for sensitive values; it refuses to publish if it finds real configuration.
FEISHU_WIKI_READ_SCOPE with space only expands the read scope in the same wiki space. Create, edit, and restore operations remain scoped to the configured root node; bitable features remain read-only, and no tool for write is provided.
If you suspect credential leakage:
Immediately reset the App Secret in the Feishu Open Platform backend.
Recognize or narrow the app permissions, and review the resource authorizations for wiki base, bitables, and shared drive.
Delete local files and archives that contain the old credentials.
If credentials have entered Git history, clean up the history before re-uploading, and ensure the new Secret is always used.
Confirm the following list before uploading:
The repo contains only
.env.example, and no.envor other real credential files.The
App Secret, real Wiki/Drive tokens, enterprise domain, and Feishu content do not appear in any tracked file.No
node_modules,data,downloads,backups, logs, or archives.git status --shortalso only shows or dedented archives.Use
git ls-filesto review the full file list that will be uploaded.If credentials were previously in Git history, simply removing the current file still got archived with old credentials; you should reset the Feishu Secret and clean up the history.
Use some commands because they may identify the .env placeholder, for an extra primary:
git ls-files
git grep -n -I -E "FEISHU_APP_SECRET=.+|tenant_access_token|your-tenant\.feishu\.cn"The last command can hit the placeholder examples in the README; manually confirm they are just placeholders, not real values.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI models to interact with Feishu (Lark) APIs for document management, bot messaging, chat operations, and multi-dimensional table (Bitable) CRUD operations through natural language.371MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to directly read, write, and manage Feishu documents, spreadsheets, and multi-dimensional tables. It supports automated documentation tasks and rich text management, including Mermaid diagrams and image uploads.18372MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to read and interact with Feishu (Lark) documents, spreadsheets, and multi-dimensional tables. It provides tools for extracting content and metadata from various Feishu resources through secure OAuth or tenant-level authentication.4113MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI applications to access Feishu (Lark) knowledge base and cloud documents through the MCP protocol.371ISC
Related MCP Connectors
Shared, permission-aware company context for AI agents, with provenance, approvals and audit.
Securely search and manage workspace context files for AI agents and teams.
Connect your team's living knowledge base — docs, data, issues, CRM — to Claude and ChatGPT.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cimorn/FeishuCodexMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server