Skip to content

feat: replace Python markitdown with markitdown-typescript - #88

Open
zcaceres wants to merge 3 commits into
mainfrom
feat/replace-python-with-ts
Open

feat: replace Python markitdown with markitdown-typescript#88
zcaceres wants to merge 3 commits into
mainfrom
feat/replace-python-with-ts

Conversation

@zcaceres

Copy link
Copy Markdown
Owner

Summary

  • Replaces the Python markitdown subprocess dependency with the native TypeScript library (markitdown-typescript), eliminating the Python runtime requirement
  • URLs are now converted directly by the library instead of download → temp file → subprocess → cleanup
  • Removes all Python infrastructure: preinstall.js, setup.sh, setup.bat, pyproject.toml, .python-version, uv.lock, and Python venv from Dockerfile
  • Adds regression tests for output quality, URL conversions, SSRF protection, error wrapping, and HTML passthrough

⚠️ BLOCKER: markitdown-typescript is currently a local file dependency (file:../markitdown-ts). Must be published to npm and switched to a version range before merging.

Test plan

  • All 70 tests pass (41 integration + 29 unit)
  • Build passes cleanly with zero TypeScript errors
  • Verify PDF, DOCX, XLSX, PPTX conversions produce equivalent output to Python version
  • Verify URL-based tools (YouTube, Bing, webpage) work end-to-end via MCP client
  • Publish markitdown-typescript to npm and update dependency before merge

Swap the Python markitdown subprocess dependency for the native
TypeScript library (markitdown-typescript), eliminating the need for
a Python runtime, virtual environment, and setup scripts.

- Replace _markitdown() subprocess call with createMarkItDown().convert()
- URL conversions pass URLs directly to library (no temp file dance)
- Remove Python infrastructure: preinstall.js, setup.sh, setup.bat,
  pyproject.toml, .python-version, uv.lock
- Simplify Dockerfile (no Python layer)
- Remove unused utils (isUnconvertedHtml, inferExtensionFromUrl)
- Replace placeholder test fixtures with real document files
- Add regression tests: output quality, URL conversions, SSRF
  protection, error wrapping, HTML passthrough guard

NOTE: markitdown-typescript is currently linked as a local file
dependency — must be published to npm before merging.
- Remove unused safeFetch() method (markitdown-ts handles URLs internally)
- Remove projectRoot ghost parameter from toMarkdown(), server schema, and tests
- Update README: pnpm → bun, remove Python/uv references and UV_PATH config
- Remove .venv from .gitignore
Use HTML fixtures with streamInfo URL hints to exercise the
YouTube and Bing SERP-specific converters without network calls.
Tests verify metadata extraction, search result parsing, Bing
redirect URL decoding, and SVG data URI stripping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant