markitdown-directory-mcp

v0.1.0
markitdown-directory-mcp Checked 2 days ago Published 4 months ago

An MCP server that converts local files and directories to Markdown, built on the "markitdown" library.

An MCP server that converts local files to Markdown, built on the markitdown library. Designed for AI chat clients such as Cherry Studio: ask the model to convert a file by name, and the Markdown content is returned right into the conversation for the model to interpret. Image files (png, jpg, ...) are never converted — no image data ends up in the Markdown output — and files that are already Markdown are passed through.

Summary extracted from the README.

markitdown-directory-mcp

An MCP server that converts local files to Markdown, built on the markitdown library. Designed for AI chat clients such as Cherry Studio: ask the model to convert a file by name, and the Markdown content is returned right into the conversation for the model to interpret.

Tools

  • convert_file_to_markdown(file, max_chars) — convert ONE file (docx, pptx, xlsx, pdf, html, csv, txt, ...) to Markdown, write a sibling "<name>.md" file next to the source, and return the Markdown content directly. Prefer this when the user names a specific file.
  • convert_directory_to_markdown(directory, recursive, max_files) — batch convert EVERY supported file in a directory tree, writing sibling "<name>.md" files, and return a JSON summary (converted / skipped / failed).
  • read_markdown_file(path, start_char, max_chars) — read a generated .md file back, with paging for large files.

Image files (png, jpg, ...) are never converted — no image data ends up in the Markdown output — and files that are already Markdown are passed through.

Default directory

Set the environment variable MARKITDOWN_DEFAULT_DIR to a folder and the tools resolve bare file names against it (including a recursive exact-name fallback search), so users can just say report.docx instead of a full path.

Running

stdio (what most chat clients expect):

markitdown-directory-mcp

Over the network (SSE or streamable HTTP):

markitdown-directory-mcp --transport sse --host 0.0.0.0 --port 3001
# endpoints: http://<host>:3001/sse   (SSE)
#            http://<host>:3001/mcp   (streamable-http transport)

For LAN access, optionally pass e.g. --allowed-host '192.168.1.26:*' to keep DNS rebinding protection enabled for that host; without it the protection is disabled (with a warning) so remote Host headers are accepted. The server has no authentication — only expose it on networks you trust.

Client configuration

With uv installed, no manual installation is needed — point the client at PyPI via uvx:

{
  "mcpServers": {
    "markitdown-directory": {
      "command": "uvx",
      "args": ["markitdown-directory-mcp"],
      "env": {
        "MARKITDOWN_DEFAULT_DIR": "C:\\Users\\you\\Documents"
      }
    }
  }
}

Or install into an environment yourself and run the console script:

pip install markitdown-directory-mcp
markitdown-directory-mcp