1mvSya4nZm7JLwC0 4VVGZLUH7A0OeOKSYKNwqhCmxF+pOrfdqTHEbY1D0RGkoflhI9fAgvK+bkCZC+zjE8InmS o65+TV4NQ3D0V4hK5u3rplN+kWik0iIa2oafxMlM6cIcX1rSwOGQv+rZ5vUPpzF+Hry6nb 3L6hKZ7bQUFm3LKueDVaJ/KiPwd79fLe5VfQ6uyIwD8Vst0kb7p+gwh20b3vU9Q5UdiG4d Dj0HPCsqpzBxeRBcAylw0L6Q3BHnME8LDhZ2m9bUGAghtjFQwFUZvH/4YTySpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fr2hm57r2z111w for ; Tue, 07 Apr 2026 23:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25831 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 07 Apr 2026 23:39:04 +0000 To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: c9ecc8e87b3d - main - textproc/pymupdf4llm-mcp: New port: MCP server for pymupdf4llm: convert PDF to Markdown for LLMs List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9ecc8e87b3d1f21806d58e5e09465bdb3c3e589 Auto-Submitted: auto-generated Date: Tue, 07 Apr 2026 23:39:04 +0000 Message-Id: <69d59598.25831.2612bb25@gitrepo.freebsd.org> The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=c9ecc8e87b3d1f21806d58e5e09465bdb3c3e589 commit c9ecc8e87b3d1f21806d58e5e09465bdb3c3e589 Author: Yuri Victorovich AuthorDate: 2026-04-07 23:38:38 +0000 Commit: Yuri Victorovich CommitDate: 2026-04-07 23:39:01 +0000 textproc/pymupdf4llm-mcp: New port: MCP server for pymupdf4llm: convert PDF to Markdown for LLMs --- textproc/Makefile | 1 + textproc/pymupdf4llm-mcp/Makefile | 31 ++++++++++++++++++++++ textproc/pymupdf4llm-mcp/distinfo | 3 +++ .../files/patch-tests_test__tool.py | 26 ++++++++++++++++++ textproc/pymupdf4llm-mcp/pkg-descr | 10 +++++++ 5 files changed, 71 insertions(+) diff --git a/textproc/Makefile b/textproc/Makefile index aaf32ffe1d46..92d2035da077 100644 --- a/textproc/Makefile +++ b/textproc/Makefile @@ -1775,6 +1775,7 @@ SUBDIR += py-zensical SUBDIR += py-zope.i18nmessageid SUBDIR += py-zpt + SUBDIR += pymupdf4llm-mcp SUBDIR += qo SUBDIR += qprint SUBDIR += qr diff --git a/textproc/pymupdf4llm-mcp/Makefile b/textproc/pymupdf4llm-mcp/Makefile new file mode 100644 index 000000000000..aef95203bba3 --- /dev/null +++ b/textproc/pymupdf4llm-mcp/Makefile @@ -0,0 +1,31 @@ +PORTNAME= pymupdf4llm-mcp +DISTVERSION= 0.0.4 +CATEGORIES= textproc python +MASTER_SITES= PYPI +DISTNAME= ${PORTNAME:S/-/_/}-${DISTVERSION} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= MCP server for pymupdf4llm: convert PDF to Markdown for LLMs +WWW= https://github.com/pymupdf/pymupdf4llm-mcp + +LICENSE= AGPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatchling>0:devel/py-hatchling@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mcp>=1.6.0:misc/py-mcp@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pydantic2>=2.11.3:devel/py-pydantic2@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pymupdf4llm>=0.0.21:textproc/py-pymupdf4llm@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}typer>=0.15.2:devel/py-typer@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}inline-snapshot>0:devel/py-inline-snapshot@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pytest-asyncio>0.25.3:devel/py-pytest-asyncio@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist pep517 pytest + +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + +NO_ARCH= yes + +# tests as of 0.0.4: 1 passed in 0.22s + +.include diff --git a/textproc/pymupdf4llm-mcp/distinfo b/textproc/pymupdf4llm-mcp/distinfo new file mode 100644 index 000000000000..05b719312e6f --- /dev/null +++ b/textproc/pymupdf4llm-mcp/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1775602664 +SHA256 (pymupdf4llm_mcp-0.0.4.tar.gz) = 90bdf45b6cc1f867a84048d4804fc781aeacab90d3af79e94795c91448f65348 +SIZE (pymupdf4llm_mcp-0.0.4.tar.gz) = 71180 diff --git a/textproc/pymupdf4llm-mcp/files/patch-tests_test__tool.py b/textproc/pymupdf4llm-mcp/files/patch-tests_test__tool.py new file mode 100644 index 000000000000..e3afb4a6aaa1 --- /dev/null +++ b/textproc/pymupdf4llm-mcp/files/patch-tests_test__tool.py @@ -0,0 +1,26 @@ +--- tests/test_tool.py.orig 2026-04-07 22:59:54 UTC ++++ tests/test_tool.py +@@ -14,11 +14,9 @@ def test_convert_pdf_to_markdown(): + assert result["success"] is True + assert "markdown_content" in result + assert result["markdown_content"] == snapshot("""\ +-# **Dummy PDF file** ++**Dummy PDF file** + + +------ +- + """) + + # temporary file to write the markdown content +@@ -31,9 +29,7 @@ ----- + with open(temp_file_path, encoding="utf-8") as f: + content = f.read() + assert content == snapshot("""\ +-# **Dummy PDF file** ++**Dummy PDF file** + +- +------ + + """) diff --git a/textproc/pymupdf4llm-mcp/pkg-descr b/textproc/pymupdf4llm-mcp/pkg-descr new file mode 100644 index 000000000000..7b57cf16ef1f --- /dev/null +++ b/textproc/pymupdf4llm-mcp/pkg-descr @@ -0,0 +1,10 @@ +pymupdf4llm-mcp is an MCP (Model Context Protocol) server that exposes +pymupdf4llm functionality as tools for LLM agents. It allows AI assistants +to convert PDF documents to Markdown format, making them suitable for +processing by Large Language Models (LLMs) and Retrieval-Augmented Generation +(RAG) systems. + +The server provides tools for: +- Converting PDF files to Markdown with preserved structure +- Handling tables, images, and text formatting +- Saving converted Markdown to files