ConvertAgent

ConvertAgent

File conversion built for AI agents. CLI, REST API, and MCP server — all sharing one engine.

Category
访问服务器

README

<p align="center"> <img src="assets/banner.svg" alt="ConvertAgent — File conversion built for AI agents" width="800"/> </p>

<p align="center"> <strong>File conversion built for AI agents.</strong> CLI, REST API, and MCP server — all sharing one engine. </p>

<p align="center"> <img src="https://img.shields.io/badge/version-0.1.0-blue?style=flat-square" alt="Version"/> <img src="https://img.shields.io/badge/tests-20%2F20_passing-brightgreen?style=flat-square" alt="Tests"/> <img src="https://img.shields.io/badge/MCP-compatible-8b5cf6?style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiPjxwYXRoIGQ9Ik0xMiAydjIwTTIgMTJoMjAiLz48L3N2Zz4=" alt="MCP Compatible"/> <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License"/> <img src="https://img.shields.io/badge/node-%3E%3D22-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node"/> <img src="https://img.shields.io/badge/engines-FFmpeg%20·%20LibreOffice%20·%20ImageMagick%20·%20Pandoc-orange?style=flat-square" alt="Engines"/> </p>

<p align="center"> <a href="#-quick-start">Quick Start</a> · <a href="#-api-reference">API Reference</a> · <a href="#-mcp-server">MCP Server</a> · <a href="#-supported-conversions">Formats</a> · <a href="#%EF%B8%8F-architecture">Architecture</a> · <a href="#-roadmap">Roadmap</a> </p>


ConvertAgent is a self-hosted, open-source file conversion toolkit designed for AI agents. Your files never leave your infrastructure — no cloud uploads, no API keys, no per-conversion fees, no usage limits. Just install, run, and convert. CLI for local agents, REST API for remote access, and MCP for the agent ecosystem.

Self-hosted. Open source. Zero cost per conversion. Your agent converts files locally — no cloud, no limits, no vendor lock-in.


✨ Features

  • 🖥️ CLI-first — convertagent convert file.pdf --to docx — the native interface for agents
  • 🌐 REST API — POST /v1/convert for remote agents and web services
  • 🔌 MCP Server — Discoverable by any MCP-compatible AI client (Claude, ChatGPT, Cursor, etc.)
  • ⚡ One dispatcher — All three interfaces share the same conversion engine
  • 📦 20 conversion pairs across documents, images, audio/video, and text
  • 🔧 Open-source engines — FFmpeg, LibreOffice, ImageMagick, Pandoc under the hood
  • 🚀 Self-hosted — Your files never leave your infrastructure

📋 Supported Conversions

Category Conversions
Documents pdf→docx · docx→pdf · html→pdf · md→pdf · md→html · md→docx · xlsx→csv · csv→xlsx · pptx→pdf
Images jpg→png · png→jpg · png→webp · webp→png · svg→png · image-resize · image-compress
Audio/Video mp4→mp3 · wav→mp3 · mp4→gif · any-video→mp4

🚀 Quick Start

Prerequisites

# Install conversion engines (Ubuntu/Debian)
sudo apt-get update && sudo apt-get install -y ffmpeg libreoffice imagemagick pandoc

Install & Run

git clone https://github.com/vid-factory/convertagent.git
cd convertagent
npm install
npm run build

CLI Usage

# Convert a PDF to Word
convertagent convert report.pdf --to docx

# Convert with custom output path
convertagent convert photo.png --to webp --output ./compressed.webp

# Extract audio from video
convertagent convert video.mp4 --to mp3

# List all supported formats
convertagent formats

# Check engine health
convertagent health

Start the API Server

# Start on default port 3001
node dist/api/server.js

# Or with custom port
PORT=8080 node dist/api/server.js

📡 API Reference

POST /v1/convert

Convert a file from one format to another.

Request:

{
  "action": "pdf-to-docx",
  "source": "/path/to/file.pdf",
  "options": {}
}

With URL source:

{
  "action": "html-to-pdf",
  "source_url": "https://example.com/page.html",
  "options": {}
}

With base64 source:

{
  "action": "jpg-to-png",
  "source_base64": "data:image/jpeg;base64,/9j/4AAQ...",
  "options": {}
}

Response:

{
  "success": true,
  "job_id": "a1b2c3d4",
  "artifact": {
    "path": "/output/a1b2c3d4.docx",
    "url": "/v1/artifacts/a1b2c3d4",
    "format": "docx",
    "size": 45231,
    "duration_ms": 1200
  }
}

GET /v1/formats

List all supported conversion pairs.

GET /health

Check engine availability.

{
  "ok": true,
  "service": "convertagent",
  "engines": {
    "ffmpeg": true,
    "libreoffice": true,
    "imagemagick": true,
    "pandoc": true
  }
}

🔌 MCP Server

ConvertAgent exposes an MCP server for integration with any MCP-compatible AI client.

Available Tools

Tool Description
convert_file Convert a file from one format to another
list_formats List all supported conversion format pairs

Connect via MCP

{
  "mcpServers": {
    "convertagent": {
      "url": "http://localhost:3001/mcp"
    }
  }
}

Example: Claude Desktop

Add to your Claude Desktop MCP config:

