Navigation
MCP Server My Lark Doc: Real-Time Editing & Secure Cloud Storage - MCP Implementation

MCP Server My Lark Doc: Real-Time Editing & Secure Cloud Storage

MCP Server My Lark Doc: Streamline document collaboration with real-time editing, secure cloud storage, and enterprise tools to boost team productivity.

Developer Tools
4.3(101 reviews)
151 saves
70 comments

Users create an average of 14 projects per month with this tool

About MCP Server My Lark Doc

What is MCP Server My Lark Doc: Real-Time Editing & Secure Cloud Storage?

MCP Server My Lark Doc is a specialized tool built using the Model Context Protocol (MCP) to integrate Lark (Feishu) document services into AI workflows. It enables real-time access to Lark Docs and Wiki pages while ensuring secure cloud storage compliance. This server acts as a bridge between Lark’s document ecosystem and applications like Claude Desktop, streamlining content retrieval and processing.

How to Use MCP Server My Lark Doc: Real-Time Editing & Secure Cloud Storage?

Follow these steps to deploy and configure the server:

  1. Install the server: Run uvx mcp-server-my-lark-doc via your terminal.
  2. Set up Lark app credentials: Obtain LARK_APP_ID and LARK_APP_SECRET from the Lark Open Platform.
  3. Configure permissions: Ensure your app has required scopes like wiki:wiki:readonly and docx:document:readonly.
  4. Adjust environment variables: Set OAuth callback settings (e.g., OAUTH_HOST=localhost).
  5. Integrate with Claude Desktop: Add the server configuration under mcpServers in your desktop app settings.

MCP Server My Lark Doc Features

Key Features of MCP Server My Lark Doc: Real-Time Editing & Secure Cloud Storage?

  • Unified document access: Supports Lark Docs and Wiki, auto-detecting formats and extracting IDs.
  • Robust authentication: OAuth-based user login with automatic token refresh and customizable callback servers.
  • Granular error handling: Clear feedback for invalid URLs, token issues, and permission errors.
  • Search capabilities: The search_wiki tool allows keyword-based searches with pagination.
  • Security-first design: Secure OAuth flows and environment variable encryption for credentials.

Use Cases of MCP Server My Lark Doc: Real-Time Editing & Secure Cloud Storage?

Common scenarios include:

  • Automating document content extraction for AI analysis in enterprise workflows.
  • Integrating Lark Wiki into chatbots for quick knowledge retrieval.
  • Real-time collaboration by syncing document updates across teams.
  • Compliance-driven storage management with role-based access controls.

MCP Server My Lark Doc FAQ

FAQ from MCP Server My Lark Doc: Real-Time Editing & Secure Cloud Storage?

Q: Why do I see "Lark client not properly initialized"?
A: Double-check your LARK_APP_ID and LARK_APP_SECRET for typos or revoked access.

Q: How do I resolve "Authorization timeout"?
A: Ensure your OAuth callback server is reachable and responses are processed within 5 minutes.

Q: Can I customize OAuth ports beyond localhost?
A: Yes, adjust OAUTH_HOST and OAUTH_PORT in environment variables for production setups.

Q: What if the document content returns empty?
A: Verify permissions for the document and ensure it isn’t restricted to other teams or users.

Content

MCP Server My Lark Doc

A Model Context Protocol server for searching and accessing Lark(Feishu) documents.

Features

Document Content Access

  • Supports both Lark Doc and Wiki document types
  • Automatically handles document type detection and ID extraction
  • Returns raw content in text format for LLM processing

Authentication

  • OAuth-based user authentication
  • Automatic token refresh and expiration management
  • Customizable OAuth callback server

Error Handling

  • Comprehensive error reporting for authentication issues
  • Clear feedback for invalid document URLs
  • Detailed error messages for troubleshooting

Installation

uvx mcp-server-my-lark-doc

Configuration

Get your Lark App ID and App Secret

Visit the Lark Open Platform: https://open.larkoffice.com/app

Make Sure your Lark App has Permissions below

wiki:wiki:readonly
wiki:node:read
docx:document:readonly
search:docs:read

Environment Variables

Before using this MCP server, you need to set up your Lark application credentials:

  1. Create a Lark application in Lark Open Platform
  2. Get your App ID and App Secret
  3. Configure environment variables:
export LARK_APP_ID="your_app_id"
export LARK_APP_SECRET="your_app_secret"
export OAUTH_HOST="localhost"               # OAuth callback server host (default: localhost)
export OAUTH_PORT="9997"                   # OAuth callback server port (default: 9997)

Usage

Configure in Claude desktop:

"mcpServers": {
    "lark_doc": {
        "command": "uvx",
        "args": ["mcp-server-my-lark-doc"],
        "env": {
            "LARK_APP_ID": "your app id",
            "LARK_APP_SECRET": "your app secret",
            "OAUTH_HOST": "localhost",   // optional   
            "OAUTH_PORT": "9997"        // optional  
        }
    }
}

Available Tools

  1. get_lark_doc_content
* Purpose: Retrieve document content from Lark
* Args: documentUrl (string) - The URL of the Lark document
* Returns: Document content in text format
* Supports: 
  * Doc URLs: https://xxx.feishu.cn/docx/xxxxx
  * Wiki URLs: https://xxx.feishu.cn/wiki/xxxxx
  1. search_wiki
* Purpose: Search documents in Lark Wiki
* Args: 
  * query (string) - Search keywords
  * page_size (int, optional) - Number of results to return (default: 10)
* Returns: JSON string containing search results with following fields: 
  * title: Document title
  * url: Document URL
  * create_time: Document creation time
  * update_time: Document last update time

Error Messages

Common error messages and their solutions:

  • "Lark client not properly initialized": Check your LARK_APP_ID and LARK_APP_SECRET
  • "Invalid Lark document URL format": Verify the document URL format
  • "Failed to get document content": Check document permissions and token validity
  • "Failed to get app access token": Check your application credentials and network connection
  • "Failed to get wiki document real ID": Check if the wiki document exists and you have proper permissions
  • "Document content is empty": The document might be empty or you might not have access to its content
  • "Authorization timeout": ser didn't complete authorization within 5 minutes

Development Notes

OAuth Callback Server

Default configuration:

  • Host: localhost

  • Port: 9997 Customize via environment variables:

  • OAUTH_HOST: Set callback server host

  • OAUTH_PORT: Set callback server port

License

MIT License

Related MCP Servers & Clients