google-fonts-mcp
Allows searching the Google Fonts catalogue, retrieving font metadata, previewing text in a chosen font as HTML, and generating HTML and CSS embed code for web pages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-fonts-mcp Find me some popular monospace fonts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
google-fonts-mcp
An MCP server that lets AI assistants search, inspect, preview and embed Google Fonts.
What it does
google-fonts-mcp connects Claude Desktop (or any MCP client) to the Google Fonts Web Fonts Developer API. It loads the full font catalogue once, sorted by popularity, caches it in memory, and answers from the cache after that. If you misspell a family name, it suggests the closest matches.
search_fonts: find families by name and/or category, most popular first.get_font_details: get a family's category, weights, variants, subsets, version and last-modified date.preview_text: render sample text in a font as a self-contained HTML page.get_embed_code: get the<link>tags and CSSfont-familydeclaration for a web page.
Related MCP server: Google Drive MCP Server
Examples
"Find me some popular monospace fonts."
Calls search_fonts with category: "monospace" and returns a numbered list:
Found 10 fonts matching category monospace:
1. Roboto Mono (monospace) - weights: 100, 200, 300, 400, 500, 600, 700
2. Source Code Pro (monospace) - weights: 200, 300, 400, 500, 600, 700, 800, 900
3. JetBrains Mono (monospace) - weights: 100, 200, 300, 400, 500, 600, 700, 800
..."Show me 'Hello, world' in Playfair Display, bold italic, at 64px."
Calls preview_text with family: "Playfair Display", text: "Hello, world", size: 64, weight: 700, italic: true. Returns a one-line summary plus a self-contained HTML page that loads just that style:
Preview of Playfair Display (serif) at 64px, weight 700 italic, colour #111111.If the family doesn't have that weight and style, you get the list of variants it does have.
"How do I add Inter at 400 and 600 to my site?"
Calls get_embed_code with family: "Inter", weights: [400, 600]:
Embed code for Inter (weights 400, 600):
HTML (place in <head>):
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
CSS:
font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;Results come from the live Google Fonts catalogue, so exact lists and weights may differ.
Installation
npx (recommended)
No install step. Your MCP client runs the server on demand:
npx -y google-fonts-mcpRequires Node.js 18 or later. See Configuration for the Claude Desktop setup.
From source
git clone https://github.com/Maxamed-Maxamed/google-fonts-mcp.git
cd google-fonts-mcp
npm install
npm run buildThe built server is dist/index.js.
Getting a Google Fonts API key
Go to console.cloud.google.com and sign in.
Create a project, or select an existing one, from the project picker in the top bar.
Open APIs & Services → Library, search for Web Fonts Developer API, and click Enable.
Open APIs & Services → Credentials, click Create credentials → API key, and copy the key.
Optional: click Edit API key and, under API restrictions, restrict it to the Web Fonts Developer API.
The key is read from the GOOGLE_FONTS_API_KEY environment variable. When running from source you can put it in a .env file instead:
cp .env.example .env
# then edit .env and set GOOGLE_FONTS_API_KEYConfiguration
Add the server to your claude_desktop_config.json:
OS | Config file path |
Windows |
|
macOS |
|
macOS
{
"mcpServers": {
"google-fonts": {
"command": "npx",
"args": ["-y", "google-fonts-mcp"],
"env": {
"GOOGLE_FONTS_API_KEY": "your_api_key_here"
}
}
}
}Windows
{
"mcpServers": {
"google-fonts": {
"command": "cmd",
"args": ["/c", "npx", "-y", "google-fonts-mcp"],
"env": {
"GOOGLE_FONTS_API_KEY": "your_api_key_here"
}
}
}
}Running a local build
Point node at the built file instead of using npx:
{
"mcpServers": {
"google-fonts": {
"command": "node",
"args": ["/absolute/path/to/google-fonts-mcp/dist/index.js"],
"env": {
"GOOGLE_FONTS_API_KEY": "your_api_key_here"
}
}
}
}On Windows, escape backslashes in the path (C:\\Users\\you\\google-fonts-mcp\\dist\\index.js) or use forward slashes.
Restart Claude Desktop after editing the config.
Tool reference
Family names are matched case-insensitively. If no family matches, the error lists up to five close matches.
search_fonts
Search families by name and/or category. Results are sorted by popularity. Provide at least one of query or category.
Parameter | Type | Required | Default | Description |
| string | No | — | Case-insensitive text to match anywhere in the family name |
| string | No | — | One of |
| number | No |
| Maximum results, integer from 1 to 50. Values above 50 are capped at 50 |
Returns a numbered list of families with their category and available weights.
get_font_details
Get full metadata for one family.
Parameter | Type | Required | Default | Description |
| string | Yes | — | Exact family name, e.g. |
Returns the category, weights, variants, subsets, version and last-modified date.
preview_text
Render sample text in a font. The weight and italic combination must exist in the family.
Parameter | Type | Required | Default | Description |
| string | Yes | — | Family name, e.g. |
| string | No |
| Sample text to render |
| number | No |
| Font size in pixels, 8 to 200 |
| number | No |
| Font weight as an integer, e.g. |
| boolean | No |
| Render in italic |
| string | No |
| Hex ( |
Returns a summary line and a self-contained HTML page. The page loads only the requested style from the Google Fonts CSS API, and the sample text is HTML-escaped.
get_embed_code
Get the HTML and CSS needed to use a family on a web page.
Parameter | Type | Required | Default | Description |
| string | Yes | — | Family name, e.g. |
| number[] | No |
| Upright weights to load, as integers. Duplicates are removed |
Returns preconnect and stylesheet <link> tags plus a font-family declaration with a fallback stack that matches the font's category. If any requested weight is missing, the error lists the weights the family has.
Development
Project structure
google-fonts-mcp/
├── src/
│ ├── index.ts # MCP server: tool definitions, argument validation, handlers
│ ├── fonts.ts # Google Fonts API client, caching, search and fuzzy matching
│ └── preview.ts # Variant helpers, CSS2 URL builder, fallback stacks, HTML preview
├── dist/ # Compiled output (generated by npm run build)
├── .env.example # Template for GOOGLE_FONTS_API_KEY
├── package.json
└── tsconfig.jsonnpm scripts
Script | Command | What it does |
|
| Compile |
|
| Recompile on every change |
|
| Run the server on stdio |
Testing
There is no automated test suite yet. Test the tools interactively with the MCP Inspector:
npm run build
npx @modelcontextprotocol/inspector node dist/index.jsThe server loads .env automatically, so set your key there first. In the Inspector, open Tools, click List Tools, and call each tool with sample arguments.
Things worth checking after a change:
A misspelled family (e.g.
"Robotto") returns suggestions.preview_textwith a weight the family lacks returns the available variants.get_embed_codewith a missing weight returns the available weights.Starting without
GOOGLE_FONTS_API_KEYlogs a warning, and tool calls return a clear error.
The server writes logs to stderr because stdout carries the MCP protocol. Don't add console.log calls.
Contributing
Fork the repo and create a branch from
main.Make your change and run
npm run buildto make sure it compiles.Test the affected tools with the MCP Inspector.
Open a pull request that describes the change and how you tested it.
Bug reports and feature requests go in GitHub Issues.
License
MIT © Maxamed Maxamed
Available Tools
4 toolsget_embed_codeB
Get the HTML link tags and CSS font-family declaration to use a Google Font on a web page.
Inputs: family (required), weights.
get_font_detailsA
Get full metadata for a Google Fonts family: category, variants, subsets, version and last modified date.
Inputs: family (required).
preview_textA
Render sample text in a Google Font. Returns a self-contained HTML page. The weight/italic combination must exist in the family.
Inputs: family (required), size, text, colour, +2 more.
search_fontsA
Search Google Fonts by family name and/or category. Results are sorted by popularity. Provide at least one of query or category.
Inputs: limit, query, category.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct role: finding fonts, inspecting metadata, previewing text, and generating embed code. There is no functional overlap between any of the tools.
All tool names follow a consistent verb_noun snake_case pattern: search_fonts, get_font_details, preview_text, get_embed_code. This makes the toolset predictable and easy to navigate.
Four tools is well-scoped for a Google Fonts MCP server. Each tool covers a distinct stage in the font selection and integration workflow without redundancy.
The toolset covers the full practical lifecycle: discovering fonts, examining their metadata, previewing custom text, and obtaining integration code. No critical workflow is missing for typical font lookup and embedding use cases.
Maintenance
Related MCP Connectors
MCP server for Google Veo AI video generation
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
AI tool directory MCP server, live since July 2026. Tools, agents, models, companies, services.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceAn MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.262-
- AlicenseNot gradedqualityDmaintenanceA server that provides a Machine Control Protocol (MCP) interface to search, access, and interact with Google Drive files and folders, enabling AI assistants to work with Google Drive content.8MIT
- AlicenseAqualityBmaintenanceMCP server for searching Google Fonts and generating complete CSS/Tailwind typographic systems with font pairings and modular scales.5149 PyPI21MIT
- AlicenseAqualityDmaintenanceA unified MCP server for Glyphs font design software, integrating handbook queries and API reference lookups. Enables searching documentation, managing plugins, and accessing development templates through Claude.25MIT