home / mcp / md2img mcp server
MCP for converting markdown formatted text into images.
Configuration
View docs{
"mcpServers": {
"adolphnb-md2img-mcp": {
"command": "uv",
"args": [
"run",
"python",
"start_mcp_server.py"
]
}
}
}You run a word2img MCP server that renders Markdown text into high-quality 3:4 JPG images. It supports multiple rendering backends and automatically picks the best available option to ensure your images are produced reliably, with flexible styles and full Chinese font support.
You will submit Markdown text to the MCP server and receive an image in return. The service exposes two practical actions: submit_markdown to process the input and get_image to retrieve the resulting image by its task ID. Use the local MCP runtime to start one of the provided server entry points, then issue requests from your client or automation to request image generation.
Prerequisites you need before starting: - Python 3.x installed - uv tool installed (for managing MCP services) - If you plan to use the preferred rendering backend imgkit with wkhtmltopdf, install wkhtmltopdf on your system Install and prepare the environment step by step:
pipx install uv
```
```
# Install dependencies for the preferred backends
uv sync
# Install imgkit backend and markdown support (recommended)
uv add imgkit markdown
# Install wkhtmltopdf on your OS follow the platform specifics
# Windows: from wkhtmltopdf.org
# macOS: brew install wkhtmltopdf
# Ubuntu: sudo apt-get install wkhtmltopdfTo run a demonstration of the imgkit backend and start the MCP service locally, you can use one of the following entry points. Each starts a local MCP server that you can connect to from a client.
uv run python start_mcp_server.py
```
```
uv run python -m word2img_mcp
```
```
uv run python server.pyChoose one of the following startup commands to run the MCP service locally. Each command launches a full server process that listens for requests from clients.
{
"mcpServers": {
"word2img_mcp": {
"type": "stdio",
"name": "word2img_mcp",
"command": "uv",
"args": ["run", "python", "start_mcp_server.py"]
}
}
}Configure your MCP client to connect to the local server. You may choose the most convenient startup command from the previous section. The client will submit Markdown content using submit_markdown and retrieve images with get_image.
The service supports multiple rendering backends and automatic fallback for reliable image generation. Rendering quality can be tuned with style options, and Chinese font support is included to ensure proper rendering of Chinese text.
If rendering fails, the system will attempt backends in this order until a successful render is produced: imgkit/wkhtmltopdf (highest quality), markdown-pdf-cli, md-to-image, PIL (fallback). Ensure wkhtmltopdf is installed for the best results.
Submit Markdown text to the MCP server and trigger image generation for a new task.
Retrieve the generated image for a given task ID, either as a Base64 string or a file path.