io.github.huoshuiai42/huoshui-file-converter

效率与工作流

by huoshuiai42

提供文档格式转换能力的 MCP 服务,可在常见文件类型之间快速完成转换处理。

什么是 io.github.huoshuiai42/huoshui-file-converter

提供文档格式转换能力的 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 directory
uvx huoshui-file-converter

# Specify working directory (recommended)
uvx huoshui-file-converter --dir "/path/to/documents"

# Short form
uvx 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 variable
export HUOSHUI_WORKING_DIR="/project/docs"
uvx huoshui-file-converter

# Current directory fallback
cd /project/docs
uvx 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:

code
✅ 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 configuration
uvx huoshui-file-converter --dir "/tmp/test"

# Check startup messages
# ✅ Working directory configured: /tmp/test
# 📂 Source: CLI argument

Documentation

License

[Your license here]

常见问题

io.github.huoshuiai42/huoshui-file-converter 是什么?

提供文档格式转换能力的 MCP 服务,可在常见文件类型之间快速完成转换处理。

相关 Skills

技能工坊

by anthropics

Universal
热门

覆盖 Skill 从创建到迭代优化全流程:起草能力、补测试提示、跑评测与基准方差分析,并持续改写内容和描述,提升效果与触发准确率。

技能工坊把技能从创建、迭代到评测串成闭环,方差分析加描述优化,特别适合把触发准确率打磨得更稳。

效率与工作流
未扫描150.9k

PPT处理

by anthropics

Universal
热门

处理 .pptx 全流程:创建演示文稿、提取和解析幻灯片内容、批量修改现有文件,支持模板套用、合并拆分、备注评论与版式调整。

涉及PPTX的创建、解析、修改到合并拆分都能一站搞定,连备注、模板和评论也能处理,做演示文稿特别省心。

效率与工作流
未扫描150.9k

PDF处理

by anthropics

Universal
热门

遇到 PDF 读写、文本表格提取、合并拆分、旋转加水印、表单填写或加解密时直接用它,也能提取图片、生成新 PDF,并把扫描件通过 OCR 变成可搜索文档。

PDF杂活别再来回切工具了,文本表格提取、合并拆分到OCR识别一次搞定,连扫描件也能变可搜索。

效率与工作流
未扫描150.9k

相关 MCP Server

文件系统

编辑精选

by Anthropic

热门

Filesystem 是 MCP 官方参考服务器,让 LLM 安全读写本地文件系统。

这个服务器解决了让 Claude 直接操作本地文件的痛点,比如自动整理文档或生成代码文件。适合需要自动化文件处理的开发者,但注意它只是参考实现,生产环境需自行加固安全。

效率与工作流
87.2k

by wonderwhy-er

热门

Desktop Commander 是让 AI 直接执行终端命令、管理文件和进程的 MCP 服务器。

这工具解决了 AI 无法直接操作本地环境的痛点,适合需要自动化脚本调试或文件批量处理的开发者。它能让你用自然语言指挥终端,但权限控制需谨慎,毕竟让 AI 执行 rm -rf 可不是闹着玩的。

效率与工作流
6.2k

by stickerdaniel

热门

LinkedIn Profile and Job Scraper 是让 Claude 直接抓取 LinkedIn 个人资料、公司信息和职位详情的工具。

这个服务器解决了招聘和商业调研中手动复制粘贴 LinkedIn 数据的痛点,适合猎头或市场分析师快速获取候选人背景和公司动态。不过,LinkedIn 反爬机制频繁更新,数据稳定性需要持续维护,使用时建议搭配人工验证。

效率与工作流
2.4k

评论