Huoshui File Converter

io.github.huoshuiai42由 GitHub 帳號 huoshuiai42 發布v1.0.0更新於 Oct 24, 2026

An MCP server that provides document format conversion

已驗證STDIO僅桌面效率與工作流檔案與儲存

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理在指定的工作目錄內把文件在 Markdown、DOCX、HTML、PDF 與 TXT 之間轉換。

可以做什麼
在 Markdown、DOCX、HTML、PDF 與 TXT 之間轉換文件,其中 TXT 與 HTML 可轉為其他任一格式,PDF 僅作為輸出格式。以內容分析而非僅憑副檔名辨識檔案格式。瀏覽工作目錄,可限制顯示數量並只顯示可轉換的檔案。查看單一檔案的詳細資訊。列出支援的轉換組合。
適用情境
適合需要把筆記、報告或網頁內容轉成另一種文件格式,或想查看某個資料夾裡哪些檔案可以轉換,而不必離開聊天用戶端的場景。
執行需求
以 Python 套件形式在本機執行(需 Python 3.8 以上),可透過 uvx 或 pip 安裝。需要系統安裝 pandoc,產生 PDF 還需 LaTeX。工作目錄由 --dir/-d 參數或 HUOSHUI_WORKING_DIR 環境變數指定,未指定時使用目前目錄。
安裝前請注意
轉換會在指定的工作目錄中寫入新檔案,應指向允許寫入的資料夾。所有操作都限制在該目錄內,絕對路徑會被拒絕。PDF 轉換依賴外部 LaTeX 安裝。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Huoshui File Converter,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Huoshui File Converter

A secure MCP (Model Context Protocol) server for document format conversion within a specified working directory.

Features

  • 🔒 Sandbox Security: All operations restricted to a configured working directory
  • 📄 Format Support: Convert between Markdown, DOCX, HTML, PDF, and TXT
  • 🚀 MCP Integration: Full MCP protocol support with prompts, resources, and tools
  • ⚙️ Flexible Configuration: CLI arguments, environment variables, or current directory
  • 🔍 Smart Detection: Intelligent file format detection by content analysis

Quick Start

Installation

Option 1: From MCP Registry (Recommended)

This server is available in the Model Context Protocol Registry. Install it using your MCP client.

mcp-name: io.github.huoshuiai42/huoshui-file-converter

Option 2: Using uvx

bash
uvx huoshui-file-converter

Option 3: Using pip

bash
pip install huoshui-file-converter

Basic Usage

bash
# Use current directoryuvx huoshui-file-converter
# Specify working directory (recommended)uvx huoshui-file-converter --dir "/path/to/documents"
# Short formuvx huoshui-file-converter -d "~/Documents"

MCP Client Configuration

For Claude Desktop or other MCP clients:

json
{  "mcpServers": {    "huoshui-converter": {      "command": "uvx",      "args": ["huoshui-file-converter", "--dir", "/Users/yourname/Documents"]    }  }}

Configuration Options

Priority Order

  1. CLI Argument (highest priority): --dir or -d
  2. Environment Variable: HUOSHUI_WORKING_DIR
  3. Smart Default: Documents folder if current directory is problematic
  4. Current Directory (fallback)

Examples

bash
# CLI argument (best for MCP clients)uvx huoshui-file-converter --dir "/project/docs"
# Environment variableexport HUOSHUI_WORKING_DIR="/project/docs"uvx huoshui-file-converter
# Current directory fallbackcd /project/docsuvx huoshui-file-converter

Supported Conversions

FromTo
MarkdownDOCX, HTML, PDF
DOCXMarkdown, HTML, PDF
HTMLMarkdown, DOCX, PDF
TXTMarkdown, DOCX, HTML, PDF

MCP Tools & Resources

Tools

  • convert_document: Convert files between formats
  • detect_format: Intelligent format detection

Resources

  • file_list: Browse directory contents (optimized for large directories)
    • limit: Control number of files shown (default: 100)
    • supported_only: Show only convertible files
  • file_get: Get detailed file information
  • conversion_capability_list: List supported conversions

Prompts

  • role_and_rules: AI assistant behavior guidelines

Performance Features

  • Fast Directory Listing: Extension-based format detection for large directories
  • Smart File Limits: Default 100-file limit prevents UI freezing
  • Large File Handling: Files >50MB are marked and handled specially
  • Selective Display: Option to show only supported file formats
  • Memory Efficient: Avoids reading file contents during directory browsing

Security Features

  • Path Validation: Prevents directory traversal attacks
  • Working Directory Restriction: All operations sandboxed to configured directory
  • Startup Validation: Checks directory existence and permissions
  • Relative Path Enforcement: Absolute paths are rejected

Command Line Options

bash
$ uvx huoshui-file-converter --help
usage: huoshui-file-converter [-h] [--dir PATH] [--version]
Huoshui Document Converter - MCP Server for file conversion within a working directory
options:  -h, --help         show this help message and exit  --dir PATH, -d PATH                     Working directory for file operations (default: current directory or HUOSHUI_WORKING_DIR env var)  --version, -v      show program's version number and exit
Examples:  uvx huoshui-file-converter                    # Use current directory  uvx huoshui-file-converter --dir /docs        # Use specific directory  uvx huoshui-file-converter -d ./project       # Use relative directory
Configuration Priority:  1. CLI argument (--dir/-d)  2. Environment variable (HUOSHUI_WORKING_DIR)  3. Current working directory

Error Handling

The server validates the working directory on startup:

✅ Working directory configured: /Users/name/Documents📂 Source: CLI argument

Common errors and solutions:

ErrorSolution
Directory not foundCreate directory or fix path
No write accessCheck permissions (chmod on Unix)
Path outside sandboxUse relative paths only

Development

Requirements

  • Python 3.8+
  • pypandoc
  • pandoc (system dependency)
  • LaTeX (for PDF conversion)

Testing

bash
# Test configurationuvx huoshui-file-converter --dir "/tmp/test"
# Check startup messages# ✅ Working directory configured: /tmp/test# 📂 Source: CLI argument

Documentation

License

[Your license here]

來源:README.md,提交 ba6cd8b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。