markdownify-mcp

zcaceresMIT活跃维护

把网页、PDF、图片、音频等各类内容统一转成 Markdown 的 MCP 服务,让 Claude 等模型能直接读取和整理这些格式的资料。

A Model Context Protocol server for converting almost anything to Markdown

v1.1.0发布于 2026-05-01 21:05 UTC3,004star +1 / 7 天254fork同步于 2026-11-10 17:44 UTC

怎么上手

由 README 提炼,执行前请确认
bun install
bun run build
bun start
硬件要求按 README 说明

README 未说明硬件要求;本地安装依赖 bun 与 Python 虚拟环境,Docker 镜像可直接运行。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把 PDF、图片、音视频、网页等几乎任何内容转成 Markdown 的 MCP 服务器

把网页、PDF、图片、音频等各类内容统一转成 Markdown 的 MCP 服务,让 Claude 等模型能直接读取和整理这些格式的资料。

核心能力

  • 支持 PDF、DOCX、XLSX、PPTX 转 Markdown
  • 音频转写与图片元数据提取成 Markdown
  • 抓取网页、YouTube 字幕和 Bing 搜索结果转 Markdown
  • 用 MD_ALLOWED_PATHS 限制文件读取目录
  • 提供 Docker 镜像与桌面 App 配置方式

容易踩的坑

