What Are the Five MCP Tools Provided by Distilly? A Complete Feishu Integration Guide
Distilly provides five MCP tools—feishu_mcp_client.py, feishu_parser.py, feishu_browser.py, feishu_auto_collector.py, and the three functional sub-commands of the MCP client (doc, wiki, chat)—that wrap the Feishu Message-Channel-Platform API to enable headless extraction of documents, wikis, and chat logs.
The titanwings/distilly repository (specifically the dot-skill branch) ships a specialized suite of utilities designed to interact with Feishu (Lark) workspaces programmatically. These five MCP tools eliminate the need for persistent browser automation by leveraging the Feishu MCP server, allowing the skill to read corporate knowledge bases and conversation histories in serverless or containerized environments.
Overview of the MCP Architecture
The Message-Channel-Platform (MCP) integration in Distilly is contained entirely within the /tools directory. Each utility serves a distinct purpose in the data extraction pipeline: fetching raw API responses, parsing proprietary markup, providing fallback mechanisms, and aggregating continuous streams. Together, they form a robust headless interface to Feishu resources.
The Five MCP Tools Explained
1. feishu_mcp_client.py - Core CLI Interface
Located at tools/feishu_mcp_client.py, this is the primary gateway to the Feishu MCP ecosystem. The script builds HTTP requests and executes the feishu-mcp binary to retrieve raw JSON from Feishu servers. It acts as a thin wrapper that translates high-level commands into MCP protocol calls.
When invoked, the client returns unprocessed JSON payloads containing the full structure of Feishu documents, wiki pages, or chat histories.
# Example invocation structure
python tools/feishu_mcp_client.py --doc <document_id>
python tools/feishu_mcp_client.py --wiki <wiki_token>
python tools/feishu_mcp_client.py --chat <chat_id>
2. feishu_parser.py - Content Normalization Engine
The tools/feishu_parser.py module processes the JSON output from feishu_mcp_client.py to extract human-readable content. It strips Feishu-specific markup artifacts, normalizes line breaks, and converts the proprietary structure into clean plain text suitable for downstream LLM processing.
This separation of concerns allows the fetching logic to remain stable while the parsing logic adapts to changes in Feishu's JSON schema.
# Conceptual usage based on implementation
from tools.feishu_parser import parse_feishu_content
raw_json = client.fetch_document(doc_id)
clean_text = parse_feishu_content(raw_json)
3. feishu_browser.py - Selenium Fallback
When the MCP server binary is unavailable or restricted by organizational policies, tools/feishu_browser.py provides a resilient fallback. This utility automates a logged-in browser session using Selenium WebDriver to navigate Feishu web interfaces and extract content.
This ensures the Distilly skill remains functional in environments where installing the feishu-mcp binary is impossible, maintaining continuity through browser-based automation.
4. feishu_auto_collector.py - Continuous Chat Aggregation
Found at tools/feishu_auto_collector.py, this automation tool continuously polls Feishu chat channels via the MCP interface. It aggregates individual messages into a single, time-ordered markdown file, enabling batch processing workflows such as conversation summarization, keyword extraction, and compliance auditing.
The collector operates headlessly, appending new messages to the aggregate file without manual intervention.
# Continuous polling mode
python tools/feishu_auto_collector.py --chat <chat_id> --output chat_history.md
5. MCP Client Sub-commands - Granular Resource Access
While technically part of feishu_mcp_client.py, three distinct entry points function as independent tools within the Distilly documentation:
--doc: Retrieves structured content from individual Feishu documents--wiki: Fetches knowledge base articles and wiki pages--chat: Exports conversation histories and thread logs
These sub-commands are treated as the fifth MCP tool because they provide specialized interfaces for different Feishu resource types, each with unique parameter requirements and return schemas.
How the Tools Interact
The typical data flow in Distilly follows this pipeline:
- Access:
feishu_mcp_client.py(orfeishu_browser.pyas fallback) retrieves the resource - Processing:
feishu_parser.pynormalizes the content into usable text - Aggregation:
feishu_auto_collector.pyhandles continuous data streams for chat monitoring
This modular design allows developers to swap components—for example, substituting the browser fallback when MCP binaries are unavailable—without modifying the parsing or aggregation logic.
Summary
feishu_mcp_client.py: Primary CLI wrapper for the Feishu MCP binary that fetches raw JSON from documents, wikis, and chatsfeishu_parser.py: Normalizes Feishu JSON responses into clean, markup-free textfeishu_browser.py: Selenium-based fallback for environments lacking MCP server accessfeishu_auto_collector.py: Automated polling agent that aggregates chat history into markdown files- Client Sub-commands (
--doc,--wiki,--chat): Specialized entry points within the MCP client for targeting specific Feishu resource types
Frequently Asked Questions
What does MCP stand for in Distilly's implementation?
MCP stands for Message-Channel-Platform. It refers to the Feishu MCP API that Distilly wraps to provide programmatic access to messaging data, channel content, and platform resources without requiring browser automation.
Do these tools require a permanent browser session?
No. The feishu_mcp_client.py and related tools operate headlessly using the Feishu MCP server binary. Only the feishu_browser.py fallback requires a browser session via Selenium, and it is invoked only when the MCP binary is unavailable.
How does feishu_parser handle Feishu-specific formatting?
The parser strips proprietary Feishu markup tags, normalizes inconsistent line breaks, and extracts the semantic text content from the JSON structures returned by the MCP client. This produces clean output suitable for natural language processing tasks.
Can I use these MCP tools outside of the Distilly skill framework?
Yes. While designed as components of the titanwings/distilly skill, each tool in /tools is self-contained. You can import feishu_parser.py or execute feishu_mcp_client.py directly from the command line, provided you have valid Feishu authentication credentials and the feishu-mcp binary in your system path.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →