front-design-mcp
The front-design-mcp server is a local-first MCP server that gives AI agents frontend UI/UX intelligence by indexing and searching frontend component catalogs, design patterns, and motion libraries. You can:
Perform liveness and readiness checks (
front_design_ping,front_design_health) to see server status, retrieval mode, and index counts.Discover frontend resources (
discover_frontend_resources) with extensive filtering (kind, framework, license, etc.).Search documentation chunks (
search_frontend_knowledge) using BM25 or hybrid search, getting citations and provenance.Get detailed resource info (
get_resource_details) by ID, including related chunks and licensing.Compare options (
compare_frontend_options) side-by-side, separating facts from inferences.Get stack recommendations (
recommend_frontend_stack) based on requirements, constraints, and aesthetics.Find components/patterns (
find_components) from a plain-language intent (e.g., 'hero', 'navbar').Find animation patterns (
find_animation_patterns) with accessibility and performance notes.Build an implementation brief (
build_frontend_brief) from a product description, with stack, components, motion, design tokens, and acceptance criteria.
All outputs include provenance, licenses, and a clear split between facts and inferences.
Generates embeddings through an OpenAI-compatible API for vector and hybrid search of indexed frontend resources when PostgreSQL + pgvector is configured.
Provides an optional PostgreSQL + pgvector storage backend enabling full-text, vector, and hybrid (RRF) retrieval of frontend resources.
Provides the default local SQLite storage backend with BM25 lexical search for offline frontend resource discovery.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@front-design-mcp find a responsive navbar component with dropdown"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🎨 front-design-mcp
Local-first FastMCP server that gives AI agents frontend UI/UX intelligence
front-design-mcp indexes offline frontend catalogs (components, patterns, motion libraries) and exposes discover / search / compare / recommend tools over stdio MCP — SQLite + BM25 by default, with optional PostgreSQL + pgvector hybrid search when you add an embedding provider.
✨ Key Features
📦 Offline by default — SQLite + BM25 needs no PostgreSQL, no API key, and no network
🧰 10 MCP tools — discover, search, details, compare, recommend, find components/animations, and build implementation briefs
📚 Measured corpus — 90 resources / 221 chunks from 6 sources (fixtures under
data/fixtures/)🐘 Optional PostgreSQL + pgvector — lexical (
tsvector), vector, and hybrid (RRF) when an embedding provider is configured🔐 Agent-safe outputs — provenance, licenses, and a clear split between facts and inferences
🔄 Incremental ingest — content-hash sync, optional prune, embedding reuse; exit codes
0/1/2(partial)🔌 stdio only — no HTTP transport and no authentication are implemented (not production ready)
Related MCP server: AI Knowledge Center MCP
🏗️ Architecture
flowchart LR
Client[MCP client] --> Server[FastMCP server]
Server --> Handlers[Tool handlers]
Handlers --> Search[SearchService]
Search --> BM25[BM25 in-process]
Search --> PGSearch[PostgreSQL tsvector + pgvector]
BM25 --> StoreIface[Store interface]
PGSearch --> StoreIface
StoreIface --> Sqlite[SqliteStore]
StoreIface --> Postgres[PostgresStore]
Ingest[front-design-ingest CLI] --> Adapters[Source adapters]
Adapters --> Fixtures[Fixtures]
Adapters --> StoreIface
Embed[Embedding provider] --> PGSearch🔀 Storage & Search Modes
SQLite + BM25 is the default and needs no PostgreSQL, no API key, and no network.
Vector and hybrid search require both PostgreSQL + pgvector and an embedding provider. SQLite mode has neither. Hybrid search only applies in that PostgreSQL + provider configuration — call front_design_health to see whether hybrid is actually active.
SQLite (default) | PostgreSQL + pgvector | |
External services | None | PostgreSQL 15+ with the pgvector extension (verified on 16.14 + pgvector 0.6.0) |
Extra dependencies | None beyond the base install |
|
Lexical strategy | In-process BM25 ( | PostgreSQL |
Vector search | No | Yes, when an embedding provider is configured |
Hybrid / RRF | No | Yes, when vector search is available ( |
Migrations | Automatic SQLite schema on open | Alembic ( |
Filters |
| Same filters, pushed into SQL |
Best for | Local / offline agents, zero infra | Semantic + hybrid retrieval with a chosen embedding model |
Measured retrieval quality
26 hand-labelled English+Spanish queries, corpus 90/221, rrf_k=60, fastembed / BAAI/bge-small-en-v1.5 / 384 dims:
config | Recall@10 | MRR@10 | nDCG@10 |
sqlite-bm25 | 0.696 | 0.826 | 0.701 |
postgres-lexical | 0.710 | 0.810 | 0.709 |
postgres-vector | 0.884 | 0.870 | 0.813 |
postgres-hybrid | 0.862 | 0.899 | 0.823 |
With sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 (384 dims) instead: postgres-vector 0.870 / 0.822 / 0.770 and postgres-hybrid 0.899 / 0.920 / 0.846.
⚠️ Caveat: 26 hand-labelled queries on a 90-resource corpus is far too small for statistical significance. Latency figures are deliberately omitted here because they are single-machine, tiny-corpus numbers — see docs/evaluation.md.
📋 Requirements
Python 3.11 or 3.12 (
requires-python >= 3.11)Package
0.1.0, licence Apache-2.0Pinned core: FastMCP 3.4.5, mcp 1.29.0, pydantic 2.13.4, rank-bm25 0.2.2
Default path: no database server, no API key, no network
Optional PostgreSQL path: PostgreSQL 15+ with the pgvector extension (tested on 16.14 + pgvector 0.6.0)
Optional embeddings: OpenAI-compatible API (
--extra embeddings) or local fastembed (uv sync --group local)
🚀 Quick Start (SQLite, default)
uv sync --all-extras
uv run front-design-ingest --offline
uv run front-design-mcp
# equivalent:
# uv run python -m front_design_mcpThis writes a SQLite store under ./data/store/ (or FRONT_DESIGN_DATA_DIR) and starts the MCP server on stdio. No PostgreSQL, no API key, no network.
🐘 PostgreSQL + pgvector Setup
Opt-in path for lexical + vector + hybrid retrieval.
1. Start PostgreSQL (dev Compose)
docker-compose.yml ships a development-only pgvector/pgvector:pg16 service (user/password/db front_design / front_design / front_design, bound to 127.0.0.1:5432):
docker compose up -d
docker compose ps # wait until healthy💡 Those credentials are dev defaults only — do not use them in production.
2. Install extras and configure
uv sync --extra postgres
# For local embeddings also:
# uv sync --extra postgres --group local
# Or with everything:
# uv sync --all-extras --group localexport FRONT_DESIGN_STORE_BACKEND=postgres
export FRONT_DESIGN_DATABASE_URL=postgresql+psycopg://front_design:front_design@127.0.0.1:5432/front_design
# Choose an embedding provider BEFORE migrating (dimension is fixed at migration time).
export FRONT_DESIGN_EMBEDDING_PROVIDER=fastembed
export FRONT_DESIGN_EMBEDDING_MODEL=BAAI/bge-small-en-v1.5
# OpenAI alternative:
# export FRONT_DESIGN_EMBEDDING_PROVIDER=openai
# export FRONT_DESIGN_EMBEDDING_MODEL=text-embedding-3-small
# export FRONT_DESIGN_EMBEDDING_API_KEY=YOUR_OPENAI_API_KEY_HERE⚠️ The
embeddings.embeddingcolumn is created asvector(N)from the configured provider/model (or an explicitFRONT_DESIGN_EMBEDDING_DIMENSIONS). There is no default: if the dimension cannot be derived, the migration fails rather than guessing. Changing to a different dimension later requires a fresh schema and a full re-embed.
🛡️ Switching to a different model of the same dimension passes every dimension check but makes similarity scores meaningless. The server compares the configured model against the identities actually stored, and if they disagree it skips the vector branch, answers with lexical search, and reports the mismatch through
front_design_healthinstead of returning plausible-looking nonsense. Re-run ingest to re-embed.
3. Migrate and ingest
uv run alembic upgrade head
uv run front-design-ingest --offline
uv run front-design-mcpConfirm hybrid is live with the front_design_health tool (capabilities.hybrid_search / search.effective_mode).
⚙️ Configuration
All settings use the FRONT_DESIGN_ prefix (see .env.example and src/front_design_mcp/config.py). There are no connection-pool settings — pooling is not implemented.
Core
Variable | Default | Meaning |
|
| Root for fixtures, cache, and store artifacts |
|
| SQLite database path |
|
|
|
|
| HTTP timeout (seconds) for network ingest |
|
| Allow |
Storage
Variable | Default | Meaning |
|
|
|
|
| Required for postgres ( |
|
| Statement timeout; |
Embeddings
Variable | Default | Meaning |
|
|
|
|
| Provider default when unset |
|
| Optional override; must match the model |
|
| Required for |
|
| OpenAI-compatible base URL override |
|
| Embed batch size |
|
| Provider timeout (seconds) |
|
| Provider retry count |
|
| Bump to force re-embedding after chunking changes |
Providers
Provider | Install | Models (native dims) |
| (default) | Vector search disabled |
|
|
|
|
|
|
Search
Variable | Default | Meaning |
|
|
|
|
| Reciprocal Rank Fusion smoothing constant |
|
| Lexical branch weight (untuned) |
|
| Vector branch weight (untuned) |
|
| Per-branch candidate pool before fusion |
🧰 MCP Tools Available
Tool | Purpose |
| Liveness — version, backend, embedding provider, indexed resource count |
| Readiness — effective retrieval mode, hybrid/vector availability, counts |
| Browse/filter the catalog (kind, framework, tags, license, …) |
| Search documentation chunks (BM25 or hybrid depending on config) |
| Full resource + related chunks by |
| Compare options by id/name; separates facts from inferences |
| Stack suggestion from requirements + constraints |
| Intent → components/patterns |
| Motion patterns with a11y / cost notes when known |
| Implementation brief from a product description |
Also registered:
Kind | Name |
Resource |
|
Resource template |
|
Prompt |
|
🔌 Client configuration
Copy the examples under configs/ and replace /absolute/path/to/front-design-mcp with your clone path.
Cursor / Claude Desktop — SQLite (default)
{
"mcpServers": {
"front_design_mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/front-design-mcp",
"python",
"-m",
"front_design_mcp"
],
"env": {
"FRONT_DESIGN_LOG_LEVEL": "INFO",
"FRONT_DESIGN_ENABLE_NETWORK_INGEST": "false",
"FRONT_DESIGN_EMBEDDING_PROVIDER": "none"
}
}
}
}Cursor / Claude Desktop — PostgreSQL + embeddings
{
"mcpServers": {
"front_design_mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/front-design-mcp",
"python",
"-m",
"front_design_mcp"
],
"env": {
"FRONT_DESIGN_LOG_LEVEL": "INFO",
"FRONT_DESIGN_ENABLE_NETWORK_INGEST": "false",
"FRONT_DESIGN_STORE_BACKEND": "postgres",
"FRONT_DESIGN_DATABASE_URL": "postgresql+psycopg://USER:PASSWORD@127.0.0.1:5432/DBNAME",
"FRONT_DESIGN_EMBEDDING_PROVIDER": "fastembed",
"FRONT_DESIGN_EMBEDDING_MODEL": "BAAI/bge-small-en-v1.5"
}
}
}
}For OpenAI embeddings, set FRONT_DESIGN_EMBEDDING_PROVIDER to openai, pick a model, and set FRONT_DESIGN_EMBEDDING_API_KEY to YOUR_OPENAI_API_KEY_HERE (never commit a real key).
Example files: configs/cursor.mcp.json.example, configs/claude-desktop.mcp.json.example.
💻 CLI Quick Reference
# Server (stdio)
uv run front-design-mcp
uv run python -m front_design_mcp
# Ingest (exit 0=success, 1=failed, 2=partial)
uv run front-design-ingest --offline
uv run front-design-ingest --online # requires ENABLE_NETWORK_INGEST=true
uv run front-design-ingest --offline --source shadcn
uv run front-design-ingest --offline --prune
uv run front-design-ingest --offline --no-prune
uv run front-design-ingest --offline --embed
uv run front-design-ingest --offline --no-embed
uv run front-design-ingest --offline --backend sqlite
uv run front-design-ingest --offline --backend postgres
uv run front-design-ingest --offline --json
# Migrations (postgres)
uv run alembic upgrade head
uv run alembic current
uv run alembic history
uv run alembic downgrade base
# Evaluation
uv run python scripts/evaluate_rag.py
uv run python scripts/benchmark_retrieval.py --markdown
uv run python scripts/benchmark_retrieval.py --config sqlite-bm25 --json
uv run python scripts/mcp_smoke.py🔄 Ingestion & Sync
Offline fixtures are the default (
--offline). Network ingest is off untilFRONT_DESIGN_ENABLE_NETWORK_INGEST=true.Chunks are written incrementally when any persisted field changes (title, content, tags, URL, version, licence — not only
content_sha256). Adapter-stampedlast_indexed_atalone does not force a rewrite.--prune(default) deletes store rows that disappeared from a source. A source whose adapter errored, or that had any item-level normalization failure, is never pruned (a partial catalog is not authoritative); the report recordsprune_skipped_reasonand the run ispartial.With an embedding provider,
--embed(default) generates vectors for changed embedded text (title + content) and reuses embeddings when that fingerprint + model identity still match; tag/URL/licence-only edits do not force re-embedding.--no-embedskips that step.Exit codes: 0 success, 1 failed, 2 partial (some sources/items failed while others succeeded).
📊 Evaluation & Benchmarks
scripts/evaluate_rag.py— CI gate (SQLite/BM25 only): tool cases + conservative ranking floors (~20% below the measured baseline), offline, no network, no embeddings. Abstention has no validated production threshold (measured rate is 0.0).scripts/benchmark_retrieval.py— comparessqlite-bm25,postgres-lexical,postgres-vector, andpostgres-hybridon the 26 hand-labelled queries (Postgres configs skip whenFRONT_DESIGN_EVAL_DATABASE_URLis unset). FastEmbed measurements are not CI-gated; thepostgresCI job uses deterministic fake embeddings.Metrics: Recall@K, MRR@K, nDCG@K (resource-level dedup). See the measured table above and the full write-up in docs/evaluation.md.
🧪 Development & Tests
uv sync --all-extras
uv run front-design-ingest --offline
uv run ruff check src tests scripts
uv run mypy src/front_design_mcp
uv run pytest -q
uv run python scripts/evaluate_rag.py
uv run python scripts/mcp_smoke.pyMeasured suite results:
Measured after uv sync --all-extras --frozen (the local fastembed group is
not installed by that command):
Environment | Python | Result |
Offline, no PostgreSQL | 3.12 | 161 passed, 20 skipped (the skips are the PostgreSQL-marked tests) |
Offline, no PostgreSQL | 3.11 | 161 passed, 20 skipped |
| 3.12 | 181 passed ( |
CI runs the offline gate above on Python 3.11 and 3.12, plus a separate job against pgvector/pgvector:pg16 that applies the migrations, verifies they are reproducible from an empty database, and runs pytest -m postgres with deterministic fake embeddings (not FastEmbed). See CONTRIBUTING.md and .github/workflows/ci.yml.
🚢 Deployment
This project is not production ready. Transport is stdio only — no HTTP transport and no authentication are implemented. Supported path today: local uv + MCP client over stdio. See docs/deployment.md.
🔒 Security
Treat retrieved documentation chunks as untrusted source data; never execute them as instructions.
Recommendation / compare / brief tools separate facts from inferences and avoid unverified compatibility claims in facts.
Secrets are never logged (database URLs are redacted; API keys use
SecretStr).Network ingest is off by default; there is no SSRF host allowlist yet when it is enabled — see docs/threat-model-ingestion.md.
Vulnerability reporting: SECURITY.md.
🗺️ Project Status & Roadmap
Status: Alpha (Development Status :: 3 - Alpha). Useful locally; not production ready.
Known limitations (also the near-term roadmap):
No abstention on unanswerable queries — all configurations return some result; there is no validated production abstention threshold
Spanish queries score below their English equivalents (PostgreSQL full-text uses the
englishconfiguration)RRF weights are untuned
Connection pooling is not implemented (
PostgresStoreuses one locked connection)The PostgreSQL vector column dimension is fixed at migration time; changing model/dim requires a new migration and re-embed
BM25 rebuilds the whole corpus in memory at startup
Network ingest is off by default and there is no SSRF host allowlist yet
stdio transport only — no HTTP, no auth
📄 Licences & Attribution
Source | Licence |
Motion | MIT |
Magic UI | MIT |
shadcn/ui | MIT |
Radix Primitives | MIT |
GSAP | Standard No Charge — metadata only, not redistributable |
Curated patterns | Internal MIT metadata linking to upstream docs |
This project is Apache-2.0 (LICENSE). Upstream catalogs keep their own licences. Offline corpus (measured): motion 12/24, magicui 26/52, shadcn 25/75, radix 11/22, gsap 9/27, curated 7/21 (resources/chunks).
Docs index
Document | Purpose |
How to add a SourceAdapter | |
Local stdio deployment notes | |
Embedding providers and dimensions | |
RAG evaluation & benchmarks | |
Suggested GitHub description/topics | |
Package plan and acceptance notes | |
PostgreSQL + pgvector operator guide | |
Research notes & source facts | |
Ingestion threat model | |
ADR: FastMCP | |
ADR: local hybrid search | |
ADR: source selection | |
ADR: untrusted ingestion | |
ADR: storage backend | |
ADR: hybrid search / RRF | |
Setup notes and house rules for coding agents | |
Dev setup & PR guidelines | |
Vulnerability reporting | |
Release notes | |
Environment template |
Available Tools
10 toolsbuild_frontend_briefARead-onlyIdempotent
Build an implementation brief from product_description + constraints: stack, components, motion system, suggested design tokens, responsive behavior, and acceptance criteria. Inferences are marked clearly.
Inputs: product_description (required), aesthetics, constraints, performance, +2 more. Returns: object
compare_frontend_optionsARead-onlyIdempotent
Compare frontend options by id or name. Primary parameter: options (list of ids/names). Deprecated alias: resources. Separates facts from inferences; never claims unverified compatibility.
Inputs: options, criteria, resources. Returns: object
discover_frontend_resourcesARead-onlyIdempotent
Browse and filter indexed frontend resources (components, patterns, libraries). Supports category/kind, framework, style/tags, license, accessibility, animation, maturity, source_id, limit, and offset. Returns paginated items with provenance.
Inputs: kind, tags, limit, style, +9 more. Returns: object
find_animation_patternsARead-onlyIdempotent
Find animation patterns for a query/use-case. Includes cost notes, accessibility, and prefers-reduced-motion support when known from indexed notes; cites sources.
Inputs: query (required), limit, use_case, framework. Returns: object
find_componentsARead-onlyIdempotent
Find components/patterns for an intent string (hero, pricing, navbar, dashboard, onboarding, microinteraction, scroll animation, …) with optional framework filter.
Inputs: intent (required), limit, framework. Returns: object
front_design_healthARead-onlyIdempotent
Readiness check — storage backend, effective retrieval mode, and index counts.
Reports what the server can actually do right now: which backend is open, whether vector and hybrid search are available, which embedding provider is configured, and how many resources, chunks, and embeddings are indexed. Never returns credentials; database URLs are redacted.
Inputs: no named parameters. Returns: object
front_design_pingARead-onlyIdempotent
Liveness check — package version, runtime mode, and indexed resource count.
Inputs: no named parameters. Returns: object
get_resource_detailsARead-onlyIdempotent
Fetch a normalized FrontendResource by id (resource id string, e.g. motion:motion-library), related sanitized documentation chunks, and license/attribution. Parameter name is id.
Inputs: id (required). Returns: object
recommend_frontend_stackARead-onlyIdempotent
Recommend a frontend stack from requirements, target_framework, constraints, aesthetics, accessibility, and performance. Returns recommendation, trade-offs, incompatibilities, plan, sources, with facts vs inferences.
Inputs: requirements (required), limit, aesthetics, constraints, +3 more. Returns: object
search_frontend_knowledgeARead-onlyIdempotent
Search frontend knowledge chunks. Uses BM25 on the SQLite backend and hybrid full-text + pgvector retrieval when PostgreSQL and an embedding provider are configured. Pass query plus optional filters (kind, framework, tags, source_id), limit, and detail_level (brief|standard|full). Returns scores, per-branch ranks, the retrieval mode actually used, citations, and provenance.
Inputs: query (required), kind, tags, limit, +3 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have distinct purposes: health checks separate liveness from readiness, and search vs browse vs find differ in mechanism. However, find_components overlaps somewhat with discover_frontend_resources, and compare/recommend/build are all advisory in nature, which could cause occasional misselection.
All tool names are snake_case and follow a verb_noun pattern. Minor inconsistency: front_design_ping and front_design_health use the front_design_ prefix, while others place 'frontend' in the middle or end (e.g., discover_frontend_resources). Overall still predictable.
10 tools is well-scoped for a frontend design knowledge and advisory server. Each tool covers a distinct part of the workflow: health, discovery, search, details, comparison, recommendation, and brief building. There's no bloat or thinness.
The server provides solid coverage for the core lifecycle of frontend design assistance: discover, search, retrieve details, compare, recommend, and build a brief. Minor gaps exist, such as missing an explicit way to list all available frameworks/categories or a dedicated 'list sources' endpoint, but these are not critical.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Related MCP Servers
- AlicenseBqualityDmaintenanceA local-first MCP server that provides AI agents with safe codebase access through file discovery, hybrid lexical-semantic search, and project introspection. It features durable local memory and semantic indexing while keeping all data and processing entirely on your local machine.7487 npm6MIT
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server that provides project context, verification gates, and structured tools for coding agents to discover knowledge, run diagnostics, and execute allowlisted commands within a repository.41 npmMIT
- AlicenseNot gradedqualityBmaintenanceLocal MCP server to index your codebase once and search it across AI sessions with keyword, semantic, or hybrid search, keeping all data on disk.91 npm3MIT
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server that indexes all projects on your machine and provides coding agents with briefings about each project's stack, services, and run instructions, so they can start sessions with context across all repos. No cloud, no accounts, no telemetry.6 npmMIT