L
Lark Docs MCP
by @hsqbyte
MCP server by hsqbyte
Created 3/22/2026
Updated about 5 hours ago
README
Repository documentation and setup instructions
lark-docs-mcp
Minimal MCP server for Codex that reads the plain text content of Lark/Feishu documents.
It can run in two modes:
- MCP server mode for Codex integration
- direct CLI read mode for fast credential and permission checks
What it does
- Exposes one MCP tool:
read_lark_doc - Accepts:
- direct
docxURL - direct
wikiURL - raw doc token
- raw wiki token
- direct
- Fetches:
- document title
- latest revision id
- plain text content
This server is intentionally small and uses only the Python standard library.
Files
server.py: MCP server implementation.env.example: example credentials file
Prerequisites
- Create a self-built Lark app in the Lark Open Platform.
- Give the app document read permission.
- Publish the app or make sure the app availability covers the users/docs you want to access.
- If a document is private, add the app to that document or otherwise grant it access.
Notes:
- Lark tenant access tokens are fetched through
POST /open-apis/auth/v3/tenant_access_token/internal. - Document metadata is fetched through
GET /open-apis/docx/v1/documents/{document_id}. - Plain text content is fetched through
GET /open-apis/docx/v1/documents/{document_id}/raw_content. - Wiki links are resolved through
GET /open-apis/wiki/v2/spaces/get_node?token=....
Setup
- Create your local credentials file:
cd /Users/helwd/opt/test/lark-docs-mcp
cp .env.example .env
-
Fill in
.envwith your Lark app credentials. -
Validate your credentials directly before wiring MCP:
python3 /Users/helwd/opt/test/lark-docs-mcp/server.py \
--env-file /Users/helwd/opt/test/lark-docs-mcp/.env \
read "https://example.larksuite.com/docx/AbCdEfGhIjKlMnOpQrStUvWxYz"
If you prefer structured output:
python3 /Users/helwd/opt/test/lark-docs-mcp/server.py \
--env-file /Users/helwd/opt/test/lark-docs-mcp/.env \
read "https://example.larksuite.com/docx/AbCdEfGhIjKlMnOpQrStUvWxYz" \
--format json
- Smoke test the MCP handshake:
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","clientInfo":{"name":"manual-test","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
| python3 /Users/helwd/opt/test/lark-docs-mcp/server.py --env-file /Users/helwd/opt/test/lark-docs-mcp/.env
- Register it in Codex:
codex mcp add lark-docs -- \
python3 /Users/helwd/opt/test/lark-docs-mcp/server.py \
--env-file /Users/helwd/opt/test/lark-docs-mcp/.env
- Confirm registration:
codex mcp list
Tool usage
Example tool arguments:
{
"reference": "https://example.larksuite.com/docx/AbCdEfGhIjKlMnOpQrStUvWxYz",
"reference_kind": "auto",
"include_metadata": true,
"lang": 0
}
You can also pass a wiki link:
{
"reference": "https://example.larksuite.com/wiki/AbCdEfGhIjKlMnOpQrStUvWxYz"
}
For a raw token:
{
"reference": "AbCdEfGhIjKlMnOpQrStUvWxYz",
"reference_kind": "docx"
}
Known limits
- The tool returns plain text, not rich block structure or markdown.
- Wiki resolution is best effort and currently only supports wiki nodes backed by
docordocx. - If the app lacks access to a document, Lark will return a permission error.
Quick Setup
Installation guide for this server
Install Package (if required)
uvx lark-docs-mcp
Cursor configuration (mcp.json)
{
"mcpServers": {
"hsqbyte-lark-docs-mcp": {
"command": "uvx",
"args": [
"lark-docs-mcp"
]
}
}
}