mermaid-to-jpeg-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mermaid-to-jpeg-mcp convert this mermaid diagram to jpeg"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Image-Gen-Server
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
Clone or copy the project files to your desired location
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:
convert_md_to_jpeg: Convert any markdown file to JPEG
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 startOr run directly:
node server.jsTools Available
convert_md_to_jpeg
Convert a markdown file to JPEG image with customizable options.
Parameters:
input_file(required): Path to the input markdown fileoutput_file(optional): Path for the output JPEG filewidth(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 fileoutput_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
```javascript
function hello() {
console.log("Hello, world!");
}This is a blockquote
### Mermaid Diagram
```markdown
```mermaid
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
```bash
npm install -g @mermaid-js/mermaid-cli"convert command not found": Install ImageMagick
brew install imagemagickPuppeteer issues: Make sure Chrome/Chromium is installed and accessible
Testing
Test the conversion with a sample file:
npm testOr create a test markdown file and run:
echo "# Test Document\n\nThis is a test." > test.md
node md-to-jpeg.js test.mdLicense
MIT License
Available Tools
2 toolsconvert_md_to_jpegC
Convert a markdown file to JPEG image
Inputs: input_file (required), scale, width, height, +2 more.
convert_mermaid_to_jpegB
Convert a mermaid diagram file to JPEG image
Inputs: input_file (required), scale, width, height, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools target distinct input file types: markdown versus mermaid diagrams. Their names and descriptions make the difference immediately obvious, so there is virtually no risk of an agent selecting the wrong one.
Both tools follow the identical verb_noun pattern: convert_<source>_to_jpeg. This consistency makes the tool set predictable and easy to extend with additional source formats.
With only two tools, the server feels slightly thin even for a narrowly scoped conversion service. The count is borderline: it covers the two advertised input types but does not provide any auxiliary options or additional conversion formats that might be expected.
The core conversion workflows for markdown and mermaid files to JPEG are covered, which aligns with the server's apparent purpose. Minor gaps exist, such as lacking output customization options or batch processing, but these can be worked around by agents without fundamental failure.
Maintenance
Related MCP Connectors
MCP Server for Web2MD — convert URLs to Markdown from Claude Desktop, Cursor, etc.
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.1289 npm234MIT
- AlicenseNot gradedqualityDmaintenanceA MCP server that integrates with Cursor IDE to generate images based on text descriptions using JiMeng AI, allowing users to create and save custom images directly within their development environment.227MIT
- AlicenseDqualityDmaintenanceAn MCP server that converts Markdown to HTML, supporting both stdio and HTTP interfaces for easy integration with Cursor and other MCP clients.19 npmMIT
- FlicenseNot gradedqualityDmaintenanceMCP server that generates Mermaid diagrams with live browser preview, supports real-time rendering and SVG/PNG export.13-