Professional letterhead PDF generator for macOS with Markdown support and smart margin detection
SaferSkills independently audited Mac-letterhead (MCP Server) and scored it 45/100 (orange). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 1 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
A base64 string of 128+ characters appears in a documentation file. Encoded prompt injection hides the hostile instruction in base64 — invisible to keyword filters — and relies on the agent's ability to decode it at runtime. There is no normal authoring reason to embed a multi-hundred-byte base64 blob in skill docs.
*.sig, SIGNATURES) outside the documentation.Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<!-- mcp-name: io.github.easytocloud/mac-letterhead -->
<!-- GitHub can't render .icns files directly, so we use HTML to link the icon badge --> <a href="https://pypi.org/project/Mac-letterhead/" title="Mac-letterhead on PyPI"> <img src="https://raw.githubusercontent.com/easytocloud/Mac-letterhead/main/letterhead_pdf/resources/icon.png" width="128" height="128" alt="Mac-letterhead Logo" align="right" /> </a>
A professional macOS utility that applies letterhead templates to PDF and Markdown documents. Mac-letterhead creates drag-and-drop applications that automatically merge your company letterhead with documents while preserving formatting and ensuring professional presentation.
Mac-letterhead transforms your letterhead PDF into a powerful document processing tool:
pip install uv if neededInstall Mac-letterhead and create your first letterhead application:
# Quick start - create a letterhead droplet on your desktop
uvx mac-letterhead install --name "Company"
# For AI integration, install with MCP support
uvx install "mac-letterhead[mcp]"The easiest way to use Mac-letterhead with Claude is via the Desktop Extension (.mcpb file). Download the latest mac-letterhead-<version>.mcpb from the GitHub Releases page and double-click it to install directly into Claude for macOS — no terminal required.
After installation, Claude's settings UI lets you configure:
~/.letterhead/<style>.pdf and .css). Leave blank to specify a style per request.~/Desktop).For complete Desktop Extension details, see README_MCP.md.
Mac-letterhead is published in the official MCP Registry, making it easily discoverable by AI assistants and MCP clients.
Find Mac-letterhead in:
Quick Install for MCP Clients:
uvx mac-letterhead[mcp]For complete MCP configuration and usage, see README_MCP.md.
Mac-letterhead expects your letterhead files to be organized in ~/.letterhead/:
~/.letterhead/
├── company.pdf # Your letterhead template
├── company.css # Optional custom styling
└── personal.pdf # Additional letterhead templatesThis creates a macOS application that you can drag documents onto to apply your letterhead. The MCP option adds support for AI tool integration.
For optimal Markdown rendering, install the required libraries:
brew install pango cairo fontconfig freetype harfbuzzThese libraries enable high-quality PDF generation with advanced typography support.
#### Basic Application Creation
# Create a letterhead droplet using ~/.letterhead/company.pdf
uvx mac-letterhead install --name "company"#### Custom Letterhead Override
# Use a different letterhead file but keep the app name
uvx mac-letterhead install --name "Company Correspondence" --letterhead /path/to/custom-letterhead.pdf#### Advanced Markdown Styling
# Create a letterhead application with custom CSS styling
uvx mac-letterhead install --name "Technical Reports" --css /path/to/custom-styles.cssThe --css option allows you to customize the appearance of rendered Markdown documents:
#### Install Command Reference
The install command follows this pattern:
uvx mac-letterhead install --name "AppName" [--letterhead path] [--css path] [--output-dir dir]Required:
--name: Sets both the application name and the style. Automatically looks for ~/.letterhead/<name>.pdf and ~/.letterhead/<name>.cssOptional:
--letterhead: Override the default letterhead PDF path--css: Override the default CSS file path--output-dir: Specify where to create the app (default: Desktop)--dev: Create a development version using local codeOnce created, your letterhead application appears on your desktop:
#### PDF Merging
# Apply letterhead to a PDF document
uvx mac-letterhead merge /path/to/letterhead.pdf "Document Title" ~/Desktop /path/to/document.pdf
# Use a specific blending strategy
uvx mac-letterhead merge /path/to/letterhead.pdf "Report" ~/Desktop /path/to/report.pdf --strategy overlay#### Markdown Processing
# Convert Markdown with letterhead
uvx mac-letterhead merge-md /path/to/letterhead.pdf "Technical Guide" ~/Desktop /path/to/guide.md
# With custom CSS styling
uvx mac-letterhead merge-md /path/to/letterhead.pdf "Proposal" ~/Desktop /path/to/proposal.md --css /path/to/styles.css#### AI Integration with MCP Server Mac-letterhead includes an MCP (Model Context Protocol) server that enables AI tools like Claude to create letterheaded PDFs through natural language commands:
# Start a generic multi-style server
uvx mac-letterhead mcp
# Start a dedicated single-style server
uvx mac-letterhead mcp --style easytocloud --output-dir ~/Documents/generated-pdfsUsage Examples with Claude:
The MCP server automatically:
For complete MCP setup and configuration details, see README_MCP.md.
Choose the optimal strategy for your letterhead design:
Create sophisticated document styling by providing custom CSS:
/* custom-styles.css */
h1 { color: #2c5aa0; border-bottom: 2px solid #2c5aa0; }
table { border: 1px solid #ddd; background: #f9f9f9; }
code { background: #f4f4f4; padding: 2px 4px; }The CSS is automatically integrated with Mac-letterhead's smart margin system to ensure content fits properly within your letterhead design.
Mac-letterhead provides professional Markdown rendering with:
#### GitHub Flavored Markdown Support
Mac-letterhead includes enhanced support for GitHub Flavored Markdown (GFM) features:
~~deleted text~~ renders with proper strikethrough formatting- [x] completed and - [ ] pendingTask lists are rendered with professional Unicode checkboxes (☑ for completed, ☐ for pending) that are properly sized and aligned, including within table cells.
Mac-letterhead features a sophisticated dual-backend rendering system that automatically selects the best available technology while providing manual control when needed.
#### PDF Rendering Backends
WeasyPrint (Preferred when available):
brew install pango cairo fontconfig freetype harfbuzz)ReportLab (Reliable fallback):
#### Markdown Processing Backends
GitHub Flavored Markdown (GFM) (Enhanced when available):
Standard Markdown (Universal fallback):
#### Backend Selection and Control
Automatic Selection (Default behavior):
# Uses best available backends automatically
uvx mac-letterhead merge-md letterhead.pdf "Document" ~/Desktop document.mdManual Backend Control:
# Force specific PDF backend
uvx mac-letterhead merge-md letterhead.pdf "Report" ~/Desktop report.md --pdf-backend reportlab
# Force specific Markdown backend
uvx mac-letterhead merge-md letterhead.pdf "Guide" ~/Desktop guide.md --markdown-backend standard
# Combine specific backends
uvx mac-letterhead merge-md letterhead.pdf "Technical" ~/Desktop tech.md --pdf-backend weasyprint --markdown-backend gfmAvailable Backend Options:
--pdf-backend: weasyprint, reportlab, auto (default: auto)--markdown-backend: gfm, standard, auto (default: auto)#### Backend Capabilities Matrix
| Feature | WeasyPrint + GFM | WeasyPrint + Standard | ReportLab + GFM | ReportLab + Standard |
|---|---|---|---|---|
| Basic Markdown | ✅ Excellent | ✅ Excellent | ✅ Good | ✅ Good |
| Advanced CSS | ✅ Full Support | ✅ Full Support | ⚠️ Limited | ⚠️ Limited |
| Strikethrough | ✅ Native | ❌ Not Available | ✅ Unicode | ❌ Not Available |
| Task Lists | ✅ Styled Checkboxes | ❌ Not Available | ✅ Unicode Checkboxes | ❌ Not Available |
| Complex Tables | ✅ Advanced | ✅ Good | ✅ Basic | ✅ Basic |
| Typography | ✅ Professional | ✅ Professional | ✅ Standard | ✅ Standard |
| System Dependencies | ⚠️ Required | ⚠️ Required | ✅ None | ✅ None |
#### Testing and Validation
The project includes comprehensive testing for all backend combinations:
# Test all combinations across Python versions
make test-backend-combinations
# Test specific combinations
make test-weasyprint-gfm # WeasyPrint + GitHub Flavored Markdown
make test-weasyprint-standard # WeasyPrint + Standard Markdown
make test-reportlab-gfm # ReportLab + GitHub Flavored Markdown
make test-reportlab-standard # ReportLab + Standard MarkdownEach test combination generates output files with naming patterns like document-py3.11-weasyprint-gfm.pdf for easy comparison and quality validation.
Releases are automated with semantic-release via GitHub Actions. Use Conventional Commit messages on main and the workflow will:
letterhead_pdf/__init__.py, server.json, uv.lock, and CHANGELOG.mdCommit messages must follow the Conventional Commits format so semantic-release can infer the correct version bump.
npm install make release-dry-run export TWINE_USERNAME=__token__
export TWINE_PASSWORD=...
make publishThe GitHub Action uses the same configuration, so merging Conventional Commits into main is usually all that’s required.
Library Dependencies: If you see WeasyPrint warnings, the system automatically falls back to ReportLab - functionality is not affected.
File Permissions: If applications request file access, approve the permissions in System Preferences > Security & Privacy > Privacy > Files and Folders.
Margin Detection: The system automatically analyzes letterhead positioning. If margins appear incorrect, ensure your letterhead PDF contains clear visual elements (logos, text, graphics) in header/footer areas.
~/Library/Logs/Mac-letterhead/letterhead.log~/Library/Logs/Mac-letterhead/droplet.logWe welcome contributions! Please see CONTRIBUTING.md for development setup, testing procedures, and pull request guidelines.
MIT License
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.