MCP server for generating icon fonts from SVG files

MCP server for generating icon fonts from SVG files

mcp-svg-to-fonts•byomy13

An MCP server that converts SVG icons into TTF, WOFF and WOFF2 fonts, generates CSS and TypeScript definitions, and extends existing fonts.

License: ISC•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Converts a directory of SVG icons into TTF, WOFF and WOFF2 font files.
  • •Generates CSS with font-face declarations and icon classes, plus TypeScript type definitions.
  • •Lists SVG files in a directory to inventory icons before font generation.
  • •Extends existing fonts while preserving original icons and Unicode values, optionally by extracting glyphs from a TTF file without original SVGs.

BEST FOR

  • •Creating a custom icon font from a collection of SVG icons.
  • •Adding new icons to an established icon font without breaking existing usage.
  • •Extending third-party or legacy icon fonts whose original SVGs are unavailable.

ABOUT MCP-SVG-TO-FONTS

MCP server for generating icon fonts from SVG files is cataloged as an MCP server attributed to omy13. An MCP server that converts SVG icons into TTF, WOFF and WOFF2 fonts, generates CSS and TypeScript definitions, and extends existing fonts. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: ISC. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP server for generating icon fonts from SVG files are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which tools does the server expose?

It exposes four tools: list-svgs, generate-font-from-svgs, extend-existing-font, and extend-font-advanced.

Can it extend a font without the original SVG files?

Yes, extend-font-advanced extracts original glyphs directly from the TTF file without requiring the original SVGs.

上游原版 README

在 GitHub 查看同一版本原文

README.md · aa3457b74572 · 采集于 2026-11-13 13:08:27 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP SVG to Font

npm version node license: ISC

A Model Context Protocol (MCP) server for generating and managing icon fonts from SVG files. This tool provides comprehensive font generation capabilities with backward compatibility and advanced glyph extraction features.

✨ Features

  • 🎨 SVG to Font Conversion: Convert SVG icons to multiple font formats (TTF, WOFF, WOFF2)
  • 📝 CSS Generation: Automatic CSS generation with font-face declarations and icon classes
  • 🔷 TypeScript Support: Generate type definitions for type-safe icon usage
  • 🔄 Font Extension: Add new icons to existing fonts while preserving backward compatibility
  • 🔍 Advanced Glyph Extraction: Extract existing glyphs from TTF files without requiring original SVGs
  • 📁 Directory Scanning: List and analyze SVG files in directories
  • 🤖 AI Integration: Full Model Context Protocol compatibility for AI agent integration

📋 Prerequisites

  • Node.js: 22.x or later (developed and tested on Node.js 26 LTS)

🚀 Quick Start (npm)

The easiest way to use this MCP server is via npm. No clone or build required.

1. Add to your MCP client

Cursor — add to .cursor/mcp.json or global MCP settings:

{
  "mcpServers": {
    "mcp-svg-to-fonts": {
      "command": "npx",
      "args": ["-y", "mcp-svg-to-fonts"]
    }
  }
}

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-svg-to-fonts": {
      "command": "npx",
      "args": ["-y", "mcp-svg-to-fonts"]
    }
  }
}

2. Verify it works

npx -y mcp-svg-to-fonts

The server starts and waits on stdio — that means it's ready. Stop it with Ctrl+C.

3. Use it in your project

Point the MCP tools at a folder with your SVG icons. For example, ask your AI assistant:

"Generate an icon font from the SVGs in ./src/assets/icons and output to ./fonts"

The server exposes 4 tools: list-svgs, generate-font-from-svgs, extend-existing-font, and extend-font-advanced.

🛠️ Development

For contributing or local development you need pnpm 10.x.

Clone and build

git clone https://github.com/omy13/mcp-svg-to-fonts.git
cd mcp-svg-to-fonts
pnpm install
pnpm build

Development mode

pnpm dev

Testing with MCP Inspector

npx @modelcontextprotocol/inspector npx tsx src/main.ts

Local MCP config (without npm)

