page-patterns
v1.0.0
Published
Pattern backgrounds for website sections, designed by your AI agent: the Page Patterns MCP server and functions.
Maintainers
Readme
Page Patterns MCP server
Pattern backgrounds for website sections, designed by your AI agent. Page Patterns makes geometric SVG backgrounds (low-poly triangles, hexagons, halftone dots, isometric cubes, fine line and contour textures and more) that stay quiet behind your headline. This package lets agents such as Claude Code use it: the agent reads your page, explores variants, shows you options in your real page and adds the one you pick.
Everything runs on your computer, and the package draws the same SVG as the editor at pagepatterns.com.
Setup
Needs Node 22 or later. You also need a free key.
- Sign in at pagepatterns.com/account with GitHub or Google and make a key.
- Add the server to your AI tool.
Claude Code, with the plugin (recommended). The plugin adds the server and a skill that teaches Claude the workflow, and asks for your key.
claude plugin marketplace add OldMillennial/page-patterns-claude
claude plugin install page-patterns@page-patternsClaude Code, server only:
claude mcp add --scope user --env PAGE_PATTERNS_KEY=<your key> --transport stdio page-patterns -- npx -y page-patterns@1 mcpCursor, Claude Desktop and other MCP apps: add this to the app's MCP settings.
{
"mcpServers": {
"page-patterns": {
"command": "npx",
"args": ["-y", "page-patterns@1", "mcp"],
"env": { "PAGE_PATTERNS_KEY": "<your key>" }
}
}
}Then ask, for example: "Make the hero background on my home page more interesting."
Tools
| Tool | What it does |
|---|---|
| guide | The full workflow and design rules (for agents without the skill) |
| describe_options | Presets, shapes and what each suits, strength levels, emphasis options, advanced settings |
| explore | Up to 16 variants for one site, as one contact sheet image plus a code per variant |
| preview | 1 to 4 codes at desktop and phone size |
| export | The final SVG for a code: inline markup with CSS and variables, a file, a CSS background, React or Tailwind; a download URL, a share link, and insertInto or savePath to write it |
A code holds a variant's settings, so the server stores nothing. export with insertInto: { file, slot } replaces <svg data-page-patterns="slot"> in an HTML or PHP file and leaves every other byte alone. Pages set up with the older data-shape-studio attribute still work.
The downloadUrl that export returns carries a per-session key (k), so other web pages cannot make the server render; use the URL as given.
From code
import { explore, exportDesign } from 'page-patterns';
const { sheet, variants } = await explore({
site: { background: '#1d4ed8', width: 1440, height: 640, contentBox: { x: 120, y: 160, w: 640, h: 320 } },
variants: [{ preset: 'low-poly', colours: ['#ffffff'], strength: 'subtle', clearBehindContent: true }]
});
const { svg, css } = await exportDesign({ code: variants[0].code, parentSelector: '.hero' });sheet and the images from preview are PNG Buffers. The functions need the key in PAGE_PATTERNS_KEY, like the server.
Your key and privacy
The package checks your key with our account service, which runs on Supabase, about once a day and sends only the key. Your designs and your site's files never leave your computer. If the check can't reach the server, the tools keep working. See the privacy notice.
If a tool says the key is missing, not recognised or turned off, make a new one at pagepatterns.com/account. With the plugin, update it with /plugin, page-patterns, Configure options.
Settings
| Variable | Default | What it does |
|---|---|---|
| PAGE_PATTERNS_KEY | none | Your free key |
| PAGE_PATTERNS_APP_URL | https://pagepatterns.com/ | Where share links open |
| PAGE_PATTERNS_PORT | 4517 | Port on 127.0.0.1 for SVG downloads; a free port is used if another session holds it |
Licence
PolyForm Shield 1.0.0: free for any use, including commercial work, except building a product that competes with Page Patterns. The patterns you make are yours, as the terms say.
