
svg converter mcp
一个轻量级的MCP服务器,用于将SVG图像转换为PNG和JPEG格式。
Repository Info
About This Server
一个轻量级的MCP服务器,用于将SVG图像转换为PNG和JPEG格式。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
svg-converter-mcp
A lightweight MCP server for converting SVG images to PNG and JPEG formats.
Overview
svg-converter-mcp is a lightweight MCP (Model Context Protocol) server designed for personal use that converts SVG vector images to raster image formats (PNG/JPEG). It specializes only in conversion processing and does not perform file operations, making it lightweight and resource-efficient.
Features
- Convert SVG images to PNG or JPEG formats
- Configure output options (dimensions, quality, etc.)
- Lightweight implementation with minimal memory usage
- Communicates via standard input/output (stdio) without using HTTP ports
- Can be integrated with other services such as secure-filesystem-server
Prerequisites
- Node.js (v14 or later recommended)
- npm or yarn
Installation
# Clone the repository
git clone https://github.com/tokida/svg-converter-mcp.git
cd svg-converter-mcp
# Install dependencies
npm install
# Build
npm run build
Dependencies
- @modelcontextprotocol/sdk: MCP server framework
- sharp: Image processing library for Node.js
Adding to Claude Desktop
Add the following to the configuration file (typically ~/.config/claude/config.json):
{
"mcpServers": {
"svg-converter": {
"command": "npx",
"args": [
"-y",
"svg-converter-mcp"
]
}
}
}
Usage
Converting SVG to PNG/JPEG
use convert_svg
You can specify parameters such as:
svgData: SVG content (string)format: Output format ("png" or "jpeg"/"jpg")width: Output width (in pixels, optional)height: Output height (in pixels, optional)quality: Output quality (0-100, JPEG only, optional)
Getting Converter Information
use get_converter_info
Using with secure-filesystem-server
This service can be used with secure-filesystem-server as follows:
- Convert SVG data with
svg-converter-mcp - Retrieve the converted binary data
- Save the binary data as a file using
secure-filesystem-server - Reference the saved file from
secure-filesystem-serveras needed
Performance Considerations
- Designed for personal use with minimal resource consumption
- Large SVGs may require more memory
- Faster startup compared to HTTP servers due to the use of standard input/output
Security
- Input validation is implemented to prevent potential vulnerabilities
- SVG size is limited to prevent memory exhaustion attacks
- Does not directly access the file system
- Does not open network ports, preventing network-related attacks
Development
# Build
npm run build
# Run in development mode
npm run dev
# Run tests
npm test
License
MIT
Contributing
Contributions are welcome! Feel free to submit pull requests.
Quick Start
Clone the repository
git clone https://github.com/tokida/svg-converter-mcpInstall dependencies
cd svg-converter-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.