{
  "mcpServers": {
    "mcp-svg-to-fonts": {
      "command": "npx",
      "args": ["tsx", "src/main.ts"],
      "cwd": "/path/to/mcp-svg-to-fonts"
    }
  }
}

Or with the compiled build:

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

🛠️ Available Tools

1. list-svgs

Purpose: Scan and list all SVG files in a directory

Parameters:

  • directory (string, required): Directory path to scan for SVG files

Use Case:

  • Inventory available icons before font generation
  • Verify SVG file structure and naming
  • Quality assurance before batch processing

Example:

{
  "directory": "./icons"
}

2. generate-font-from-svgs

Purpose: Create a brand new icon font from a collection of SVG files

Parameters:

  • directory (string, required): Directory containing SVG files
  • fontName (string, optional): Font family name (default: "IconFont")
  • outputDir (string, optional): Output directory (default: "./fonts")
  • formats (array, optional): Font formats to generate: any of "woff2", "woff", "ttf" (default: all three)
  • cssPrefix (string, optional): CSS class prefix (default: "icon")
  • generateTypes (boolean, optional): Generate TypeScript types (default: true)

Use Case:

  • Initial font creation from scratch
  • Complete icon system setup
  • Migrating from icon libraries to custom fonts

Generated Files:

  • FontName.ttf, FontName.woff, FontName.woff2
  • FontName.css with font-face and icon classes
  • FontName.types.ts with TypeScript definitions

3. extend-existing-font

Purpose: Add new icons to an existing font while preserving all existing icons and their Unicode values

Parameters:

  • existingFontDir (string, required): Directory with existing font files (.css and font files)
  • originalSvgDirectory (string, required): Directory with original SVG files used to create the existing font
  • newSvgDirectory (string, required): Directory with new SVG files to add
  • fontName (string, optional): Font name (auto-detected if not provided)
  • outputDir (string, optional): Output directory (default: same as existing font)
  • cssPrefix (string, optional): CSS class prefix (auto-detected if not provided)
  • generateTypes (boolean, optional): Generate TypeScript types (default: true)

Use Case:

  • Adding new icons to established icon systems
  • Maintaining backward compatibility with existing applications
  • Incremental icon library expansion

Requirements:

  • Access to original SVG files used in the existing font
  • Existing CSS file for Unicode mapping detection

Compatibility: ✅ 100% Backward Compatible - Existing projects continue to work without changes

4. extend-font-advanced

Purpose: Add new icons to an existing font by extracting original glyphs directly from the TTF file, without requiring original SVG files

Parameters:

  • existingFontDir (string, required): Directory containing existing font files (.css and .ttf files)
  • newSvgDirectory (string, required): Directory containing new SVG files to add
  • fontName (string, optional): Font name (auto-detected from files)
  • outputDir (string, optional): Output directory (default: same as existing font)
  • cssPrefix (string, optional): CSS class prefix (auto-detected from CSS)
  • generateTypes (boolean, optional): Generate TypeScript types (default: true)
  • preserveMetrics (boolean, optional): Preserve original font metrics (default: true)

Use Case:

  • Extending third-party icon fonts
  • Working with legacy fonts where SVG sources are unavailable
  • Reverse-engineering and enhancing existing font assets

Advanced Features:

  • Glyph Extraction: Uses OpenType.js to extract vector paths from TTF files
  • Unicode Preservation: Maintains all original Unicode mappings
  • Font Metrics Preservation: Keeps original font dimensions and spacing
  • CSS Integration: Maps extracted glyphs with CSS class names

Requirements:

  • Original TTF font file
  • CSS file with Unicode mappings (for glyph name detection)
  • Format: CSS classes like .icon-name:before { content: "\\e001"; }

Technical Process:

  1. Parse TTF file to extract glyph vector data
  2. Map glyph Unicode values to CSS class names
  3. Convert extracted glyphs back to temporary SVG files
  4. Combine extracted glyphs with new SVG files
  5. Generate new font with preserved Unicode values

