Content
MCP Server
Let Claude Code operate Feishu **as — create documents, write content messages, call any Feishu It Works
```
"Create a doc in Fe → Claude → MCP Server → API (your identity)
OAuth 2.0 User
```
Instead of a, the server uses OAuth to **user access token**. Every in Feishu as done by personally** — so you can everything.
## Prerequisites
1. Create a Feishu App to [Fe Platform](https://open.fe Developer Console
2. Create an **Enterprise Internal App**
Note the `App ID` Secret` from ** Basic Info**
### 2 Permissions
Navigate to **Permission add:
- `docx` — Read & write documents `docx:document:readonly`
- `drive` — Cloud drive operations
3. Configure OAuth RedirectGo to **Security Settings** URL, add:
```
http://localhost:3040/callback
4. Publish the App
Create a version under **App Publish** and submit for admin approval.
## Installation
```bash
git clone <repo-url>
cd feishu-mcp-server
npm install
cp .env.example .env
# Edit .env with your App ID and App Secret
```
## Authorization
```bash
node auth.js
```
A browser window opens → authorize the app → `refresh_token` is saved to `.env` automatically.
## Configure Claude Code
Edit your **user-level** `settings.json~/.claude/settings.json` on macOS/Linux, or `C:\Users\<username>\.claude\settings.json` on Windows):
```json
{
"mcpServers": {
"feishu": {
"command": "node",
"args": ["<path-to-project>/index.js"]
}
}
}
```
> User-level config means it works across all projects. Restart Claude Code to load.
## Usage
### Via Claude Code
```
"Create a new doc in Feishu called 'Meeting Notes'"
this analysis to Feishu doc xxx"
"Read Feishu doc xxx and summarize it"
```
### Command Line
```bash
# Create a doc that Claude can read & write
node create-doc.js "Document Title"
Tool List
| Tool | Description |
|------|-------------|
| `feishu_create_document` | Create a new document |
| `feishu_write_document_content` | Write content (supports Markdown) |
| `feishu_get_document` | Read a document |
| `feishu_send_message` | Send a message to a user or chat |
| `feishu_call_api` | Call any Feishu API directly |
## File Structure
```
.js # MCP Server entry point
├── auth.js # OAuth authorization script (run once)
├── create-doc.js # CLI document creation tool
├── .env.example # Credential template
├── .env # Real credentials (gitignored)
└── .gitignore
```