bun install 的 preinstall 会创建 .venv 并安装 markitdown[all],需本机有 Python 环境;官方 Docker 镜像只装 markitdown[pdf],音频转写和图片 OCR 会失败;Docker 中需把宿主机目录挂载进容器并传容器内路径,同时设置 MD_ALLOWED_PATHS。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.1.0
  1. v1.1.0最新正式版2026-05-01 · 2026-05-01 21:05 UTC

    Path-resolution overhaul to make Docker (and any non-default install layout) frictionless. Closes #97 via #98.

    What's new

    • MARKITDOWN_PATH env var. Defaults to <project>/.venv/bin/markitdown, falls back to a bare-name PATH lookup. Lets pipx install "markitdown[pdf]" or any system install work without a project venv.
    • REPOMIX_PATH env var. Same shape, for git-repo-to-markdown.
    • MD_ALLOWED_PATHS env var (path-delimiter-separated). Enforced on every filepath-accepting tool, not just get-markdown-file. MD_SHARE_DIR kept as a single-dir backward-compat alias.
    • Docker volume-mount example in the README, aligned with the markdownify.paths field on the Docker MCP catalog config page.
    • New scripts/docker-smoke-test.sh: builds the image, mounts a sample dir, calls pdf-to-markdown over the MCP stdio transport, asserts the response.

    Fixes

    • Stop treating non-empty stderr from markitdown as fatal — it emits non-fatal warnings on every successful run (onnxruntime cpuid, pydub ffmpeg-missing). Exit code is the real signal.
    • Add .dockerignore so COPY . . no longer drags the host's .venv and node_modules into the build context.
    • Replace stale UV_PATH docs (the code stopped using uv several versions ago).

    Breaking changes

    • projectRoot removed from the MCP tool input schema. It was client-controllable, so any MCP client could force the server to exec <arbitrary>/.venv/bin/markitdown. No legitimate client should have been using it. If you need to override the project root, set MARKITDOWN_PATH directly.
  2. v1.0.42026-04-17 · 2026-04-17 21:31 UTC
    查看更新说明

    Bug Fix

    • Fix Docker image crash on Apple Silicon/ARM by using markitdown[pdf] instead of markitdown[all]. The [all] extra pulled in unnecessary dependencies (SpeechRecognition/pydub/ffmpeg) that caused failures on ARM containers. PDF support is retained. (Fixes #95)
  3. v1.0.32026-04-02 · 2026-04-02 13:16 UTC
    查看更新说明

    Bug Fix

    • Fix missing PDF/DOCX/PPTX/XLSX converter dependencies after upstream markitdown moved them to optional extras in v0.1.0. All install paths (setup.sh, setup.bat, Dockerfile, pyproject.toml) now use markitdown[all]. (thanks @rubzo — #92)
  4. v1.0.22026-03-27 · 2026-03-27 17:36 UTC
    查看更新说明

    Changes

    • Upgrade TypeScript from 5.9.3 to 6.0.2
    • Add missing test.pdf sample data (fixes broken test)
    • Add CLAUDE.md project configuration
  5. v1.0.12026-03-27 · 2026-03-27 17:16 UTC
    查看更新说明

    Security

    • Bump requests from 2.32.5 to 2.33.0 — fixes insecure temp file reuse in extract_zipped_paths() (medium severity)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Markdownify MCP Server

    markdownify mcp logo

    Markdownify is a Model Context Protocol (MCP) server that converts various file types and web content to Markdown format. It provides a set of tools to transform PDFs, images, audio files, web pages, and more into easily readable and shareable Markdown text.

    Features

    • Convert multiple file types to Markdown:
      • PDF
      • Images
      • Audio (with transcription)
      • DOCX
      • XLSX
      • PPTX
    • Convert web content to Markdown:
      • YouTube video transcripts
      • Bing search results
      • General web pages
    • Retrieve existing Markdown files

    Getting Started

    1. Clone this repository

    2. Install dependencies:

      bun install
      

      The preinstall step creates a Python virtual environment at .venv and installs markitdown[all].

    3. Build the project:

      bun run build
      
    4. Start the server:

      bun start
      

    Development

    • Use bun run dev to start the TypeScript compiler in watch mode
    • Modify src/server.ts to customize server behavior
    • Add or modify tools in src/tools.ts

    Usage with Desktop App

    To integrate this server with a desktop app, add the following to your app's server configuration:

    {
      "mcpServers": {
        "markdownify": {
          "command": "node",
          "args": [
            "{ABSOLUTE PATH TO FILE HERE}/dist/index.js"
          ]
        }
      }
    }
    

    Environment variables

    All paths default to sensible values; override only when the defaults don't fit your install layout.

    VariableDefaultPurpose
    MARKITDOWN_PATH<project>/.venv/bin/markitdown, then markitdown on PATHAbsolute path to the markitdown executable. Set this when you've installed markitdown system-wide (e.g. pipx install "markitdown[pdf]") instead of using the bundled venv.
    REPOMIX_PATH<project>/node_modules/.bin/repomix, then repomix on PATHAbsolute path to the repomix executable used by git-repo-to-markdown.
    MD_ALLOWED_PATHSunset (unrestricted)Path-delimiter-separated list (: on POSIX, ; on Windows) of directories the server is allowed to read. When set, all file-input tools (pdf-to-markdown, get-markdown-file, etc.) reject paths outside these directories.
    MD_SHARE_DIRunsetDeprecated alias for MD_ALLOWED_PATHS (single directory). Still honored for backward compatibility.

    Usage with Docker

    Build and run:

    docker build -t markdownify-mcp .
    docker run --rm -i \
      -v "$HOME/Documents:/data:ro" \
      -e MD_ALLOWED_PATHS=/data \
      markdownify-mcp
    

    Notes for the Docker MCP catalog (mcp/markdownify):

    • Mount any host directories you want the server to read into the container, then pass the container paths to the tools (e.g. /data/foo.pdf, not /Users/you/Documents/foo.pdf).
    • Set MD_ALLOWED_PATHS to the colon-separated list of mounted directories so the server enforces a read boundary that matches the bind mount.
    • The published Docker image installs markitdown[pdf] only — audio transcription and image OCR (audio-to-markdown, image-to-markdown) require the [all] extras and will fail in the slim image. Use the local install (bun install) for the full feature set.

    Available Tools

    • youtube-to-markdown: Convert YouTube videos to Markdown

    • pdf-to-markdown: Convert PDF files to Markdown

    • bing-search-to-markdown: Convert Bing search results to Markdown

    • webpage-to-markdown: Convert web pages to Markdown

    • image-to-markdown: Convert images to Markdown with metadata

    • audio-to-markdown: Convert audio files to Markdown with transcription

    • docx-to-markdown: Convert DOCX files to Markdown

    • xlsx-to-markdown: Convert XLSX files to Markdown

    • pptx-to-markdown: Convert PPTX files to Markdown

    • get-markdown-file: Retrieve an existing Markdown file. File extension must end with: *.md, *.markdown.

      OPTIONAL: set MD_ALLOWED_PATHS to restrict every file-input tool to a list of directories, e.g. MD_ALLOWED_PATHS=/data/in:/data/out bun start.

    Contributing

    Contributions are welcome! Please feel free to submit a Pull Request.

    License

    This project is licensed under the MIT License - see the LICENSE file for details.