Skip to content
fontstay.dev
Source code on GitHub
Theme
Vision simulation

For design checks; does not correct colour vision.

Reading aids

MCP server

The fontstay package includes a Model Context Protocol server. An AI agent in your editor can read your local font files, pick the fallback fonts for your audience and write the same fallback CSS as this app.

What it does

The server runs on your machine over stdio. It reads only the font files the agent names, writes nothing and makes no network requests. It is stateless: every call names its files and carries its own audience, so the agent can ask again with different options.

Tools

The server exposes four read-only tools.

All tools except analyze_font take one to 16 font files (WOFF2, WOFF, TTF or OTF, up to 10 MB each) and the same options as the command line: audience (a Browserslist query), systems, locale, kind, unicode_range and scripts. Low glyph overlap and systems without fallback fonts come back as warnings after the result.

Setup

Add the server to your MCP client. It starts with npx and needs Node.js 24.21 or newer.

claude mcp add fontstay -- npx -y fontstay mcp

If the package is not on npm yet, build it in a checkout with pnpm cli:build and use node /path/to/packages/fontstay/dist/bin.js mcp as the command instead of npx. Relative font paths resolve against the directory the editor starts the server in.

Example prompts

Ask in plain language; the agent picks the tools.

Sample result

A get_css call for tests/fixtures/fonts/FiraSans-Regular.ttf, limited to Windows and macOS, without extra script faces.

Tool call

{
  "name": "get_css",
  "arguments": {
    "paths": ["tests/fixtures/fonts/FiraSans-Regular.ttf"],
    "systems": ["windows", "macos"],
    "scripts": false
  }
}

Result

@font-face {
  font-family: "Fira Sans Fallback";
  src: local("Trebuchet MS"), local("TrebuchetMS");
  size-adjust: 100.3942%;
  ascent-override: 93.1328%;
  descent-override: 26.3959%;
  line-gap-override: 0%;
}

body {
  font-family: "Fira Sans", "Fira Sans Fallback", sans-serif;
  /* Safari has no vertical overrides: match the x-height and fix the line box */
  font-size-adjust: 0.527;
  line-height: 1.4;
}

.fonts-loading {
  letter-spacing: -0.0019em;
}

Limits

Bad input comes back as a tool error that the agent can read and correct.

The same engine is available as a command line tool and a Node library in the fontstay package. CLI and Node library