home / mcp / md2img mcp server

md2img MCP Server

MCP for converting markdown formatted text into images.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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 wkhtmltopdf

Running demonstration and MCP service

To 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.py

As MCP 服务

Choose 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"]
    }
  }
}

MCP 客户端配置

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.

Available tools

submit_markdown

Submit Markdown text to the MCP server and trigger image generation for a new task.

get_image

Retrieve the generated image for a given task ID, either as a Base64 string or a file path.

md2img MCP Server - adolphnb/md2img-mcp