Skip to main content

A MCP server that converts Markdown text to SVG images.

Project description

Md2svg-mcp

A Model Context Protocol (MCP) server that converts Markdown text to SVG images.

Overview

This MCP server provides a tool to transform Markdown content into SVG format. It supports various Markdown elements, including headings, lists, code blocks, and tables. The server can be easily integrated into any MCP client, allowing users to visualize Markdown content in a scalable vector graphic format.

Features

  • Markdown Parsing: Converts Markdown text to structured blocks.
  • SVG Generation: Renders Markdown elements as SVG elements.
  • Customization: Supports customizable output dimensions, padding, and colors.
  • MCP Integration: Compatible with any MCP client.

Installation

To install this MCP server, you can use the following command:

pip install md2svg-mcp

Usage

To run the MCP server, use the following command:

md2svg-mcp

MCP Server config:


Example

To convert Markdown text to an SVG image, you can use the markdown_to_svg tool provided by this server. Here is an example of how to use it:

from md2svg_mcp import markdown_to_svg

markdown_text = """
# Hello World

This is a *test* of the Markdown to SVG conversion.

## Features

- Lists
- Code blocks
- Tables

| Header 1 | Header 2 | Header 3 |
| -------- | -------- | -------- |
| Row 1    | Data 1   | Data 2   |
| Row 2    | Data 3   | Data 4   |
"""

markdown_to_svg(markdown_text, output_file="example.svg", width=800, padding=60)

This will generate an SVG file named example.svg containing the rendered Markdown content.

Configuration

The markdown_to_svg tool supports the following parameters:

  • md_text: The Markdown text to be converted.
  • output_file: The output SVG file name (default: output.svg).
  • width: The width of the SVG image (default: 720).
  • padding: The padding around the SVG content (default: 50).

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md2svg_mcp-0.1.6.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md2svg_mcp-0.1.6-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file md2svg_mcp-0.1.6.tar.gz.

File metadata

  • Download URL: md2svg_mcp-0.1.6.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.12

File hashes

Hashes for md2svg_mcp-0.1.6.tar.gz
Algorithm Hash digest
SHA256 df9bc24065e6c3317a6dc6104b86d2b5dfd392e9461300a202e456a90c7cf3af
MD5 53ae0dca2a3860ed0cb64037fc4bae42
BLAKE2b-256 92d7f957890cc233c18e01b2b6834852fdea8055dbfaafc0ba6834fe0f975107

See more details on using hashes here.

File details

Details for the file md2svg_mcp-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: md2svg_mcp-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.12

File hashes

Hashes for md2svg_mcp-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a145b2724aa00e201550022bd6c4e651b46586b32ba2ab5e9a3a1d2fdf544f23
MD5 7c0b213c8d596710f7cf5a014cf165dd
BLAKE2b-256 4a664a1adc8347dd883aeb39d8f7e5842dbc4cae2a0b79cd43448d3edf2a2d29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page