Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

A local MCP server for Cursor that converts Markdown files and Mermaid diagrams to JPEG images with configurable dimensions and quality.

README.md

Cursor MCP Server - Markdown to JPEG Converter

A local Model Context Protocol (MCP) server for Cursor that enables converting Markdown files to JPEG images. This server supports both regular markdown content and Mermaid diagrams.

Features

  • Convert regular Markdown files to JPEG images
  • Convert Mermaid diagrams to JPEG images
  • Configurable image dimensions and quality
  • Automatic detection of Mermaid diagram syntax
  • Clean, styled output for regular markdown content

Prerequisites

Make sure you have the following installed:

  • Node.js (v14 or later)
  • npm or yarn
  • ImageMagick (brew install imagemagick)
  • Mermaid CLI (npm install -g @mermaid-js/mermaid-cli)

Installation

  1. Clone or copy the project files to your desired location
  2. Install dependencies:
   npm install

Usage

Standalone Script

You can use the standalone script to convert markdown files:

# Convert markdown to JPEG
node md-to-jpeg.js input.md [output.jpeg]

# Convert using the original mermaid-only script
node generate-diagram.js input.md [output.png]

MCP Server

The MCP server provides two tools:

  1. convert_md_to_jpeg: Convert any markdown file to JPEG
  2. convert_mermaid_to_jpeg: Convert Mermaid diagrams to JPEG

MCP Server Configuration

To use with Cursor, add the following to your MCP configuration:

{
  "mcpServers": {
    "markdown-to-jpeg": {
      "command": "node",
      "args": ["/path/to/your/cursor-mcp/server.js"],
      "env": {}
    }
  }
}

Running the Server

Start the MCP server:

npm start

Or run directly:

node server.js

Tools Available

convert_md_to_jpeg

Convert a markdown file to JPEG image with customizable options.

Parameters:

  • input_file (required): Path to the input markdown file
  • output_file (optional): Path for the output JPEG file
  • width (optional): Width of the output image (default: 1200)
  • height (optional): Height of the output image (default: 800)
  • quality (optional): JPEG quality 1-100 (default: 90)

convert_mermaid_to_jpeg

Convert a Mermaid diagram file to JPEG image.

Parameters:

  • input_file (required): Path to the input mermaid file
  • output_file (optional): Path for the output JPEG file

Example Usage

Regular Markdown

# My Document

This is a sample markdown document with:

- **Bold text**
- *Italic text*
- `Code snippets`

## Code Block

function hello() { console.log("Hello, world!"); } ```

This is a blockquote


### Mermaid Diagram
graph TD
    A[Start] --> B{Is it?}
    B -->|Yes| C[OK]
    C --> D[Rethink]
    D --> B
    B ---->|No| E[End]

## Supported Formats

- **Input**: Markdown (.md), Mermaid diagrams
- **Output**: JPEG (.jpeg, .jpg)

## Dependencies

- `@modelcontextprotocol/sdk`: MCP SDK for server implementation
- `puppeteer`: For rendering HTML to images
- `marked`: Markdown parsing
- `@mermaid-js/mermaid-cli`: Mermaid diagram generation
- `imagemagick`: Image format conversion

## Troubleshooting

### Common Issues

1. **"mmdc command not found"**: Install Mermaid CLI globally

npm install -g @mermaid-js/mermaid-cli ```

  1. "convert command not found": Install ImageMagick
   brew install imagemagick
  1. Puppeteer issues: Make sure Chrome/Chromium is installed and accessible

Testing

Test the conversion with a sample file:

npm test

Or create a test markdown file and run:

echo "# Test Document\n\nThis is a test." > test.md
node md-to-jpeg.js test.md

License

MIT License

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Files & Docs servers.