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

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.5.tar.gz (23.3 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.5-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for md2svg_mcp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e6db7dc0f15f511365a95ec0ac632a2842cb94557124bbe5fb4cc4899a24be4c
MD5 5791f984cee4a5d2fa1cc0554f41346b
BLAKE2b-256 74ab9bb8cdda0ee6bde06e0a48e1628692c7256ef39bc81072f154b23d716ecb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for md2svg_mcp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4a4205375a65fdc6aa0325ef9b2d5f1016d9ca9a819e2b95d0e35521d044a0ed
MD5 054c6f95216ce3667b98f75b795da302
BLAKE2b-256 2c8c78c77a5ca388cd5b50d38613967d3a1931c67f1bbedfd745f920b9fcb2c6

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