ReftrixMCP
Web design analysis MCP server with 20 tools for layout extraction, motion detection, quality scoring, and semantic search. Uses Playwright, pgvector HNSW, and Ollama Vision to turn web pages into searchable, structured design knowledge.
README
ReftrixMCP
Web design knowledge base platform -- layout analysis, motion detection, and quality evaluation via MCP tools.
For frontend engineers, designers, and AI-agent builders who want to analyze real websites and retrieve reusable UI patterns via Claude or any MCP client.
<a href="https://glama.ai/mcp/servers/@TKMD/reftrix-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@TKMD/reftrix-mcp/badge" alt="ReftrixMCP MCP server" /> </a>
<details> <summary>Japanese / 日本語の概要</summary>
ReftrixMCPは、Webデザインパターンをベクトル検索(pgvector HNSW)と RAGで検索可能なナレッジベースに集約し、MCPツール経由でClaude等の AIエージェントと統合するプラットフォームです。
主要機能: レイアウト分析 / モーション検出 / 品質評価 / セマンティック検索 / レスポンシブ解析
20のMCPツールを提供: Layout(5) / Motion(2) / Quality(3) / Page(2) / Narrative(1) / Background(1) / Responsive(1) / Style(1) / Brief(1) / Project(2) / System(1)
詳細な日本語ドキュメント: docs/README.ja.md
</details>
What it does
- Layout analysis -- auto-detect sections (hero, feature, CTA, etc.), extract grid/typography, and generate React/Vue/HTML code
- Motion detection -- discover CSS/JS animations with frame capture (15 px/frame video mode), CLS detection via Pixelmatch
- Quality evaluation -- score designs on three axes (originality, craftsmanship, contextuality) with anti-AI-cliche detection
- Semantic search -- find layout, motion, narrative, background, and responsive patterns via pgvector HNSW hybrid search
- Vision integration -- Ollama llama3.2-vision for richer layout, motion, and narrative understanding
- Code generation -- convert analyzed sections to React, Vue, or plain HTML with matched motion patterns
Why ReftrixMCP
| Layout-aware | Sections, grids, and typography extracted as structured data -- not just screenshots |
| Motion-aware | CSS static analysis + frame-by-frame video capture for real animation behavior |
| Quality-aware | Three-axis scoring with actionable improvement suggestions |
| Searchable | 768-dim multilingual embeddings (e5-base) with HNSW index and hybrid RRF ranking |
| MCP-native | 20 tools purpose-built for Claude Desktop and MCP Client CLI |
Quickstart
Run
page.analyzeon any URL in under 5 minutes.
Prerequisites
Node.js 20+, pnpm 10+, Docker & Docker Compose, Ollama
Setup
git clone https://github.com/TKMD/ReftrixMCP.git && cd ReftrixMCP
pnpm install
cp .env.example .env.local # edit DATABASE_URL / REDIS_URL as needed
cp .env.local packages/database/.env # Prisma CLI requires this copy
pnpm docker:up # PostgreSQL 18 + pgvector + Redis
pnpm db:migrate && pnpm db:seed
pnpm build
pnpm exec playwright install chromium # browser for page crawling
curl -fsSL https://ollama.com/install.sh | sh # install Ollama
ollama pull llama3.2-vision # vision model (~2 GB)
ollama serve # keep running in a separate terminal
Note: If you change
.env.local, also updatepackages/database/.env.page.analyzeworkers start automatically -- no manual worker launch needed. See Getting Started for GPU configuration and details.
Connect to Claude
Add to your MCP config:
- Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) - MCP Client CLI:
.mcp.jsonin the project root or~/.claude/.mcp.json
{
"mcpServers": {
"reftrix": {
"command": "node",
"args": ["/absolute/path/to/ReftrixMCP/apps/mcp-server/dist/index.js"],
"env": {
"NODE_ENV": "development",
"DATABASE_URL": "postgresql://reftrix:change_me@localhost:26432/reftrix?schema=public",
"REDIS_URL": "redis://localhost:27379",
"OLLAMA_BASE_URL": "http://localhost:11434"
}
}
}
}
Replace
change_mewith a secure password. Port 26432 = standard 5432 + 21000 offset.
Example tools
ReftrixMCP provides 20 MCP tools. Key examples:
layout.ingest-- fetch a web page, take a screenshot, and extract section patternslayout.search-- semantic search over layout sections by natural-language querymotion.detect-- detect CSS/JS animations with video-mode frame capturequality.evaluate-- score design quality on originality, craftsmanship, and contextualitypage.analyze-- unified analysis: layout + motion + quality in one call (async via BullMQ)responsive.search-- search responsive analysis results by viewport and breakpoint
Full tool reference: MCP Tools Guide
Architecture
MCP Client (Claude Desktop / Code) --stdio--> MCP Server (20 tools, Zod)
+-- Service Layer: Playwright, Sharp+Pixelmatch, DOMPurify
+-- ML Layer: ONNX Runtime (multilingual-e5-base, 768-dim)
+-- BullMQ Workers: page.analyze, quality.evaluate
+-- PostgreSQL 18 + pgvector 0.8 (HNSW, tsvector) + Redis 7
Documentation
| Guide | Description |
|---|---|
| Getting Started | Installation, setup, and first analysis |
| MCP Tools Guide | All 20 tools with usage examples |
| page.analyze Deep Dive | Async analysis flow and data structures |
| Troubleshooting | Common issues and solutions |
Known limitations
- CPU-mode embedding takes ~2-5 s per text; GPU recommended for batch workloads
- Minimum 8 GB RAM; 16 GB recommended for concurrent analysis
- First embedding call downloads ~400 MB model (multilingual-e5-base)
page.analyzeworkers auto-start via WorkerSupervisor; manual launch is not required- Vision analysis (layout, motion, narrative) requires Ollama +
llama3.2-visionrunning locally
License
AGPL-3.0-only -- see LICENSE.
Network use requires source disclosure per Section 13. Source: github.com/TKMD/ReftrixMCP Commercial license: licence@reftrix.io
Contributing
See CONTRIBUTING.md.
Security
Report vulnerabilities per SECURITY.md. Privacy: docs/legal/PRIVACY_POLICY.md | Third-party licenses: THIRDPARTY_LICENSES.md
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.