PaletteCraft MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
PaletteCraft MCP
Start with one color. Build a complete design system.
Gallery: these six palettes come from actual runs of the project. The button labels show calculated foreground/background contrast, and each card reports the measured checks for its own theme.
An original, deterministic design-token engine for frontend and mobile development. Start with a brand color and a mood, produce coordinated light and dark semantic palettes, and receive measured contrast checks before using them in a UI.
14 semantic colors per theme, including text, surfaces, buttons, status text, outlines, and focus.
58 tested color pairs per generation: 29 in each theme.
Five moods: balanced, calm, vibrant, warm, and neutral.
Contrast checking and foreground adjustment with explicit pass/fail.
JSON, CSS custom properties, Tailwind CSS v4, and Flutter Material color roles.
Local computation only. No hosted service, API key, model, telemetry, arbitrary code execution, or network request from the tools.
Genuine MCP stdio via the official TypeScript SDK.
Quick start
Prerequisites: Node.js 20+ and an MCP client, such as Codex.
git clone https://github.com/ahmedsaeed1-eng/palettecraft-mcp.git
cd palettecraft-mcp
npm ci
npm run buildConnect the built server to Codex:
codex mcp add palettecraft -- node /absolute/path/to/palettecraft-mcp/dist/server.jsAlternatively configure the server in Codex's user config:
[mcp_servers.palettecraft]
command = "node"
args = ["/absolute/path/to/palettecraft-mcp/dist/server.js"]Use your real absolute path. On Windows, forward slashes or escaped backslashes work in TOML. See the Codex MCP configuration reference.
Then ask your agent:
Generate a calm palette from #0F766E for my app, check light and dark contrast, and return the Tailwind v4 design token export.
Related MCP server: design-token-bridge-mcp
MCP tools
generate_palette
Parameter | Required | Values/default |
| yes | Opaque six-digit color, e.g. |
| no |
|
| no |
|
Example input:
{
"seed": "#0F766E",
"mood": "calm",
"format": "all"
}Output is structured JSON with light and dark objects. Each has
tokens, contrastChecks, and a pass-count summary. The exports
object contains the requested integration snippets. JSON mode returns the
tokens and checks without additional snippet strings. Every check reports
the semantic foreground/background, ratio, threshold, pass flag, and usage.
check_contrast
Parameter | Required | Values/default |
| yes |
|
| yes |
|
| no |
|
Example input:
{"foreground":"#777777","background":"#FFFFFF","threshold":4.5}The input fails the 4.5:1 threshold. The tool returns a measured
suggestion, its ratio, and its own passes flag. A suggestion can fail
when the requested threshold is mathematically impossible for the chosen
background; the tool does not label it as a pass.
Semantic token reference
Token | Intended use |
background / surface / surfaceVariant | Canvas, panel, elevated/tinted panel |
text / textMuted | Body and secondary text on the three surfaces |
primary / onPrimary | Link or button fill, with label on button |
secondary / onSecondary | Secondary action and its label |
success / warning / error | Status text paired with an icon or label |
outline / focus | Control boundary or focus visual against surfaces |
Exports
CSS custom properties
Use the generated CSS in your app stylesheet, and set the theme attribute on the document root or theme container:
<body data-theme="dark">
<button class="primary">Continue</button>
</body>.primary {
background: var(--pc-primary);
color: var(--pc-on-primary);
}Tailwind CSS v4
The export combines the generated custom properties with top-level
@theme inline declarations. Tailwind utility classes reference the
current theme at runtime:
<div class="bg-pc-background text-pc-text">
<button class="bg-pc-primary text-pc-on-primary">Continue</button>
</div>It is designed for Tailwind CSS v4, not v3.
Flutter
The Dart export provides paletteCraftLight and paletteCraftDark
ThemeData values and explicit Material 3 color roles. Paste the snippet in
a Dart file in your app, then integrate both:
MaterialApp(
theme: paletteCraftLight,
darkTheme: paletteCraftDark,
themeMode: ThemeMode.system,
)Core Material color roles are mapped using the ColorScheme API. Other Flutter theme roles rely on framework defaults and require their own review. Always validate real app screens, states, and text sizes.
Explore the output: calm teal
Seed #0F766E, mood calm. Palette swatches and check totals below are
generated by the actual algorithm, not a hand-picked design mock.
Token | Light | Dark |
background |
|
|
surface |
|
|
text |
|
|
textMuted |
|
|
primary |
|
|
onPrimary |
|
|
secondary |
|
|
success |
|
|
warning |
|
|
error |
|
|
Measured pairs passed: light 29/29, dark 29/29.
Run the included example for the entire structured JSON report and snippets:
npm run exampleContrast methodology
The engine converts each opaque sRGB input to relative luminance and calculates the ratio of the brighter and darker color. Normal text pairs use the WCAG AA minimum of 4.5:1. Outline/focus pairs use 3:1. The standalone checker also supports 7:1. See WCAG 2.2 contrast and non-text contrast.
To improve a failing foreground, it searches the same hue and saturation
at 0.1% HSL lightness increments. The selected passing candidate minimizes
lightness displacement among those candidates; for multiple surfaces it
must pass against all of them. If none meets the threshold, the candidate
with the highest observed minimum contrast is returned with passes=false.
Pass/fail always uses the unrounded ratio.
PaletteCraft does not certify a UI as WCAG conformant. It checks listed opaque static color pairs, not alpha blending, gradients, rendered font size, focus geometry, dynamic states, color perception, or assistive technology. Never communicate status using color alone.
Development
npm ci
npm testTests cover reference luminance values, unrounded threshold decisions, hex/HSL conversion, feasible and impossible contrast adjustments, 45 seed/mood combinations across both themes, export consistency, and a real MCP client/server exchange including schema validation. Flutter and Tailwind snippets are inspected for token consistency; this test suite does not compile a Flutter app or build a Tailwind project.
No accounts or secrets are necessary.
License
MIT. Original design-token and contrast code by Ahmed Saeed. See THIRD_PARTY.md for independent dependency licenses and the referenced W3C specification.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Contrast checks with fixes, OKLCH harmonies, palettes, color-blind previews and code export.
Generate design systems: OKLCH colors, fluid type scales, spacing, shape, icon and motion tokens.
WCAG color contrast checks, nearest accessible color, CSS color conversion and palette pair checks.
Convert colours between hex, RGB, HSL, OKLCH and CMYK, and compute harmonies.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive color conversion, manipulation, analysis, and WCAG accessibility tools supporting multiple formats (hex, rgb, hsl, oklch, oklab) for design systems and web development.32 npm2MIT
- AlicenseAqualityDmaintenanceTranslates design tokens across platforms — extracts from Tailwind/CSS/Figma and generates native themes for Material 3, SwiftUI, and CSS variables with WCAG contrast validation.982 npm5MIT
- AlicenseAqualityCmaintenanceEnables AI agents to generate complete, deterministic design systems from a single brand color — harmonious palettes, font pairings, type and spacing scales, elevation shadows, responsive grids, motion presets, dark-mode themes, and WCAG contrast audits — and export them as CSS, JSON, Tailwind, or SCSS through natural conversation.1060 npmMIT
- AlicenseAqualityCmaintenanceEnables AI assistants to work with color: converting between formats like HEX, OKLCH and Display P3, checking and fixing WCAG 2 and APCA contrast, auditing palettes for accessibility and color blindness, and generating palettes, gradients, scales and design tokens.18MIT