Compatibility: ✅ 100% Backward Compatible - All original icons maintain their Unicode values

📁 Generated Font Structure

After font generation, you'll get:

fonts/
├── IconFont.css          # CSS with font-face and icon classes
├── IconFont.ttf          # TrueType font
├── IconFont.woff         # Web Open Font Format
├── IconFont.woff2        # Web Open Font Format 2.0
└── IconFont.types.ts     # TypeScript type definitions

💻 Usage Examples

Basic HTML Usage

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="./fonts/IconFont.css" />
  </head>
  <body>
    <i class="icon icon-home"></i>
    <i class="icon icon-user"></i>
    <i class="icon icon-settings"></i>
  </body>
</html>

CSS Styling

.icon {
  font-family: 'IconFont';
  font-size: 24px;
  color: #333;
}

.icon-home:before {
  content: '\e001';
}

TypeScript Integration

import { IconName, getIconClass, ICON_NAMES } from './fonts/IconFont.types';

// Type-safe icon usage
const iconName: IconName = 'home';
const className = getIconClass(iconName); // Returns "icon-home"

// Get all available icons
const allIcons = ICON_NAMES; // ['home', 'user', 'settings', ...]

React Component Example

import { IconName, getIconClass } from './fonts/IconFont.types';

interface IconProps {
  name: IconName;
  className?: string;
}

const Icon: React.FC<IconProps> = ({ name, className = '' }) => {
  return <i className={`icon ${getIconClass(name)} ${className}`} />;
};

// Usage
<Icon name="home" className="text-blue-500" />;

🔄 Workflow Examples

Scenario 1: Creating a New Icon System

  1. Prepare SVG icons in a directory
  2. Use list-svgs to verify files
  3. Use generate-font-from-svgs to create the font
  4. Integrate generated CSS and fonts into your project

Scenario 2: Adding Icons to Your Existing Font

  1. Place new SVG files in a directory
  2. Use extend-existing-font with original SVGs
  3. Replace old font files with new ones
  4. Existing code continues to work + new icons available

Scenario 3: Extending a Third-Party Font

  1. Obtain the TTF file and CSS from the third-party font
  2. Create new SVG icons
  3. Use extend-font-advanced to merge them
  4. Get a new font with both original and new icons

⚠️ Important Notes

Naming Rules

Names are written into file paths, CSS selectors and generated TypeScript, so they are validated:

NameAllowed charactersExample
SVG file names (icon names)letters, numbers, -, _arrow-left.svg
fontNameletters, numbers, -, _MyIcons
cssPrefixletters, numbers, _ (no -)icon

Files with spaces, dots or other characters (e.g. arrow left.svg) are rejected with an error listing them. Rename them before generating the font.

Font Extension Requirements

  • For extend-existing-font: Requires original SVG files
  • For extend-font-advanced: Requires TTF file and CSS with Unicode mappings

CSS Format for Advanced Extension

Your CSS file must include Unicode mappings in this format:

.icon-home:before {
  content: '\e001';
}
.icon-user:before {
  content: '\e002';
}
.icon-settings:before {
  content: '\e003';
}

Best Practices

  • Use consistent SVG dimensions (preferably square)
  • Optimize SVGs before font generation
  • Test fonts across different browsers
  • Keep backup of original SVG files
  • Use semantic icon names

🐛 Troubleshooting

Common Issues

"No SVG files found"

  • Verify directory path
  • Ensure SVG files have .svg extension
  • Check file permissions

"Invalid SVG file names" / "Invalid font or SVG file names"

  • Rename the listed files using only letters, numbers, - and _ (see Naming Rules)

"Icon name conflicts detected"

  • Rename conflicting SVG files
  • Avoid duplicate icon names

"No TTF file found"

  • Ensure TTF file exists in the specified directory
  • Check file extension (.ttf)

"Cannot parse existing font"

  • Verify CSS file format
  • Ensure Unicode mappings are present

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP server for generating icon fonts from SVG files from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-svg-to-fonts)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools