design-dna-mcp
Extracts reusable UI patterns from websites into a searchable library using Playwright and Claude, enabling natural-language queries like 'find monospace technical labels'.
README
<div align="center">
<img src="dna.gif" width="200" />
Extract the design DNA of any website — a searchable library of reusable UI patterns, built for Claude.
<br>
<img src="docs/assets/capture-readout.png" alt="A crawl of linear.app: full-page capture alongside the extracted palette, typefaces, spacing scale, and component candidates" width="100%">
<sub>One crawl_website call on <code>linear.app</code> — full-page capture, 8-color palette, typefaces, spacing scale, 167 motion rules, and the component candidates that come out of it.</sub>
</div>
Design galleries (Godly, Awwwards, Minimal Gallery…) are great sources of ideas but poor databases. You bookmark a site because you liked one thing about it — a navigation treatment, a spacing system, a hover animation — and then you can never find it again.
This MCP server fixes that. Point it at any website and it:
- Captures the design evidence with Playwright — screenshots, DOM, computed styles, font hierarchy, color palette, spacing scale, and declared CSS motion
- Decomposes it with Claude into reusable design components ("Numbered section index (x.x labels)", "Image reveal hover", "Pill-shaped primary CTA") with category, description, style tags, and metadata
- Stores the components you choose to keep in a local SQLite library with vector embeddings
- Answers natural-language queries from any MCP client: "find sticky editorial navigation", "monospace technical labels", "sites like a technical product page"
The unit of knowledge is the component, not the website. A website is only evidence.
Example
> crawl_website("https://linear.app")
capture 1 · 9 screenshots · palette #f7f8f8/#0f1011/… · Inter Variable + Berkeley Mono · 167 motion rules
> extract_components(captureId: 1)
[navigation] Dark minimal top navigation — minimal, dark, swiss, saas
[typography] Monospace inline code tag — monospace, technical, terminal
[diagram] Numbered technical figure diagrams — technical, blueprint, isometric
[number-treatment] Numbered section index (x.x labels) — technical, monospace, editorial
[motion] Animated grid-dot background pattern — technical, ambient, blueprint
… 18 candidates
> save_component(captureId: 1, saveAll: true)
> find_components("monospace technical labels")
0.62 [typography] Monospace inline code tag https://linear.app/
0.61 [number-treatment] Numbered section index (x.x labels) https://linear.app/
Tools
| Tool | What it does |
|---|---|
crawl_website(url) |
Playwright capture: full-page + section screenshots, DOM, styles, fonts, palette, spacing scale, CSS motion. Versioned per crawl. No API cost. |
extract_components(url | captureId, focus?) |
One Claude vision call decomposes a capture into component candidates. Candidates are cached, not auto-saved — you curate. |
save_component(candidateId | captureId+saveAll | component) |
Persists components to the library with a Voyage embedding. Upserts on (sourceUrl, name). |
find_components(query, filters?) |
Semantic search with optional category/tag/theme/sourceUrl filters. |
search_designs(query) |
Same index grouped by source website — the "sites like this" view. |
ping |
Health check + library size. |
Setup
Requires Node 20+ and API keys for Anthropic (analysis) and Voyage AI (embeddings).
git clone https://github.com/olartgabo/design-dna-mcp.git
cd design-dna-mcp
npm install
npx playwright install chromium # one-time browser download
npm run build
If npm blocks install scripts, approve the native builds once:
npm install-scripts approve better-sqlite3
npm install-scripts approve esbuild
npm rebuild better-sqlite3 esbuild
Register in Claude Code
The most reliable way on any platform (use -s user to enable it in all your projects):
claude mcp add-json design-dna -s user '{"command":"node","args":["/absolute/path/to/design-dna-mcp/dist/index.js"],"env":{"ANTHROPIC_API_KEY":"sk-ant-...","VOYAGE_API_KEY":"pa-..."}}'
Register in Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"design-dna": {
"command": "node",
"args": ["/absolute/path/to/design-dna-mcp/dist/index.js"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-...",
"VOYAGE_API_KEY": "pa-..."
}
}
}
}
Environment variables
| Variable | Required | Default | Purpose |
|---|---|---|---|
ANTHROPIC_API_KEY |
for extract_components |
— | Claude vision analysis |
VOYAGE_API_KEY |
for save/search | — | Embeddings |
DESIGN_DNA_DATA_DIR |
no | ~/.design-dna-mcp |
SQLite DB + screenshots |
DESIGN_DNA_MODEL |
no | claude-sonnet-5 |
Analysis model |
DESIGN_DNA_EMBEDDING_MODEL |
no | voyage-3.5 |
Embedding model |
The server starts fine without keys — tools that need a missing key fail per-call with a clear error naming the variable. The library is shared across all your projects (it lives in the data dir, not the repo).
<sub>This project was previously named design-research-mcp. The old DESIGN_RESEARCH_* variables still work, and an existing ~/.design-research-mcp library is adopted in place — no migration needed.</sub>
How it works
website ─→ Playwright ─→ capture (screenshots · DOM · styles.json · css/)
│
▼
distiller (size-capped JSON + ≤6 images)
│
▼
Claude (one vision call, forced tool-use schema)
│
▼
candidates (cached, human-curated)
│ save_component
▼
SQLite + sqlite-vec (cosine) + Voyage embeddings
│
▼
find_components / search_designs (MCP)
Design decisions worth knowing:
- Bounded AI cost — extraction is one Claude call per site (distilled data + a handful of images), never per-element calls.
- Curation over hoarding — extraction produces candidates; only what you save becomes searchable.
saveAllexists when you want everything. - Everything local — SQLite + sqlite-vec in a single file, screenshots on disk. No Postgres, no S3, no services.
- Large payloads stay on disk — tool results carry paths and compact summaries, never base64 blobs.
Cost & rate limits
crawl_websiteis free (local Playwright).extract_components≈ oneclaude-sonnet-5call with ~5–10K input tokens + up to 6 images per site.- Embeddings are tiny Voyage calls per save/search — effectively negligible.
- Voyage's free tier allows ~3 requests/minute; the client retries with long backoff (up to ~70s), so rapid-fire searches feel slow until you add billing to the Voyage account.
Verified with MCPJam
Every tool in this server was exercised over a real stdio transport with MCPJam — schema validation, handshake, and live tool calls — not just unit tests. Reproduce it yourself:
npx @mcpjam/cli tools list --transport stdio --command node --args dist/index.js
npx @mcpjam/cli server doctor --transport stdio --command node --args dist/index.js
npx @mcpjam/cli tools call --transport stdio --command node --args dist/index.js \
--tool-name crawl_website --tool-args '{"url": "https://example.com"}'
Development
npm test # 51 offline tests (vitest) — local fixture site, no API keys needed
npm run dev # run from source via tsx
node scripts/try-crawl.mjs https://linear.app # crawl real sites (no keys needed)
node scripts/e2e.mjs https://linear.app # full live loop (needs both keys)
node scripts/mcp-smoke.mjs # stdio round-trip smoke test
Built spec-first. The full trail — requirements → design → tasks, with the verification sweep — lives in .claude/specs/design-dna-mcp/, and the original product vision is in docs/VISION.md.
Roadmap (v2)
classify_design(url)— style confidence scores (editorial 92%, swiss 85%, …)compare_designs(url1, url2)— shared vs unique patternsrecommend_components(project_description)— "I'm building a dark editorial portfolio" → curated component sets- Interaction recording — hover/scroll capture with measured easing, duration, stagger
- FTS5 hybrid search, gallery-site ingestion helpers
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。