Files
Chien Yuan Changandafourney 24c14c6ba5 Fix typos and formatting in comments, docstrings, and markdown (#2223)
* Fix typos and formatting in comments, docstrings, and markdown files

Comment/docstring typo fixes:
- _base_converter.py: fix 'steam_info' -> 'stream_info', missing 'on',
  duplicated 'MUST be reset', 'advances' -> 'advance',
  'used to in cases' -> 'used in cases', 'charset, set' -> 'charset, etc.'
- _markitdown.py: 'legaxy' -> 'legacy', 'User' -> 'Use' in DEPRECATED
  docstring, second 'PRIORITY_SPECIFIC_FILE_FORMAT (== 10)' ->
  'PRIORITY_GENERIC_FILE_FORMAT (== 10)', 'Plugins converters' ->
  'Plugin converters'
- __main__.py: 'e.g,' -> 'e.g.,' in --charset help
- _exceptions.py: 'an a single' -> 'a single'
- _docx_converter.py, _epub_converter.py: 'e.g.m headings' ->
  'e.g., headings'
- _epub_converter.py: remove stray closing triple-quote in comment
- _outlook_msg_converter.py: 'Brue force' -> 'Brute force'
- _markdownify.py: 'Javascript' -> 'JavaScript'
- _bing_serp_converter.py: remove stray '"' in Base64URL comment
- sample plugin _plugin.py: 'RTF file to in the simplest' ->
  'RTF file in the simplest'; 'into an str using hte' ->
  'into a str using the'

Markdown formatting fixes:
- README.md: 'Youtube URLs' -> 'YouTube URLs'
- markitdown-mcp/README.md: remove trailing tab characters after
  ```bash code fences; convert tab-indented JSON array elements to
  8-space indentation for consistency
- markitdown-sample-plugin/README.md: 'Next, implement' -> 'First,
  implement' for the initial step (no prior step exists); normalize
  tab-indented lines inside Python code samples to 4/8-space
  indentation; strip trailing spaces

* Fix typos found by codespell in tests and doc intel converter

Test files:
- test_sample_plugin.py: 'dirctly' -> 'directly'
- test_cli_vectors.py: 'readds' -> 'reads'
- test_module_misc.py: 'targted' -> 'targeted' (2 occurrences)

Source files:
- _doc_intel_converter.py: 'availiable' -> 'available' in docstring

Verified clean with:
  codespell --skip='.git,test_files,ThirdPartyNotices.md,SECURITY.md,\
    SUPPORT.md,CODE_OF_CONDUCT.md,latex_dict.py,omml.py,ocr_test_data,\
    *.pdf,*.docx,*.pptx,*.xlsx,*.xls,*.png,*.jpg,*.jpeg,*.wav,*.mp3,\
    *.mp4,*.zip,*.epub,*.msg,*.rtf' packages/ README.md

* fix DocumentConverter.PRIORITY_* references

* Quote install commands so they work in zsh; MarkItdown->MarkItDown

In zsh (default macOS shell since 2019, default on many Linux distros),
`[` and `]` are pathname-expansion metacharacters, so `pip install
markitdown[all]` fails with:

    zsh: no matches found: markitdown[all]

The top-level README.md already uses the quoted form
(`pip install 'markitdown[all]'`) throughout. This commit brings the
package README and two user-facing dependency-missing error messages
into alignment with that convention, so users copy-pasting from PyPI
or from a raised MissingDependencyException get a command that works
in every mainstream shell.

- packages/markitdown/README.md: quote the PyPI install and the
  editable-install-from-source example.
- _exceptions.py: quote the three `pip install` examples inside
  MISSING_DEPENDENCY_MESSAGE (shown to end users when an optional
  converter dep is missing).
- _transcribe_audio.py: quote the two `pip install` examples in
  the raised MissingDependencyException text, and fix a lowercase
  'MarkItdown' -> 'MarkItDown' product-name typo in the same string.

Bash/sh/dash treat quoted and unquoted forms identically, so this is
a strict improvement.

Independently proposed by community PRs #1172, #1577, #1602, and #2062
(all still open); fixes referenced issue #1574. Consolidating here to
resolve them in one place alongside the wider prose cleanup.

* Strip trailing whitespace from prose in top-level and package READMEs

Three stray single trailing spaces at end of prose lines:

- README.md (Security Considerations section):
  * end of the 'MarkItDown performs I/O...' paragraph
  * end of the 'Sanitize your inputs:' paragraph
- packages/markitdown/README.md:
  * end of the [!TIP] callout description line

Some Markdown renderers (and Markdown Lint / Prettier / etc.) treat a
trailing double-space as an explicit line break, so accidental single
trailing spaces show up as diff noise on every unrelated edit. They
also make grep/regex line-ends less reliable.

Prose-only change, no rendering impact intended.

Proposed by community PR #1838 (only the whitespace part; that PR
also unrelated changes that blocked it from merging).

* Quote remaining install commands in _cu_converter and _doc_intel_converter

Final-audit pass caught three install-command hints missed by the
earlier commit (cc9202b), which had only picked up the sites listed
in community PR #2062. Same zsh/PowerShell glob-metacharacter bug,
same fix (single-quote the [extras]):

- _cu_converter.py module docstring:
  "Install dependencies: ``pip install 'markitdown[az-content-understanding]'``"
- _cu_converter.py MissingDependencyException raised at __init__:
  "E.g., `pip install 'markitdown[az-content-understanding]'`"
- _doc_intel_converter.py MissingDependencyException raised at __init__:
  "E.g., `pip install 'markitdown[az-doc-intel]'`"

After this commit, no unquoted `pip install ...[extras]` remains
anywhere in READMEs, docstrings, comments, or user-visible error
messages. Consistent with the top-level README convention.

---------

Co-authored-by: afourney <adamfo@microsoft.com>
2026-07-21 14:31:52 -07:00

5.0 KiB

MarkItDown-MCP

Important

The MarkItDown-MCP package is meant for local use, with local trusted agents. In particular, when running the MCP server with Streamable HTTP or SSE, it binds to localhost by default, and is not exposed to other machines on the network or Internet. In this configuration, it is meant to be a direct alternative to the STDIO transport, which may be more convenient in some cases. DO NOT bind the server to other interfaces unless you understand the security implications of doing so.

PyPI PyPI - Downloads Built by AutoGen Team

The markitdown-mcp package provides a lightweight STDIO, Streamable HTTP, and SSE MCP server for calling MarkItDown.

It exposes one tool: convert_to_markdown(uri), where uri can be any http:, https:, file:, or data: URI.

Installation

To install the package, use pip:

pip install markitdown-mcp

Usage

To run the MCP server, using STDIO (default), use the following command:

markitdown-mcp

To run the MCP server, using Streamable HTTP and SSE, use the following command:

markitdown-mcp --http --host 127.0.0.1 --port 3001

Running in Docker

To run markitdown-mcp in Docker, build the Docker image using the provided Dockerfile:

docker build -t markitdown-mcp:latest .

And run it using:

docker run -it --rm markitdown-mcp:latest

This will be sufficient for remote URIs. To access local files, you need to mount the local directory into the container. For example, if you want to access files in /home/user/data, you can run:

docker run -it --rm -v /home/user/data:/workdir markitdown-mcp:latest

Once mounted, all files under data will be accessible under /workdir in the container. For example, if you have a file example.txt in /home/user/data, it will be accessible in the container at /workdir/example.txt.

Accessing from Claude Desktop

It is recommended to use the Docker image when running the MCP server for Claude Desktop.

Follow these instructions to access Claude's claude_desktop_config.json file.

Edit it to include the following JSON entry:

{
  "mcpServers": {
    "markitdown": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "markitdown-mcp:latest"
      ]
    }
  }
}

If you want to mount a directory, adjust it accordingly:

{
  "mcpServers": {
    "markitdown": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "/home/user/data:/workdir",
        "markitdown-mcp:latest"
      ]
    }
  }
}

Debugging

To debug the MCP server you can use the MCP Inspector tool.

npx @modelcontextprotocol/inspector

You can then connect to the inspector through the specified host and port (e.g., http://localhost:5173/).

If using STDIO:

  • select STDIO as the transport type,
  • input markitdown-mcp as the command, and
  • click Connect

If using Streamable HTTP:

  • select Streamable HTTP as the transport type,
  • input http://127.0.0.1:3001/mcp as the URL, and
  • click Connect

If using SSE:

  • select SSE as the transport type,
  • input http://127.0.0.1:3001/sse as the URL, and
  • click Connect

Finally:

  • click the Tools tab,
  • click List Tools,
  • click convert_to_markdown, and
  • run the tool on any valid URI.

Security Considerations

The server does not support authentication, and runs with the privileges of the user running it. For this reason, when running in SSE or Streamable HTTP mode, the server binds by default to localhost. Even still, it is important to recognize that the server can be accessed by any process or users on the same local machine, and that the convert_to_markdown tool can be used to read any file that the server's user has access to, or any data from the network. If you require additional security, consider running the server in a sandboxed environment, such as a virtual machine or container, and ensure that the user permissions are properly configured to limit access to sensitive files and network segments. Above all, DO NOT bind the server to other interfaces (non-localhost) unless you understand the security implications of doing so.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.