mcp-svg-marp

mcp-svg-marp

An MCP server that converts SVG files into Marp presentations, with features like text extraction and PNG conversion.

Category
访问服务器

README

MCP SVG-Marp Server

An MCP (Model Context Protocol) server that converts SVG files to Marp presentations.

Features

  • Convert SVG files to Marp markdown presentations
  • Extract text content from SVG files
  • Generate PNG images from SVG for embedding in presentations
  • Analyze SVG structure and suggest presentation layout
  • Support for different Marp themes (default, gaia, uncover)

Prerequisites

  • Node.js 18+
  • One of the following for SVG to PNG conversion:
    • ImageMagick (convert command)
    • Inkscape
    • librsvg (rsvg-convert command)

Installation

Using Nix (Recommended)

If you have Nix installed, you can use the provided flake:

# Enter development shell with all dependencies
nix develop

# Install Node.js dependencies
npm install

# Build the TypeScript project
npm run build

Manual Installation

# Install system dependencies (Ubuntu/Debian)
sudo apt-get install imagemagick inkscape librsvg2-bin

# Install Node.js dependencies
npm install

# Build the project
npm run build

Usage

Starting the MCP Server

npm start

The server communicates via stdio and implements the MCP protocol.

Available MCP Tools

convert_svg_to_marp

Converts an SVG file to a Marp presentation.

Parameters:

  • svgPath (required): Path to the input SVG file
  • outputPath (optional): Path for the output Marp markdown file
  • options (optional):
    • theme: Marp theme to use ("default", "gaia", or "uncover")
    • includeImage: Include the SVG as a PNG image (default: true)
    • extractText: Extract text from SVG for content (default: true)

Example:

{
  "tool": "convert_svg_to_marp",
  "arguments": {
    "svgPath": "/path/to/diagram.svg",
    "outputPath": "/path/to/presentation.md",
    "options": {
      "theme": "gaia",
      "includeImage": true,
      "extractText": true
    }
  }
}

analyze_svg

Analyzes an SVG file and suggests a Marp presentation structure.

Parameters:

  • svgPath (required): Path to the SVG file to analyze

Example:

{
  "tool": "analyze_svg",
  "arguments": {
    "svgPath": "/path/to/diagram.svg"
  }
}

Output Format

The generated Marp markdown includes:

  1. Front matter with Marp configuration
  2. Title slide with SVG title or first text element
  3. Image slide with the converted PNG (if enabled)
  4. Content slide with extracted text as bullet points (if available)
  5. Metadata slide with image dimensions and format information

Example Output

---
marp: true
theme: default
paginate: true
backgroundColor: #fff
backgroundImage: linear-gradient(to bottom right, #6366F1, #8B5CF6)
style: |
  section {
    font-family: 'Arial', sans-serif;
  }
  h1 {
    color: #FFFFFF;
    font-size: 56px;
  }
---

# My SVG Diagram

Description of the diagram

---

<!-- _class: centered -->

![SVG Content](diagram.png)

---

## Content

- First text element
- Second text element
- Third text element

---

## Image Information

- **Dimensions**: 800 × 600 pixels
- **Format**: SVG (Scalable Vector Graphics)

Using with Claude

This MCP server is designed to work seamlessly with Claude. When you ask Claude to create slides or presentations from SVGs, it will:

  1. Automatically create professional SVG designs based on your content
  2. Convert to Marp using the convert_svg_to_marp tool
  3. Provide both files - the original SVG and the Marp markdown

Trigger Phrases

Claude will automatically use this tool when you say things like:

  • "Convert this SVG to a Marp presentation"
  • "Make a slide from this diagram"
  • "Create a Marp presentation about [topic]"
  • "このSVGをMarpプレゼンに変換して"

Development

# Run in development mode (with hot reload)
npm run dev

# Build the project
npm run build

# Start the built server
npm start

Integration with Claude Desktop

To use this MCP server with Claude Desktop, add it to your MCP servers configuration:

{
  "mcpServers": {
    "svg-marp": {
      "command": "node",
      "args": ["/path/to/mcp-svg-marp/dist/index.js"]
    }
  }
}

Marp Output Capabilities

From the generated Marp markdown, you can create:

  • HTML presentations - Interactive slideshows for web browsers
  • PDF documents - For printing or sharing
  • PNG/JPEG images - Individual slide images
  • PowerPoint files - Using Marp CLI's PPTX export

Converting Marp to Other Formats

# Install Marp CLI globally
npm install -g @marp-team/marp-cli

# Convert to HTML
marp presentation.md -o presentation.html

# Convert to PDF
marp presentation.md -o presentation.pdf

# Convert to PPTX
marp presentation.md -o presentation.pptx

# Convert to PNG images
marp presentation.md -o slide.png

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选