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 分

    请在仓库或注册中心条目中声明许可证。