Metadata-Version: 2.4
Name: markitdown-directory-mcp
Version: 0.1.0
Summary: An MCP server that converts local files and directories to Markdown, built on the "markitdown" library.
License-Expression: MIT
Keywords: file-conversion,markdown,markitdown,mcp
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.10
Requires-Dist: markitdown[audio-transcription,docx,outlook,pdf,pptx,xls,xlsx,youtube-transcription]<0.2.0,>=0.1.6
Requires-Dist: mcp<2.0.0,>=1.28.1
Description-Content-Type: text/markdown

# markitdown-directory-mcp

An [MCP](https://modelcontextprotocol.io) server that converts local files to
Markdown, built on the [markitdown](https://github.com/microsoft/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):

```bash
markitdown-directory-mcp
```

Over the network (SSE or streamable HTTP):

```bash
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](https://docs.astral.sh/uv/) installed, no manual installation is
needed — point the client at PyPI via `uvx`:

```json
{
  "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:

```bash
pip install markitdown-directory-mcp
markitdown-directory-mcp
```