{
  "mcpServers": {
    "convertagent": {
      "command": "node",
      "args": ["/path/to/convertagent/dist/mcp/server.js"]
    }
  }
}

🏗️ Architecture

┌─────────────────────────────────────────────────────┐
│                    ConvertAgent                       │
│                                                       │
│  ┌─────────┐  ┌─────────┐  ┌─────────┐              │
│  │   CLI   │  │   API   │  │   MCP   │  ← Interfaces│
│  └────┬────┘  └────┬────┘  └────┬────┘              │
│       │            │            │                     │
│       └────────────┼────────────┘                     │
│                    │                                  │
│           ┌────────▼────────┐                         │
│           │   Dispatcher    │  ← Shared routing core  │
│           └────────┬────────┘                         │
│                    │                                  │
│    ┌───────┬───────┼───────┬────────┐                │
│    │       │       │       │        │                │
│  ┌─▼──┐ ┌─▼──┐ ┌──▼──┐ ┌─▼────┐   │                │
│  │ FF │ │ LO │ │ IM  │ │ Pan  │   │  ← Engines     │
│  │mpeg│ │    │ │     │ │ doc  │   │                 │
│  └────┘ └────┘ └─────┘ └──────┘   │                │
│                                     │                │
│  FF = FFmpeg    LO = LibreOffice    │                │
│  IM = ImageMagick  Pan = Pandoc     │                │
└─────────────────────────────────────────────────────┘

🐳 Docker (Coming Soon)

docker run -p 3001:3001 vid-factory/convertagent

🛠️ Development

# Clone
git clone https://github.com/vid-factory/convertagent.git
cd convertagent

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run the full 20-pair conversion test matrix
node scripts/run-tea-20.mjs

Project Structure

convertagent/
├── src/
│   ├── cli/              # CLI commands (convert, formats, health)
│   ├── api/              # REST API server (Fastify)
│   ├── mcp/              # MCP server (Streamable HTTP)
│   ├── core/             # Shared dispatcher + format registry
│   ├── engines/          # Engine adapters
│   │   ├── ffmpeg.ts     # Audio/video conversions
│   │   ├── libreoffice.ts# Document conversions
│   │   ├── imagemagick.ts# Image conversions
│   │   ├── pandoc.ts     # Text/markup conversions
│   │   └── shell.ts      # Shared shell runner with timeouts
│   └── tests/            # Unit + integration tests
├── scripts/              # TEA matrix runner, utilities
├── test-assets/          # Real input files for testing
├── test-artifacts/       # TEA results + parity evidence
├── deploy/               # systemd service file
├── package.json
├── tsconfig.json
└── README.md

📊 Test Results

ConvertAgent ships with a full real-file test matrix — no mocks.

Pair Status Engine
pdf→docx ✅ Pass LibreOffice
docx→pdf ✅ Pass LibreOffice
html→pdf ✅ Pass Pandoc
md→pdf ✅ Pass Pandoc
md→html ✅ Pass Pandoc
md→docx ✅ Pass Pandoc
xlsx→csv ✅ Pass LibreOffice
csv→xlsx ✅ Pass LibreOffice
pptx→pdf ✅ Pass LibreOffice
jpg→png ✅ Pass ImageMagick
png→jpg ✅ Pass ImageMagick
png→webp ✅ Pass ImageMagick
webp→png ✅ Pass ImageMagick
svg→png ✅ Pass ImageMagick
image-resize ✅ Pass ImageMagick
image-compress ✅ Pass ImageMagick
mp4→mp3 ✅ Pass FFmpeg
wav→mp3 ✅ Pass FFmpeg
mp4→gif ✅ Pass FFmpeg
any-video→mp4 ✅ Pass FFmpeg

20/20 passing — verified across CLI, API, and MCP interfaces with binary parity checks.


🗺️ Roadmap

  • [x] CLI interface with 20 conversion pairs
  • [x] REST API (/v1/convert, /v1/formats, /health)
  • [x] MCP server with tool discovery + execution
  • [x] Real-file TEA test matrix (20/20)
  • [x] Cross-interface parity verification (CLI = API = MCP)
  • [x] systemd deployment for persistence
  • [ ] URL source intake (fetch remote files for conversion)
  • [ ] Docker image for one-command deployment
  • [ ] OpenClaw skill package (publish to ClawHub)
  • [ ] Claw Mart marketplace listing
  • [ ] Pipeline endpoint (chain multiple conversions)
  • [ ] npm global install (npm install -g convertagent)
  • [ ] Usage tracking + rate limiting
  • [ ] Additional format pairs (50+)

🤝 Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/new-format-pair)
  3. Write tests for new conversions (use real files, not mocks)
  4. Run the full TEA matrix (node scripts/run-tea-20.mjs)
  5. Commit with conventional commits (feat:, fix:, docs:, test:)
  6. Open a Pull Request

Adding a New Conversion Pair

  1. Add the format pair to src/core/formats.ts
  2. Implement or extend the appropriate engine adapter in src/engines/
  3. Add a real test input file to test-assets/input/
  4. Add the pair to the TEA matrix in scripts/run-tea-20.mjs
  5. Run tests and verify output

📄 License

MIT License — see LICENSE for details.


🙏 Acknowledgments


<p align="center"> Built by <a href="https://github.com/vid-factory">vid-factory</a> — Agent infrastructure for the AI era. </p>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选