FontLab MCP Server

FontLab MCP Server

Enables AI assistants to interact with FontLab for font design and manipulation, including querying font metadata, creating/modifying glyphs, applying transformations, and exporting fonts.

Category
访问服务器

README

FontLab MCP Server

A Model Context Protocol (MCP) server that provides programmatic access to FontLab's PythonQt API, enabling Claude and other AI assistants to interact with FontLab for font design and manipulation.

Overview

This MCP server bridges the Model Context Protocol with FontLab's powerful font editing capabilities, allowing you to:

  • Query font metadata and glyph information
  • Create and modify glyphs programmatically
  • Apply transformations (scale, rotate, translate)
  • Export fonts to various formats
  • Automate font design workflows

Architecture

┌─────────────────┐
│   Claude/MCP    │
│     Client      │
└────────┬────────┘
         │ MCP Protocol (stdio)
         │
┌────────▼────────┐
│  FontLab MCP    │
│     Server      │
│  (Python)       │
└────────┬────────┘
         │ Script Execution
         │
┌────────▼────────┐
│    FontLab      │
│   Application   │
│  (PythonQt API) │
└─────────────────┘

The server uses a bridge pattern to execute Python scripts within FontLab's environment, communicating via temporary files and JSON serialization.

Features

Resources (Read-Only Operations)

  • fontlab://font/current - Get current font information
  • fontlab://font/current/glyphs - List all glyphs
  • fontlab://font/info - Get detailed font metadata
  • fontlab://glyph/{name} - Get specific glyph details

Tools (Write Operations)

  • create_glyph - Create new glyphs with custom parameters
  • modify_glyph_width - Adjust glyph widths
  • transform_glyph - Apply scale, rotation, and translation
  • update_font_info - Modify font metadata
  • export_font - Export to OTF, TTF, WOFF, WOFF2, UFO
  • delete_glyph - Remove glyphs from font

Installation

Prerequisites

  • Python 3.10 or higher
  • FontLab 7 or 8 installed
  • pip package manager

Setup

  1. Clone this repository:

    git clone https://github.com/dithilli/fontlab-mcp-server.git
    cd fontlab-mcp-server
    
  2. Create a virtual environment (recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Install the package:

    pip install -e .
    

Configuration

The server automatically detects FontLab installations in standard locations:

  • macOS: /Applications/FontLab 8.app or /Applications/FontLab 7.app
  • Custom paths can be configured in the bridge initialization

Usage

Running the Server

Start the server using stdio transport:

python -m src.server

Or use the installed command:

fontlab-mcp-server

Claude Desktop Configuration

Add to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "fontlab": {
      "command": "/path/to/venv/bin/python",
      "args": ["-m", "src.server"],
      "cwd": "/path/to/fontlab-mcp-server"
    }
  }
}

Example Usage with Claude

Once configured, you can ask Claude to:

Query font information:

"What fonts are currently open in FontLab?"

Create glyphs:

"Create a new glyph called 'customA' with a width of 650"

Modify glyphs:

"Scale the 'A' glyph by 1.2x horizontally"

Export fonts:

"Export the current font as an OTF to ~/Desktop/myfont.otf"

API Reference

Resources

Get Current Font

URI: fontlab://font/current
Returns: JSON with font metadata

List Glyphs

URI: fontlab://font/current/glyphs
Returns: Array of glyph objects with names, unicodes, and widths

Get Glyph Details

URI: fontlab://glyph/{name}
Parameters:
  - name: Glyph name (e.g., "A", "space", "Agrave")
Returns: Detailed glyph information including bounds and contours

Tools

create_glyph

{
  "name": "glyph_name",
  "unicode": 65,  // optional
  "width": 600    // optional, default 600
}

modify_glyph_width

{
  "name": "glyph_name",
  "width": 650
}

transform_glyph

{
  "name": "glyph_name",
  "scale_x": 1.2,      // optional, default 1.0
  "scale_y": 1.0,      // optional, default 1.0
  "rotate": 45,        // optional, default 0 (degrees)
  "translate_x": 10,   // optional, default 0
  "translate_y": 0     // optional, default 0
}

update_font_info

{
  "family_name": "My Font Family",  // optional
  "style_name": "Bold",             // optional
  "version": "1.0",                 // optional
  "copyright": "Copyright 2025"     // optional
}

export_font

{
  "path": "/path/to/output.otf",
  "format": "otf"  // optional: otf, ttf, woff, woff2, ufo
}

delete_glyph

{
  "name": "glyph_name"
}

Development

Project Structure

fontlab-mcp-server/
├── src/
│   ├── __init__.py           # Package initialization
│   ├── server.py             # Main MCP server
│   ├── fontlab_bridge.py     # FontLab communication bridge
│   ├── resources.py          # Resource handlers
│   ├── tools.py              # Tool handlers
│   └── utils/                # Utility functions
├── scripts/                  # FontLab executor scripts
├── tests/                    # Unit tests
├── pyproject.toml            # Package configuration
├── requirements.txt          # Python dependencies
└── README.md                 # This file

Testing

Run tests:

pytest tests/

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Limitations & Notes

  • FontLab must be running for the server to function
  • Script execution uses subprocess communication, which may have latency
  • Some FontLab features may require specific versions (7 or 8)
  • The bridge assumes FontLab CLI accepts -script flag (may need adjustment)

Roadmap

Future enhancements:

  • [ ] Support for component manipulation
  • [ ] Kerning table operations
  • [ ] OpenType feature editing
  • [ ] Batch glyph operations
  • [ ] Real-time event streaming
  • [ ] Better error handling and validation
  • [ ] Support for multiple open fonts
  • [ ] Undo/redo functionality

License

MIT License - See LICENSE file for details

Acknowledgments

Support

For issues, questions, or contributions, please visit:


Version: 0.1.0 Author: David Szarzynski Status: Alpha - MVP Implementation

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选