
Reftrixmcp
io.github.TKMD由 GitHub 账号 TKMD 发布v0.1.8更新于 Oct 27, 2026
Web design analysis with 26 MCP tools: layout, motion, quality, semantic search via pgvector
概览
本地 MCP 服务器,抓取真实网站并建立可检索的网页设计知识库,涵盖布局、动效、质量与 UI 部件模式。
- 可以做什么
- 抓取并分析页面:截图、识别区块、栅格与排版,并生成 React、Vue 或 HTML 代码
- 检测 CSS/JS 动画并逐帧捕获,从原创性、工艺与情境契合度三方面为设计打分
- 对布局、动效、叙事、背景、响应式与 UI 部件数据进行语义检索,并支持图像相似度搜索
- 查看并对比按钮、图标、标题等 UI 部件的样式与布局,执行响应式及无障碍/性能检查
- 通过反馈会话管理设计偏好档案,并据此对搜索结果重新排序
- 适用场景
- 适合前端工程师、设计师和智能体开发者,希望助手分析线上网站、提取可复用的 UI 模式,并按自然语言或视觉相似度检索,而不是只看截图。
- 运行要求
- 以本地 Node.js 进程运行(Node.js 20+、pnpm),需 Docker 提供带 pgvector 的 PostgreSQL 18 与 Redis,并安装 Playwright Chromium。需要 DATABASE_URL(PostgreSQL 连接串),通常还需 REDIS_URL 与 OLLAMA_BASE_URL;视觉功能需本地 Ollama 与 llama3.2-vision。模型需下载数百 MB 至 1 GB 以上,内存至少 16 GB。
安装
在 SourceWeft 中
- 打开 控制台中的 Reftrixmcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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.
[License: AGPL-3.0-only] [TypeScript] [PostgreSQL] [MCP] [pnpm]
[ReftrixMCP MCP server]Japanese / 日本語の概要
ReftrixMCPは、Webデザインパターンをベクトル検索(pgvector HNSW)と RAGで検索可能なナレッジベースに集約し、MCPツール経由でClaude等の AIエージェントと統合するプラットフォームです。
主要機能: レイアウト分析 / モーション検出 / 品質評価 / セマンティック検索 / 横断検索 / 画像類似検索 / レスポンシブ解析 / 嗜好プロファイリング / パーツ分析 / レート制限 / 検索キャッシュ / BullMQ UI / SBOM
40のMCPツールを提供: Layout(5) / Motion(2) / Quality(1) / Page(4) / Narrative(1) / Background(1) / Responsive(2) / Preference(3) / Part(3) / Style(1) / Brief(1) / System(1) / Search(2) / Design(5) / Data(2) / Audit(1) / Embedding(1) / Accessibility(1) / Performance(1) / Report(1)
詳細な日本語ドキュメント: docs/README.ja.md
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
- Preference profiling -- learn user design preferences through feedback sessions and personalize search results via reranking (GDPR-compliant)
- Part-level analysis -- extract 16 UI part types (button, icon, heading, etc.) with DINOv2 visual embeddings for visual similarity search
- Vision integration -- Ollama llama3.2-vision for richer layout, motion, and narrative understanding
- Section post-processing -- auto merge/split sections by type, heading, and height (Rule 1-4) for optimal structure
- Multi-tile capture -- split large sections (>viewport height) into tiles for complete DINOv2 visual coverage
- Blank image detection -- detect lazy-loading unrendered sections and re-capture via Playwright for full coverage
- Code generation -- convert analyzed sections to React, Vue, or plain HTML with matched motion patterns
- Unified search -- cross-service search across layout, part, motion, background, and narrative patterns in a single query
- Image similarity search -- find visually similar designs via DINOv2 embeddings from Base64/URL input (RRF 3-source)
- Rate limiting -- Token Bucket + Redis Lua (CWE-770 DoS prevention), 3-tier (analysis 10 RPM / search 120 RPM / default 60 RPM)
- Search cache -- LRU in-memory cache (lru-cache v11) with TTL-based natural expiry (5 min)
- BullMQ UI -- Bull Board dashboard for monitoring async page.analyze jobs (port 21080)
- SBOM -- CycloneDX 1.6 auto-generation for EU CRA vulnerability reporting compliance
Why ReftrixMCP
Quickstart
Run
page.analyzeon any URL in under 5 minutes.
Prerequisites
Node.js ^22.23.4 || ^24.22.1 || ^26.12.1, pnpm 10+, Docker & Docker Compose, Ollama
Setup
Note: If you change
.env.local, also updatepackages/database/.env.page.analyzeworkers are auto-forked byWorkerSupervisorwhen the MCP server starts (v0.4.0 PR7d-2+). Manual start viapnpm --filter @reftrixmcp/mcp-server worker:start:pageis developer-only and requiresREFTRIX_ALLOW_MANUAL_WORKER=trueto bypass the Redis-based dual-run guard if the MCP server is also running. See Getting Started for GPU configuration and details.GPU / CUDA: CUDA binary download is skipped by default (CPU fallback). For GPU acceleration setup, see Troubleshooting: CUDA Detection.
pnpm "Ignored build scripts": On
pnpm install, pnpm 10 printsIgnored build scripts: @prisma/client, esbuild, sharp, ...and suggestsRun "pnpm approve-builds". This is expected, not an error — pnpm 10 blocks dependency build/lifecycle scripts by default as a supply-chain safeguard. Setup still completes becausesharpandesbuildship prebuilt binaries, and the Prisma client is generated by the@reftrixmcp/databaseworkspace package's ownpostinstall(prisma generate) duringpnpm install— a workspace lifecycle script, which pnpm does not gate behind the dependency build-script allowlist. Only runpnpm approve-buildsif you have a specific reason to let one of these blocked dependencies run its own native build step (onnxruntime-nodeis already allow-listed viapnpm.onlyBuiltDependencies, so it never appears in the ignored list; and CUDA acceleration is a separate opt-in — see the GPU / CUDA note above — notpnpm approve-builds).
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
Replace
change_mewith a secure password. Port 26432 = standard 5432 + 21000 offset.
OLLAMA_BASE_URLis used by the MCP server process;OLLAMA_HOSTis used by the worker process. Both must match if Ollama runs on a non-default port.
ENABLE_SECTION_SCREENSHOT_FALLBACKenables Playwright-based individual section screenshots for sections outside the initial screenshot range (WebGL/lazy-rendered pages). This significantly improves DINOv2 visual embedding coverage. Set to"false"to disable.Optional environment variables (defaults work out of the box):
MAX_TILES_PER_SECTION(default 20, max 100) -- max tiles per section for multi-tile capture.BLANK_IMAGE_STDDEV_THRESHOLD(default 5.0) -- stddev threshold for blank image detection.DUPLICATE_VECTOR_THRESHOLD(default 0.995) -- cosine similarity threshold for vision embedding dedup.EMBEDDING_IDLE_TIMEOUT_MS(default 30000) -- ONNX Worker VRAM auto-release timer (0 to disable).DINOV2_MODEL_PATH-- custom DINOv2 ViT-B/14 ONNX model path.EMBEDDING_CACHE_ENABLED(default true) -- enable/disable the Layout Embedding disk cache (additive opt-out flag; set"false"to write no cache files).REFTRIX_EMBEDDING_CACHE_ROOT(default/tmp/reftrix-embedding-cache) -- embedding cache root; a root resolving outsideos.tmpdir()is rejected by default (fail-closed). SetREFTRIX_EMBEDDING_CACHE_ROOT_ALLOW_FALLBACK=trueto instead degrade to the default root with a warning.
Example tools
ReftrixMCP provides 40 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 + responsive in one call (async via BullMQ), with opt-in Phase 7.5: accessibility audit, performance evaluation, and auto snapshotresponsive.search-- search responsive analysis results by viewport and breakpointpreference.hear-- interactive preference hearing sessions with sample presentation and feedback collectionpreference.get-- retrieve preference profiles (with GDPR data portability support)preference.reset-- reset or permanently delete preference profiles (GDPR Right to Erasure)part.search-- semantic search over UI parts with visual (DINOv2) or text embeddingspart.inspect-- get detailed part info including computed styles, bounding box, and accessibilitypart.compare-- compare 2-5 parts side by side on styles, layout, and interaction
Full tool reference: MCP Tools Guide
Architecture
Documentation
Known limitations
onnxruntime-nodeis an optional dependency thatpnpm installinstalls by default (it powers the ML features — embedding and visual search). If it fails to install on an unsupported platform, or you skip it withpnpm install --no-optional, the non-ML tools (layout analysis, quality evaluation, code generation) still work- CPU-mode embedding takes ~2-5 s per text; GPU recommended for batch workloads
- Minimum 16 GB RAM; 32 GB recommended for concurrent analysis with Ollama Vision
- First embedding call downloads ~1.1 GB ONNX model (multilingual-e5-base, FP32) into the transformers.js cache. Verify integrity at any time with
pnpm --filter @reftrixmcp/ml repair:e5-cache --check; pass--repairto re-download on size/SHA-256 mismatch, or--forceto always re-download page.analyzeworkers are auto-forked byWorkerSupervisorwhen the MCP server starts (v0.4.0 PR7d-2+); manual start is developer-only (REFTRIX_ALLOW_MANUAL_WORKER=truerequired when MCP server is running)- Vision analysis (layout, motion, narrative) requires Ollama +
llama3.2-visionrunning locally - DINOv2 visual embedding model requires ~330 MB download (ViT-B/14 ONNX)
Release notes / リリースノート
- npm publish automation — Trusted Publishing / OIDC (2026-07-12): npm publishing is now driven by CI. Creating a GitHub Release for a
v*tag triggers.github/workflows/publish.yml, which publishes the 5 packages (@reftrixmcp/core,@reftrixmcp/database,@reftrixmcp/ml,@reftrixmcp/webdesign-core,@reftrixmcp/mcp-server) in dependency order via npm Trusted Publishing (OIDC) — noNPM_TOKENsecret is used, and every package is published with--provenance. Averifyjob builds and validates all tarballs first; apublishjob runs only after thenpm-publishGitHub Environment's required-reviewer approval. / npm 公開自動化 — Trusted Publishing / OIDC(2026-07-12): npm 公開は CI 駆動になりました。v*タグの GitHub Release を作成すると.github/workflows/publish.ymlが起動し、5 パッケージ(@reftrixmcp/core・@reftrixmcp/database・@reftrixmcp/ml・@reftrixmcp/webdesign-core・@reftrixmcp/mcp-server)を依存順に npm Trusted Publishing (OIDC) で公開します —NPM_TOKENシークレットは使用せず、各パッケージは--provenance付きで公開されます。verifyjob が先に全 tarball を build・検証し、publishjob はnpm-publishGitHub Environment の required-reviewer 承認の後にのみ実行されます。 - Plan v4.4 PR-N (2026-05-17):
WorkerSupervisorOptions.restartDelayMsfield formal removal + env-only canonical SSOT consolidation per ADR-0035 Amendment 1 §Decision 5. TheWORKER_RESTART_DELAY_MSandEMBEDDING_BACKFILL_RESTART_DELAY_MSenvironment variables are now the sole source of truth for per-type restart cooldown values; resolution is performed viagetRestartDelayMsForType(workerType). Server version bumped to 0.6.0. /WorkerSupervisorOptions.restartDelayMsフィールドを正式削除し、ADR-0035 Amendment 1 §Decision 5 に従い env-only canonical SSOT へ一元化。WORKER_RESTART_DELAY_MSとEMBEDDING_BACKFILL_RESTART_DELAY_MS環境変数が per-type restart cooldown 値の唯一の真実源となり、getRestartDelayMsForType(workerType)経由で解決される。サーバーバージョンを 0.6.0 に bump。
License
AGPL-3.0-only -- see LICENSE.
Network use requires source disclosure per Section 13. Source: github.com/TKMD/ReftrixMCP Commercial license: [email protected]
Contributing
See CONTRIBUTING.md.
Security
Report vulnerabilities per SECURITY.md. Privacy: docs/legal/PRIVACY_POLICY.md | Profiling privacy: apps/mcp-server/PRIVACY.md | Data retention: apps/mcp-server/DATA_RETENTION.md | Third-party licenses: THIRDPARTY_LICENSES.md
来源:README.md,提交 52ef3b8
工具
0版本历史
1- v0.1.8最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分