markitdown-mcp server binary and an MCP client wrapper.Series note
This writeup is Part 1 in a small exploration of using MarkItDown MCP in practical workflows.
Part 1: MarkItDown MCP: Local Wheel Install + Minimal Python CLI Wrapper
Covers local installation from a wheel package and wrapping MCP calls in a lightweight Python CLI for scriptable conversion.Part 2: MarkItDown MCP: Using Document Conversion in Agent Workflows
Covers exposing document conversion as a callable tool inside agent pipelines, where conversion becomes a reusable workflow step for summarization, extraction, indexing, and downstream reasoning.Part 1 is about making conversion callable from scripts.
Part 2 is about making conversion callable from agents.Same engine, different orchestra conductor πΌπ€
Model Context Protocol (MCP) is an open protocol for connecting AI models to external tools, data sources, and executable capabilities through a standard interface. Think of it as a common "tool bus" for AI applications, allowing models to discover and invoke tools consistently instead of relying on one-off custom integrations. :contentReference[oaicite:0]{index=0}
In this example, MarkItDown MCP exposes document conversion as an MCP tool, making PDF β Markdown conversion callable from scripts, editors, or agent workflows.
This writeup came out of solving three practical problems while working with VS Code + PDF->Markdown Conversion + MCP tooling:
Could not install the extension from VS Code Extension UI
The standard Extension Marketplace install path was unavailable in my corporate environment, so I needed a direct installation approach that bypassed editor-managed packaging.
Understanding MCP server setup
I wanted to understand the MCP server lifecycle end-to-end:
text
install β configure β launch β connect β invoke tools β handle failures
Working with a local wheel made the server binary explicit and controllable, instead of hiding it behind editor abstractions.
Creating a reusable MCP workflow via CLI wrapper
Once the server was running, the next goal was ergonomics:
convert documents with a simple command
A lightweight Python CLI wrapper became the cleanest interface.
In short:
Iβm always big on experimenting and automation, and this combination has been especially useful for trying ideas quickly, debugging when things go sideways, and turning repeatable work into something automated. βοΈπ±.
.whl# activate your venv first
pip install C:/path/to/markitdown_mcp-<version>-py3-none-any.whl
This creates a console entrypoint:
.../.venv/Scripts/markitdown-mcp.exe
input, --out, --server, --timeout)file:, http:, https:, data:)convert_to_markdownmarkitdown-mcp.session.list_tools() (exposed by the CLI as --list-tools) to discover the registered tool names from the specific MCP server being launched before calling convert_to_markdown.bash
python ai-ml/markitdown_mcp_client_convert.py \
--server "C:/.../.venv/Scripts/markitdown-mcp.exe" \
--list-tools
6. Extract text response block
7. Write Markdown to file (or stdout)
8. Return nonzero exit code on failure
result = await session.call_tool(
"convert_to_markdown",
{"uri": uri},
read_timeout_seconds=timedelta(seconds=timeout_seconds),
)
Note: the wrapper script is located in the
ai-mlfolder asmarkitdown_mcp_client_convert.py.
C:/.../.venv/Scripts/python.exe scripts/markitdown_mcp_client_convert.py ^
"docs/input.pdf" ^
--out "docs/input.from_mcp.md"
Here,
docs/input.pdfis the input PDF file anddocs/input.from_mcp.mdis the generated Markdown output file.
Installs into your Python environment, creates:
markitdown-mcp.exe
For Markdown conversion, this local server exposes the MCP tool:
convert_to_markdown
Version is pinned by the wheel package.
Editor-managed lifecycle and UX; package / binary location may be abstracted away.
For deterministic automation:
local wheel + virtual environment is usually the better fit.
--server configurable (do not permanently hardcode it)Anthropic, Introducing Model Context Protocol (official)
Model Context Protocol Overview
MCP Specification (GitHub)
https://github.com/modelcontextprotocol/specification
MCP Python SDK
https://github.com/modelcontextprotocol/python-sdk
Iβve always liked tools that can be taken apart, understood, and wired into something bigger.
This pattern turns MCP into exactly that: installable, inspectable, scriptable, and automatable.
A small tool, perhaps, but the kind that can grow roots and branch into all sorts of workflows π±