Curated website design inspiration gallery, open zero-auth MCP server for AI agents, and shareable moodboard lists.
JavaScript ai-agentschatgptclaude-codecodexcurated-listcursordesign-gallerydesign-inspirationdesign-systemsdesign-tastefrontendmcpmcp-servermodel-context-protocolmoodboardopen-sourceui-designweb-design
Add interactive MCP Apps in-chat browser, server icons, and taste-matching tools
Ethan17e2e5be4c4d
diff --git a/README.md b/README.mdindex 5fcfd04..d2c78ce 100644--- a/README.md+++ b/README.md@@ -81,18 +81,27 @@ You do not need an account to curate a project brief for your agent or team:Your agent can call `get_saved_list` with `include_images: true` to inspect the editorial notes **and** receive the actual screenshot thumbnails inline as MCP image blocks — or call `create_saved_list` itself to assemble a shortlist and hand you back a link you can review in the browser.-## Available MCP tools+## Available MCP tools (with interactive in-chat UI)++In hosts that support **[MCP Apps](https://modelcontextprotocol.io/docs/extensions/apps)** (Claude Desktop, Claude.ai, Claude Code, ChatGPT, and Cursor), DesignTaste renders an interactive dark-studio gallery right inside the conversation: browse screenshots, switch category pills, search live, click into site details, heart sites into an in-chat moodboard tray, mint a `dt_...` share ID, or click **Use as direction** in one tap. Terminal and non-UI agents receive the exact same data cleanly as text (plus optional inline JPEG image blocks).++<p align="center">+ <img src="docs/images/mcp-app.png" alt="DesignTaste rendered inside a chat via MCP Apps: interactive dark-studio browser with search, category pills, website thumbnails, heart saving, and a sticky moodboard tray with Create share ID and Use as direction buttons." width="100%">+</p>| Tool | What it does || --- | --- |+| `browse_gallery` | Open the interactive DesignTaste browser inside chat with search, category pills, sorting, pagination, and heart moodboarding. || `search_sites` | Filter all 274+ curated websites by keyword, category, visual tag, or `popular` / `curated` / `newest` / `az` order. |-| `get_site` | Inspect editorial notes, URL, category, tags and metadata — pass `include_image: true` to receive the thumbnail directly as an MCP image block. |-| `list_categories` | List all 8 design categories with exact site counts and top visual tags. |-| `get_saved_list` | Load any shared `dt_...` moodboard in order, with optional inline thumbnail images for vision models. |+| `get_site` | Inspect editorial notes, similar references, tags and URL — pass `include_image: true` to receive the thumbnail directly as an MCP image block. |+| `find_similar_sites` | Match visually similar websites from a reference site ID (e.g. `linear`) or style tags and category. |+| `discover_random` | Pull a fresh random set of curated sites (optionally by category or tag) with a live **Shuffle** button. |+| `list_categories` | Explore all 8 design categories with counts, preview thumbnails, and clickable top visual tags. |+| `get_saved_list` | Render any shared `dt_...` moodboard in order, with optional inline thumbnail images for vision models. || `create_saved_list` | Create a shareable `dt_...` moodboard from valid catalog site IDs and return a clickable `designtaste.wtf/?list=...` URL. || `submit_site` | Submit any public HTTPS website URL directly into the curated review queue. |-The server also exposes MCP resources (`designtaste://catalog`, `designtaste://categories`) and a starter prompt (`design_brief_from_list`).+The server also exposes the `ui://designtaste/app.html` MCP App resource, data resources (`designtaste://catalog/summary`, `designtaste://categories`), server icons (`icon-192.png` + `favicon.svg`), and the `apply_saved_list` prompt.## The gallerydiff --git a/api/mcp-app.js b/api/mcp-app.jsnew file mode 100644index 0000000..09306c4--- /dev/null+++ b/api/mcp-app.js@@ -0,0 +1,1187 @@+/**+ * Interactive in-chat MCP App for DesignTaste (designtaste.wtf).+ *+ * Implements MCP Apps (`io.modelcontextprotocol/ui`, 2026-01-26) plus ChatGPT+ * `window.openai` fallbacks so Claude Desktop, Claude.ai, Claude Code Desktop,+ * ChatGPT, Codex, and Cursor render a clean dark-studio website browser right+ * inside the conversation.+ *+ * Security notes:+ * - Single self-contained HTML document; no external scripts or fonts.+ * - All untrusted catalog / saved-list text is inserted via `textContent`+ * (never `innerHTML`).+ * - External links strictly allow-list `https://` URLs.+ * - Only images from `https://designtaste.wtf` are declared in `resourceDomains`.+ */++export const PANEL_MIME = "text/html;profile=mcp-app";+export const APP_PANEL = "ui://designtaste/app.html";++export const APP_RESOURCE_META = {+ ui: {+ prefersBorder: false,+ domain: "designtaste.wtf",+ csp: {+ resourceDomains: ["https://designtaste.wtf"],+ connectDomains: [],+ frameDomains: [],+ },+ },+ "openai/widgetPrefersBorder": false,+ "openai/widgetDomain": "https://designtaste.wtf",+ "openai/widgetCSP": {+ resource_domains: ["https://designtaste.wtf"],+ connect_domains: [],+ },+ "openai/widgetDescription":+ "Interactive dark-studio website gallery for browsing designtaste.wtf, inspecting design notes, filtering by category or style tag, and assembling shareable moodboard lists.",+};++const MARK_SVG = `<svg width="24" height="24" viewBox="0 0 40 40" fill="none" aria-hidden="true"><rect width="40" height="40" rx="11" fill="url(#dt-g)" stroke="#ffffff" stroke-opacity="0.18" stroke-width="1.5"/><path d="M13 11.5h6.2c5.4 0 8.8 3.3 8.8 8.5s-3.4 8.5-8.8 8.5H13V11.5Zm4.2 3.5v10h1.9c3 0 4.6-1.8 4.6-5s-1.6-5-4.6-5h-1.9Z" fill="url(#dt-s)"/><circle cx="29.5" cy="11.5" r="2.6" fill="#ff4d6d"/><defs><linearGradient id="dt-g" x1="0" y1="0" x2="40" y2="40" gradientUnits="userSpaceOnUse"><stop stop-color="#1e1e24"/><stop offset="1" stop-color="#0b0b0d"/></linearGradient><linearGradient id="dt-s" x1="13" y1="11.5" x2="28" y2="28.5" gradientUnits="userSpaceOnUse"><stop stop-color="#ffffff"/><stop offset="1" stop-color="#a5b4fc"/></linearGradient></defs></svg>`;++const STYLE = `+:root {+ color-scheme: dark;+ --bg: #0b0b0d;+ --surface: #121216;+ --raised: #17171d;+ --sunken: #0e0e11;+ --text: #f4f4f6;+ --muted: #a1a1ad;+ --faint: #71717d;+ --line: rgba(255, 255, 255, 0.09);+ --line-strong: rgba(255, 255, 255, 0.18);+ --rim: rgba(255, 255, 255, 0.07);+ --iris: #a5b4fc;+ --iris-soft: rgba(165, 180, 252, 0.14);+ --heart: #ff4d6d;+ --heart-soft: rgba(255, 77, 109, 0.16);+ --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;+ --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;+ --ease: cubic-bezier(0.22, 1, 0.36, 1);+}+*, *::before, *::after { box-sizing: border-box; }+html, body { margin: 0; padding: 0; background: transparent; color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }+body { padding: 2px; }+h1, h2, h3, p { margin: 0; }+button, input, select { font: inherit; color: inherit; }+button { cursor: pointer; background: none; border: 0; padding: 0; }+button:disabled { opacity: 0.48; cursor: default; }+button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; }++.app {+ border-radius: 18px;+ border: 1px solid var(--line);+ background:+ radial-gradient(ellipse 60% 45% at 25% 0%, rgba(165, 180, 252, 0.08), transparent 70%),+ radial-gradient(ellipse 45% 40% at 85% 0%, rgba(255, 130, 155, 0.05), transparent 70%),+ var(--bg);+ overflow: hidden;+ box-shadow: inset 0 1px 0 var(--rim);+ transition: opacity 150ms var(--ease);+}+.app[aria-busy="true"] { opacity: 0.62; pointer-events: none; }++/* Header bar */+.bar {+ display: flex;+ align-items: center;+ gap: 10px;+ padding: 10px 14px;+ background: rgba(18, 18, 22, 0.88);+ border-bottom: 1px solid var(--line);+}+.brand {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ font-size: 14px;+ font-weight: 650;+ letter-spacing: -0.025em;+ color: var(--text);+ padding: 3px 6px 3px 2px;+ border-radius: 8px;+}+.brand:hover { background: rgba(255, 255, 255, 0.05); }+.brand-dot { font-weight: 450; color: var(--faint); }+.crumbs {+ display: flex;+ align-items: center;+ gap: 6px;+ min-width: 0;+ font-size: 12.5px;+ color: var(--muted);+ overflow: hidden;+}+.crumbs .sep { color: var(--faint); }+.crumbs .here {+ color: var(--text);+ font-weight: 550;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}+.crumbs .crumb-btn {+ color: var(--muted);+ padding: 2px 6px;+ border-radius: 6px;+}+.crumbs .crumb-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }+.grow { flex: 1; }+.bar-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }++/* Buttons */+.btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 6px;+ height: 30px;+ padding: 0 11px;+ border-radius: 9px;+ font-size: 12.5px;+ font-weight: 550;+ letter-spacing: -0.01em;+ white-space: nowrap;+ border: 1px solid var(--line);+ background: linear-gradient(180deg, #1d1d24 0%, #141419 100%);+ color: var(--text);+ box-shadow: inset 0 1px 0 var(--rim);+ transition: border-color 140ms var(--ease), background 140ms var(--ease), transform 120ms var(--ease);+}+.btn:hover:not(:disabled) { border-color: var(--line-strong); background: linear-gradient(180deg, #25252e 0%, #191920 100%); }+.btn:active:not(:disabled) { transform: scale(0.97); }+.btn-primary {+ background: linear-gradient(180deg, #ffffff 0%, #e4e4ec 100%);+ color: #0b0b0d;+ border-color: rgba(255, 255, 255, 0.5);+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);+}+.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffffff 0%, #f0f0f6 100%); border-color: #ffffff; }+.btn-iris {+ background: var(--iris-soft);+ color: #d4dcff;+ border-color: rgba(165, 180, 252, 0.32);+}+.btn-iris:hover:not(:disabled) { background: rgba(165, 180, 252, 0.22); border-color: rgba(165, 180, 252, 0.5); }+.btn-heart.is-saved {+ background: var(--heart-soft);+ color: #ff99ab;+ border-color: rgba(255, 77, 109, 0.38);+}++/* Controls strip */+.controls {+ display: flex;+ flex-direction: column;+ gap: 10px;+ padding: 12px 14px 10px;+ border-bottom: 1px solid var(--line);+ background: rgba(14, 14, 18, 0.55);+}+.controls-row {+ display: flex;+ align-items: center;+ gap: 8px;+ flex-wrap: wrap;+}+.search-form {+ flex: 1;+ min-width: 170px;+ display: flex;+ align-items: center;+ gap: 7px;+ height: 32px;+ padding: 0 10px;+ border-radius: 9px;+ background: var(--sunken);+ border: 1px solid var(--line);+}+.search-form:focus-within { border-color: rgba(165, 180, 252, 0.5); }+.search-form input {+ width: 100%;+ background: none;+ border: 0;+ outline: none;+ font-size: 13px;+ color: var(--text);+}+.search-form input::placeholder { color: var(--faint); }+.sort-select {+ height: 32px;+ padding: 0 10px;+ border-radius: 9px;+ background: var(--sunken);+ border: 1px solid var(--line);+ font-size: 12.5px;+ color: var(--text);+}+.count-meta {+ font-family: var(--mono);+ font-size: 11.5px;+ color: var(--faint);+ white-space: nowrap;+}++.pills {+ display: flex;+ align-items: center;+ gap: 5px;+ overflow-x: auto;+ scrollbar-width: none;+ padding-bottom: 2px;+}+.pills::-webkit-scrollbar { display: none; }+.pill {+ flex-shrink: 0;+ height: 27px;+ padding: 0 10px;+ border-radius: 999px;+ font-size: 12px;+ font-weight: 500;+ color: var(--muted);+ border: 1px solid transparent;+ background: rgba(255, 255, 255, 0.03);+ transition: color 130ms var(--ease), background 130ms var(--ease), border-color 130ms var(--ease);+}+.pill:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }+.pill.is-active {+ color: #0b0b0d;+ background: #f4f4f6;+ font-weight: 600;+}+.active-filter-row {+ display: flex;+ align-items: center;+ gap: 8px;+ flex-wrap: wrap;+ font-size: 12px;+ color: var(--muted);+}+.filter-chip {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 2px 9px;+ border-radius: 999px;+ background: var(--iris-soft);+ color: #d4dcff;+ border: 1px solid rgba(165, 180, 252, 0.3);+ font-size: 11.5px;+}++/* Gallery Grid */+.body { padding: 14px; }+.grid {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));+ gap: 14px;+}+.card {+ display: flex;+ flex-direction: column;+ gap: 8px;+ min-width: 0;+}+.thumb-wrap {+ position: relative;+ aspect-ratio: 16 / 10;+ border-radius: 11px;+ overflow: hidden;+ background: var(--surface);+ border: 1px solid var(--line);+ transition: border-color 160ms var(--ease), transform 180ms var(--ease);+}+.thumb-wrap:hover { border-color: var(--line-strong); transform: translateY(-1px); }+.thumb-btn {+ display: block;+ width: 100%;+ height: 100%;+ position: relative;+ text-align: left;+}+.thumb-btn img {+ display: block;+ width: 100%;+ height: 100%;+ object-fit: cover;+ object-position: top center;+ background: var(--raised);+}+.thumb-fallback {+ position: absolute;+ inset: 0;+ display: flex;+ flex-direction: column;+ justify-content: flex-end;+ padding: 12px;+ background: linear-gradient(145deg, #1a1a24 0%, #101015 100%);+}+.thumb-fallback strong { font-size: 14px; font-weight: 600; color: var(--text); }+.thumb-fallback span { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }+.heart-btn {+ position: absolute;+ top: 8px;+ right: 8px;+ width: 28px;+ height: 28px;+ border-radius: 999px;+ display: grid;+ place-items: center;+ background: rgba(11, 11, 13, 0.78);+ border: 1px solid rgba(255, 255, 255, 0.18);+ color: #f4f4f6;+ transition: transform 140ms var(--ease), background 140ms var(--ease), border-color 140ms var(--ease);+}+.heart-btn:hover { transform: scale(1.07); background: rgba(11, 11, 13, 0.95); }+.heart-btn.is-saved {+ background: var(--heart);+ border-color: rgba(255, 255, 255, 0.35);+ color: #ffffff;+}+.card-foot {+ display: flex;+ align-items: baseline;+ justify-content: space-between;+ gap: 8px;+ padding: 0 2px;+}+.card-title-wrap { min-width: 0; display: flex; align-items: baseline; gap: 6px; }+.card-name {+ font-size: 13px;+ font-weight: 560;+ color: var(--text);+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ text-align: left;+}+.card-name:hover { color: var(--iris); }+.card-cat {+ font-size: 11.5px;+ color: var(--faint);+ white-space: nowrap;+ flex-shrink: 0;+}+.card-visit {+ font-size: 11.5px;+ color: var(--muted);+ flex-shrink: 0;+ padding: 1px 4px;+ border-radius: 5px;+}+.card-visit:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }++/* Pagination */+.pager {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 10px;+ padding: 10px 14px;+ border-top: 1px solid var(--line);+ background: rgba(14, 14, 18, 0.55);+}++/* Sticky Moodboard Tray */+.tray {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 10px;+ flex-wrap: wrap;+ padding: 10px 14px;+ border-top: 1px solid rgba(165, 180, 252, 0.24);+ background: linear-gradient(180deg, rgba(28, 30, 44, 0.92), rgba(18, 18, 25, 0.98));+}+.tray-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; flex: 1; }+.tray-label { font-size: 12px; font-weight: 600; color: #d4dcff; white-space: nowrap; }+.tray-chip {+ display: inline-flex;+ align-items: center;+ gap: 4px;+ padding: 2px 8px;+ border-radius: 999px;+ background: rgba(255, 255, 255, 0.08);+ border: 1px solid var(--line);+ font-size: 11.5px;+ color: var(--text);+}+.tray-chip:hover { border-color: var(--heart); color: #ff99ab; }+.tray-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }+.tray-msg { width: 100%; font-size: 12px; color: var(--muted); }++/* Site Detail View */+.detail-grid {+ display: grid;+ grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);+ gap: 16px;+ align-items: start;+}+.detail-shot {+ position: relative;+ aspect-ratio: 16 / 10;+ border-radius: 13px;+ overflow: hidden;+ border: 1px solid var(--line-strong);+ background: var(--surface);+}+.detail-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }+.detail-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }+.detail-info h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }+.detail-host { font-family: var(--mono); font-size: 12px; color: var(--iris); }+.detail-desc { font-size: 13.5px; color: var(--muted); line-height: 1.55; }+.tags { display: flex; flex-wrap: wrap; gap: 5px; }+.tag-btn {+ padding: 3px 9px;+ border-radius: 999px;+ font-size: 11.5px;+ color: var(--muted);+ background: var(--raised);+ border: 1px solid var(--line);+}+.tag-btn:hover { color: var(--text); border-color: rgba(165, 180, 252, 0.45); background: var(--iris-soft); }+.detail-acts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }+.subhead {+ font-size: 12px;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.06em;+ color: var(--faint);+ margin: 16px 0 10px;+}++/* Categories Explorer */+.cat-grid {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));+ gap: 12px;+}+.cat-card {+ display: flex;+ flex-direction: column;+ gap: 10px;+ padding: 12px;+ border-radius: 13px;+ background: var(--surface);+ border: 1px solid var(--line);+ transition: border-color 140ms var(--ease);+}+.cat-card:hover { border-color: var(--line-strong); }+.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }+.cat-name { font-size: 14px; font-weight: 600; color: var(--text); text-align: left; }+.cat-name:hover { color: var(--iris); }+.cat-count { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }+.cat-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }+.cat-thumb {+ aspect-ratio: 16 / 10;+ border-radius: 7px;+ overflow: hidden;+ background: var(--raised);+ border: 1px solid var(--line);+}+.cat-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }++/* Saved Moodboard Banner */+.list-head {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ flex-wrap: wrap;+ padding: 12px 14px;+ border-bottom: 1px solid var(--line);+ background: rgba(18, 18, 25, 0.72);+}+.list-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }+.list-title-row h1 { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }+.id-badge {+ font-family: var(--mono);+ font-size: 11.5px;+ padding: 2px 8px;+ border-radius: 999px;+ background: var(--iris-soft);+ color: #d4dcff;+ border: 1px solid rgba(165, 180, 252, 0.34);+}+.list-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }++.empty {+ padding: 28px 14px;+ text-align: center;+ color: var(--muted);+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 10px;+}++@media (max-width: 560px) {+ .detail-grid { grid-template-columns: 1fr; }+ .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }+}+`;++const SCRIPT = `+(function () {+ var root = document.getElementById("root");+ var pending = {}, nextId = 1, hostCaps = {}, currentData = null;+ var moodboard = {}; // id -> { id, name }++ function post(msg) { window.parent.postMessage(msg, "*"); }+ function rpc(method, params) {+ return new Promise(function (resolve, reject) {+ var id = nextId++;+ pending[id] = [resolve, reject];+ post({ jsonrpc: "2.0", id: id, method: method, params: params || {} });+ setTimeout(function () {+ if (pending[id]) { delete pending[id]; reject(new Error("timeout")); }+ }, 15000);+ });+ }+ function notify(method, params) { post({ jsonrpc: "2.0", method: method, params: params || {} }); }++ function el(tag, cls, text) {+ var n = document.createElement(tag);+ if (cls) n.className = cls;+ if (text !== undefined && text !== null) n.textContent = String(text);+ return n;+ }++ function safeHref(url) {+ return typeof url === "string" && /^https:\\/\\//i.test(url) ? url : "";+ }++ function openExternal(url) {+ var href = safeHref(url);+ if (!href) return;+ if (window.openai && typeof window.openai.openExternal === "function") {+ try { window.openai.openExternal({ href: href }); return; } catch (_) {}+ }+ rpc("ui/open-link", { url: href }).catch(function () {+ try { window.open(href, "_blank", "noopener,noreferrer"); } catch (_) {}+ });+ }++ function sendMessage(text) {+ if (window.openai && typeof window.openai.sendFollowUpMessage === "function") {+ return Promise.resolve(window.openai.sendFollowUpMessage({ prompt: text }));+ }+ return rpc("ui/message", { role: "user", content: [{ type: "text", text: text }] }).then(function (r) {+ if (r && r.isError) throw new Error("blocked");+ return r;+ }).catch(function () {+ if (hostCaps.updateModelContext) {+ return rpc("ui/update-model-context", { content: [{ type: "text", text: text }] });+ }+ throw new Error("unavailable");+ });+ }++ function invokeTool(name, args) {+ if (window.openai && typeof window.openai.callTool === "function") {+ return Promise.resolve(window.openai.callTool(name, args || {})).then(function (r) {+ var sc = (r && r.structuredContent) || (r && r.result && r.result.structuredContent) || r;+ if (sc && sc.kind) return sc;+ throw new Error("no view");+ });+ }+ return rpc("tools/call", { name: name, arguments: args || {} }).then(function (r) {+ if (!r || r.isError || !r.structuredContent) throw new Error("no view");+ return r.structuredContent;+ });+ }++ function go(tool, args, fallbackPrompt) {+ var app = root.firstChild;+ if (app) app.setAttribute("aria-busy", "true");+ invokeTool(tool, args).then(render, function () {+ if (app) app.removeAttribute("aria-busy");+ if (fallbackPrompt) sendMessage(fallbackPrompt).catch(function () {});+ });+ }++ function heartSvg(filled) {+ var ns = "http://www.w3.org/2000/svg";+ var svg = document.createElementNS(ns, "svg");+ svg.setAttribute("width", "14");+ svg.setAttribute("height", "14");+ svg.setAttribute("viewBox", "0 0 24 24");+ svg.setAttribute("fill", filled ? "currentColor" : "none");+ svg.setAttribute("aria-hidden", "true");+ var path = document.createElementNS(ns, "path");+ path.setAttribute("d", "M12 20.25s-7.25-4.35-9.2-8.75C1.35 8.2 3.15 4.75 6.8 4.75c2.1 0 3.7 1.15 5.2 2.9 1.5-1.75 3.1-2.9 5.2-2.9 3.65 0 5.45 3.45 4 6.75-1.95 4.4-9.2 8.75-9.2 8.75Z");+ path.setAttribute("stroke", "currentColor");+ path.setAttribute("stroke-width", "1.9");+ path.setAttribute("stroke-linejoin", "round");+ svg.appendChild(path);+ return svg;+ }++ function makeThumbImg(site, altText) {+ var img = document.createElement("img");+ var src = safeHref(site.thumbUrl || site.thumbnailUrl) || (site.id ? "https://designtaste.wtf/images/" + encodeURIComponent(site.id) + "-thumb.jpg" : "");+ img.src = src;+ img.alt = altText || (site.name + " website screenshot");+ img.loading = "lazy";+ img.decoding = "async";+ img.onerror = function () {+ var parent = img.parentNode;+ if (!parent) return;+ img.remove();+ var fb = el("div", "thumb-fallback");+ fb.appendChild(el("strong", "", site.name));+ fb.appendChild(el("span", "", site.category || ""));+ parent.appendChild(fb);+ };+ return img;+ }++ function toggleMoodboard(site) {+ if (moodboard[site.id]) delete moodboard[site.id];+ else moodboard[site.id] = { id: site.id, name: site.name };+ if (currentData) render(currentData);+ }++ function moodboardItems() {+ return Object.keys(moodboard).map(function (k) { return moodboard[k]; });+ }++ function buildShell(crumbs, externalUrl, extraButtons) {+ var app = el("div", "app");+ var bar = el("div", "bar");+ var brand = el("button", "brand");+ brand.type = "button";+ brand.title = "Browse all curated websites";+ var tpl = document.getElementById("dt-mark");+ if (tpl && tpl.content && tpl.content.firstElementChild) {+ brand.appendChild(tpl.content.firstElementChild.cloneNode(true));+ }+ var txt = el("span", "");+ txt.appendChild(document.createTextNode("designtaste"));+ txt.appendChild(el("span", "brand-dot", ".wtf"));+ brand.appendChild(txt);+ brand.onclick = function () { go("browse_gallery", { sort: "popular", limit: 12 }, "Open the DesignTaste gallery."); };+ bar.appendChild(brand);++ if (crumbs && crumbs.length) {+ var c = el("div", "crumbs");+ crumbs.forEach(function (item) {+ c.appendChild(el("span", "sep", "/"));+ if (item.onClick) {+ var b = el("button", "crumb-btn", item.text);+ b.type = "button";+ b.onclick = item.onClick;+ c.appendChild(b);+ } else {+ c.appendChild(el("span", "here", item.text));+ }+ });+ bar.appendChild(c);+ }++ bar.appendChild(el("div", "grow"));+ var acts = el("div", "bar-acts");++ var catsBtn = el("button", "btn", "Categories");+ catsBtn.type = "button";+ catsBtn.onclick = function () { go("list_categories", {}, "List DesignTaste categories."); };+ acts.appendChild(catsBtn);++ var shuffleBtn = el("button", "btn", "Shuffle");+ shuffleBtn.type = "button";+ shuffleBtn.onclick = function () { go("discover_random", { count: 6 }, "Show me 6 random websites on DesignTaste."); };+ acts.appendChild(shuffleBtn);++ if (extraButtons) {+ extraButtons.forEach(function (b) { acts.appendChild(b); });+ }++ if (externalUrl) {+ var openBtn = el("button", "btn", "Open \\u2197");+ openBtn.type = "button";+ openBtn.onclick = function () { openExternal(externalUrl); };+ acts.appendChild(openBtn);+ }++ bar.appendChild(acts);+ app.appendChild(bar);+ return app;+ }++ function buildSiteCard(site) {+ var card = el("article", "card");+ var wrap = el("div", "thumb-wrap");+ var btn = el("button", "thumb-btn");+ btn.type = "button";+ btn.setAttribute("aria-label", "Inspect " + site.name);+ btn.appendChild(makeThumbImg(site));+ btn.onclick = function () { go("get_site", { id: site.id }, "Inspect " + site.name + " on DesignTaste."); };+ wrap.appendChild(btn);++ var saved = Boolean(moodboard[site.id]);+ var h = el("button", "heart-btn" + (saved ? " is-saved" : ""));+ h.type = "button";+ h.title = saved ? "Remove from moodboard" : "Add to moodboard";+ h.setAttribute("aria-pressed", saved ? "true" : "false");+ h.setAttribute("aria-label", (saved ? "Remove " : "Save ") + site.name);+ h.appendChild(heartSvg(saved));+ h.onclick = function (e) { e.stopPropagation(); toggleMoodboard(site); };+ wrap.appendChild(h);+ card.appendChild(wrap);++ var foot = el("div", "card-foot");+ var left = el("div", "card-title-wrap");+ var nameBtn = el("button", "card-name", site.name);+ nameBtn.type = "button";+ nameBtn.onclick = function () { go("get_site", { id: site.id }, "Inspect " + site.name + " on DesignTaste."); };+ left.appendChild(nameBtn);+ left.appendChild(el("span", "card-cat", site.category));+ foot.appendChild(left);++ if (safeHref(site.url)) {+ var visit = el("button", "card-visit", "\\u2197");+ visit.type = "button";+ visit.title = "Visit " + site.name;+ visit.setAttribute("aria-label", "Visit " + site.name);+ visit.onclick = function () { openExternal(site.url); };+ foot.appendChild(visit);+ }+ card.appendChild(foot);+ return card;+ }++ function buildTray(app) {+ var items = moodboardItems();+ if (!items.length) return;+ var tray = el("div", "tray");+ var left = el("div", "tray-left");+ left.appendChild(el("span", "tray-label", items.length + " saved:"));+ items.slice(0, 8).forEach(function (it) {+ var chip = el("button", "tray-chip", it.name + " \\u00d7");+ chip.type = "button";+ chip.title = "Remove " + it.name;+ chip.onclick = function () { toggleMoodboard(it); };+ left.appendChild(chip);+ });+ if (items.length > 8) left.appendChild(el("span", "count-meta", "+" + (items.length - 8)));+ tray.appendChild(left);++ var acts = el("div", "tray-acts");+ var msg = el("div", "tray-msg");++ var shareBtn = el("button", "btn btn-iris", "Create share ID");+ shareBtn.type = "button";+ shareBtn.onclick = function () {+ var ids = items.map(function (x) { return x.id; });+ go(+ "create_saved_list",+ { ids: ids, title: "Moodboard (" + items.length + " sites)" },+ "Create a DesignTaste saved list with these site IDs: " + ids.join(", ")+ );+ };+ acts.appendChild(shareBtn);++ var useBtn = el("button", "btn btn-primary", "Use as direction");+ useBtn.type = "button";+ useBtn.onclick = function () {+ var ids = items.map(function (x) { return x.id; });+ var names = items.map(function (x) { return x.name; });+ var prompt = "Use these DesignTaste references as visual direction (" + names.join(", ") + "; IDs: " + ids.join(", ") + "). Inspect them via DesignTaste MCP with include_image=true and synthesize an original layout, palette, and typography system.";+ useBtn.disabled = true;+ sendMessage(prompt).then(+ function () { msg.textContent = "Sent to your agent."; },+ function () { msg.textContent = prompt; useBtn.disabled = false; }+ );+ };+ acts.appendChild(useBtn);++ tray.appendChild(acts);+ tray.appendChild(msg);+ app.appendChild(tray);+ }++ function renderGallery(d) {+ var crumbs = [];+ if (d.title) crumbs.push({ text: d.title });+ else if (d.category) crumbs.push({ text: d.category });+ else if (d.tag) crumbs.push({ text: "#" + d.tag });+ else if (d.query) crumbs.push({ text: "\\u201c" + d.query + "\\u201d" });++ var app = buildShell(crumbs, "https://designtaste.wtf/");++ // Controls+ var controls = el("div", "controls");+ var row = el("div", "controls-row");+ var form = el("form", "search-form");+ var input = document.createElement("input");+ input.type = "search";+ input.placeholder = "Search 274+ sites (e.g. dark, typography, motion)...";+ input.value = d.query || "";+ form.appendChild(input);+ form.onsubmit = function (e) {+ e.preventDefault();+ var q = input.value.trim();+ go(+ "browse_gallery",+ { query: q || undefined, category: d.category || undefined, tag: d.tag || undefined, sort: d.sort || "popular", limit: d.limit || 12, offset: 0 },+ q ? "Search DesignTaste for " + q : "Browse DesignTaste gallery."+ );+ };+ row.appendChild(form);++ var select = el("select", "sort-select");+ select.setAttribute("aria-label", "Sort websites");+ [["popular", "Popular"], ["curated", "Curated"], ["newest", "Newest"], ["az", "A\\u2013Z"]].forEach(function (pair) {+ var opt = document.createElement("option");+ opt.value = pair[0];+ opt.textContent = pair[1];+ if ((d.sort || "popular") === pair[0]) opt.selected = true;+ select.appendChild(opt);+ });+ select.onchange = function () {+ go(+ "browse_gallery",+ { query: d.query || undefined, category: d.category || undefined, tag: d.tag || undefined, sort: select.value, limit: d.limit || 12, offset: 0 },+ "Sort DesignTaste by " + select.value+ );+ };+ row.appendChild(select);+ row.appendChild(el("span", "count-meta", (d.totalMatches || 0) + " sites"));+ controls.appendChild(row);++ // Category pills+ if (d.categories && d.categories.length) {+ var pills = el("div", "pills");+ var allBtn = el("button", "pill" + (!d.category ? " is-active" : ""), "All");+ allBtn.type = "button";+ allBtn.onclick = function () {+ go("browse_gallery", { query: d.query || undefined, sort: d.sort || "popular", limit: d.limit || 12, offset: 0 }, "Show all categories on DesignTaste.");+ };+ pills.appendChild(allBtn);+ d.categories.forEach(function (cat) {+ var b = el("button", "pill" + (d.category === cat ? " is-active" : ""), cat);+ b.type = "button";+ b.onclick = function () {+ go("browse_gallery", { category: cat, query: d.query || undefined, sort: d.sort || "popular", limit: d.limit || 12, offset: 0 }, "Browse " + cat + " websites on DesignTaste.");+ };+ pills.appendChild(b);+ });+ controls.appendChild(pills);+ }++ if (d.tag || d.subtitle) {+ var frow = el("div", "active-filter-row");+ if (d.subtitle) frow.appendChild(el("span", "", d.subtitle));+ if (d.tag) {+ var chip = el("button", "filter-chip", "Tag: " + d.tag + " \\u00d7");+ chip.type = "button";+ chip.onclick = function () {+ go("browse_gallery", { category: d.category || undefined, query: d.query || undefined, sort: d.sort || "popular", limit: d.limit || 12, offset: 0 }, "Clear tag filter on DesignTaste.");+ };+ frow.appendChild(chip);+ }+ controls.appendChild(frow);+ }+ app.appendChild(controls);++ // Grid+ var body = el("div", "body");+ if (!d.sites || !d.sites.length) {+ var empty = el("div", "empty");+ empty.appendChild(el("p", "", "No curated websites matched that filter."));+ var reset = el("button", "btn", "Reset filters");+ reset.type = "button";+ reset.onclick = function () { go("browse_gallery", { sort: "popular", limit: 12 }, "Browse all DesignTaste websites."); };+ empty.appendChild(reset);+ body.appendChild(empty);+ } else {+ var grid = el("div", "grid");+ d.sites.forEach(function (s) { grid.appendChild(buildSiteCard(s)); });+ body.appendChild(grid);+ }+ app.appendChild(body);++ // Pagination (when applicable)+ var limit = d.limit || 12;+ var offset = d.offset || 0;+ var total = d.totalMatches || (d.sites ? d.sites.length : 0);+ if (d.mode === "random") {+ var rfoot = el("div", "pager");+ rfoot.appendChild(el("span", "count-meta", "Random sparks from the curated catalog"));+ var again = el("button", "btn btn-iris", "Shuffle again");+ again.type = "button";+ again.onclick = function () {+ go("discover_random", { count: d.sites ? d.sites.length : 6, category: d.category || undefined, tag: d.tag || undefined }, "Shuffle DesignTaste again.");+ };+ rfoot.appendChild(again);+ app.appendChild(rfoot);+ } else if (total > limit) {+ var pager = el("div", "pager");+ var prev = el("button", "btn", "\\u2190 Prev");+ prev.type = "button";+ prev.disabled = offset <= 0;+ prev.onclick = function () {+ go("browse_gallery", { query: d.query || undefined, category: d.category || undefined, tag: d.tag || undefined, sort: d.sort || "popular", limit: limit, offset: Math.max(0, offset - limit) });+ };+ var pageNum = Math.floor(offset / limit) + 1;+ var totalPages = Math.ceil(total / limit);+ var next = el("button", "btn", "Next \\u2192");+ next.type = "button";+ next.disabled = offset + limit >= total;+ next.onclick = function () {+ go("browse_gallery", { query: d.query || undefined, category: d.category || undefined, tag: d.tag || undefined, sort: d.sort || "popular", limit: limit, offset: offset + limit });+ };+ pager.appendChild(prev);+ pager.appendChild(el("span", "count-meta", "Page " + pageNum + " of " + totalPages));+ pager.appendChild(next);+ app.appendChild(pager);+ }++ buildTray(app);+ return app;+ }++ function renderSite(d) {+ var s = d.site;+ var app = buildShell([+ { text: s.category, onClick: function () { go("browse_gallery", { category: s.category, limit: 12 }, "Browse " + s.category + " on DesignTaste."); } },+ { text: s.name }+ ], s.detailUrl || s.url);++ var body = el("div", "body");+ var grid = el("div", "detail-grid");++ var shot = el("div", "detail-shot");+ shot.appendChild(makeThumbImg(s, s.name + " website preview"));+ grid.appendChild(shot);++ var info = el("div", "detail-info");+ info.appendChild(el("h1", "", s.name));+ var host = "";+ try { host = new URL(s.url).hostname.replace(/^www\\./, ""); } catch (_) {}+ if (host) info.appendChild(el("div", "detail-host", host + " \\u00b7 " + s.category));+ if (s.description) info.appendChild(el("p", "detail-desc", s.description));+ if (s.observation && s.observation !== s.description) {+ info.appendChild(el("p", "detail-desc", s.observation));+ }++ if (s.tags && s.tags.length) {+ var tags = el("div", "tags");+ s.tags.forEach(function (t) {+ var b = el("button", "tag-btn", t);+ b.type = "button";+ b.onclick = function () { go("browse_gallery", { tag: t, limit: 12 }, "Search DesignTaste sites tagged " + t); };+ tags.appendChild(b);+ });+ info.appendChild(tags);+ }++ var acts = el("div", "detail-acts");+ if (safeHref(s.url)) {+ var visit = el("button", "btn btn-primary", "Visit live site \\u2197");+ visit.type = "button";+ visit.onclick = function () { openExternal(s.url); };+ acts.appendChild(visit);+ }++ var isSaved = Boolean(moodboard[s.id]);+ var save = el("button", "btn btn-heart" + (isSaved ? " is-saved" : ""), isSaved ? "\\u2665 Saved" : "\\u2661 Save to moodboard");+ save.type = "button";+ save.onclick = function () { toggleMoodboard(s); };+ acts.appendChild(save);++ var sim = el("button", "btn", "Find similar");+ sim.type = "button";+ sim.onclick = function () { go("find_similar_sites", { id: s.id, limit: 6 }, "Find DesignTaste websites similar to " + s.name + "."); };+ acts.appendChild(sim);++ var dirMsg = el("div", "tray-msg");+ var dir = el("button", "btn btn-iris", "Use as direction");+ dir.type = "button";+ dir.onclick = function () {+ var prompt = "Use " + s.name + " (DesignTaste ID: " + s.id + ") as visual direction. Call get_site with id=\\"" + s.id + "\\" and include_image=true, then adapt its pacing, hierarchy, and craft originally without copying its brand.";+ dir.disabled = true;+ sendMessage(prompt).then(+ function () { dirMsg.textContent = "Sent to your agent."; },+ function () { dirMsg.textContent = prompt; dir.disabled = false; }+ );+ };+ acts.appendChild(dir);++ info.appendChild(acts);+ info.appendChild(dirMsg);+ grid.appendChild(info);+ body.appendChild(grid);++ if (d.similar && d.similar.length) {+ body.appendChild(el("div", "subhead", "Similar references"));+ var sgrid = el("div", "grid");+ d.similar.forEach(function (item) { sgrid.appendChild(buildSiteCard(item)); });+ body.appendChild(sgrid);+ }++ app.appendChild(body);+ buildTray(app);+ return app;+ }++ function renderCategories(d) {+ var app = buildShell([{ text: "Categories" }], "https://designtaste.wtf/");+ var body = el("div", "body");+ var grid = el("div", "cat-grid");+ (d.categories || []).forEach(function (c) {+ var card = el("div", "cat-card");+ var head = el("div", "cat-head");+ var name = el("button", "cat-name", c.category);+ name.type = "button";+ name.onclick = function () { go("browse_gallery", { category: c.category, limit: 12 }, "Browse " + c.category + " websites on DesignTaste."); };+ head.appendChild(name);+ head.appendChild(el("span", "cat-count", c.count + " sites"));+ card.appendChild(head);++ if (c.previews && c.previews.length) {+ var thumbs = el("div", "cat-thumbs");+ c.previews.slice(0, 2).forEach(function (p) {+ var tb = el("button", "cat-thumb");+ tb.type = "button";+ tb.title = p.name;+ tb.appendChild(makeThumbImg(p, p.name));+ tb.onclick = function () { go("get_site", { id: p.id }, "Inspect " + p.name + " on DesignTaste."); };+ thumbs.appendChild(tb);+ });+ card.appendChild(thumbs);+ }++ if (c.topTags && c.topTags.length) {+ var tags = el("div", "tags");+ c.topTags.slice(0, 5).forEach(function (t) {+ var tb = el("button", "tag-btn", t);+ tb.type = "button";+ tb.onclick = function () { go("browse_gallery", { category: c.category, tag: t, limit: 12 }, "Browse " + c.category + " sites tagged " + t + " on DesignTaste."); };+ tags.appendChild(tb);+ });+ card.appendChild(tags);+ }+ grid.appendChild(card);+ });+ body.appendChild(grid);+ app.appendChild(body);+ buildTray(app);+ return app;+ }++ function renderList(d) {+ var app = buildShell([{ text: d.title || "Saved Moodboard" }], d.url || "https://designtaste.wtf/");+ var head = el("div", "list-head");+ var left = el("div", "");+ var trow = el("div", "list-title-row");+ trow.appendChild(el("h1", "", d.title || "Saved Moodboard"));+ if (d.id) trow.appendChild(el("span", "id-badge", d.id));+ left.appendChild(trow);+ left.appendChild(el("div", "list-sub", (d.sites ? d.sites.length : 0) + " curated references \\u00b7 shareable via designtaste.wtf/?list=" + (d.id || "")));+ head.appendChild(left);++ var acts = el("div", "bar-acts");+ var msg = el("div", "tray-msg");+ var apply = el("button", "btn btn-primary", "Apply as visual direction");+ apply.type = "button";+ apply.onclick = function () {+ var prompt = "Use my DesignTaste saved list " + d.id + " via the DesignTaste MCP (get_saved_list with include_images=true) as visual direction for this project.";+ apply.disabled = true;+ sendMessage(prompt).then(+ function () { msg.textContent = "Sent to your agent."; },+ function () { msg.textContent = prompt; apply.disabled = false; }+ );+ };+ acts.appendChild(apply);+ head.appendChild(acts);+ head.appendChild(msg);+ app.appendChild(head);++ var body = el("div", "body");+ var grid = el("div", "grid");+ (d.sites || []).forEach(function (s) { grid.appendChild(buildSiteCard(s)); });+ body.appendChild(grid);+ app.appendChild(body);+ buildTray(app);+ return app;+ }++ function render(data) {+ if (!data || typeof data !== "object") return;+ currentData = data;+ root.textContent = "";+ var node = null;+ if (data.kind === "gallery") node = renderGallery(data);+ else if (data.kind === "site") node = renderSite(data);+ else if (data.kind === "categories") node = renderCategories(data);+ else if (data.kind === "list") node = renderList(data);+ if (node) root.appendChild(node);+ }++ // MCP Apps 2026-01-26 bridge+ window.addEventListener("message", function (e) {+ if (e.source !== window.parent) return;+ var m = e.data;+ if (!m || m.jsonrpc !== "2.0") return;+ if (m.id !== undefined && (m.result !== undefined || m.error !== undefined)) {+ var p = pending[m.id];+ if (p) {+ delete pending[m.id];+ if (m.error) p[1](m.error);+ else p[0](m.result);+ }+ return;+ }+ if (m.method === "ui/notifications/tool-result") {+ render(m.params && m.params.structuredContent);+ } else if (m.method === "ui/resource-teardown" && m.id !== undefined) {+ post({ jsonrpc: "2.0", id: m.id, result: {} });+ }+ });++ // ChatGPT window.openai fallback listener+ if (window.openai && window.openai.toolOutput) {+ render(window.openai.toolOutput);+ }+ window.addEventListener("openai:set_globals", function (e) {+ var out = e && e.detail && e.detail.globals && e.detail.globals.toolOutput;+ if (out) render(out);+ });++ // Handshake + auto-height reporting+ rpc("ui/initialize", {+ protocolVersion: "2026-01-26",+ appInfo: { name: "designtaste", version: "1.1.0" },+ appCapabilities: {},+ })+ .then(function (r) { hostCaps = (r && r.hostCapabilities) || {}; }, function () {})+ .then(function () { notify("ui/notifications/initialized"); });++ if (window.ResizeObserver) {+ new ResizeObserver(function () {+ var rect = document.documentElement.getBoundingClientRect();+ notify("ui/notifications/size-changed", {+ width: Math.ceil(rect.width),+ height: Math.ceil(rect.height),+ });+ }).observe(document.documentElement);+ }+})();+`;++export const APP_HTML = `<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>DesignTaste</title>+<style>${STYLE}</style>+</head>+<body>+<template id="dt-mark">${MARK_SVG}</template>+<div id="root"></div>+<script>${SCRIPT}</script>+</body>+</html>`;diff --git a/api/mcp.js b/api/mcp.jsindex 9c0f32f..a0d066e 100644--- a/api/mcp.js+++ b/api/mcp.js@@ -8,19 +8,113 @@ import {} from "./lists.js";import { getFavoritesRanking } from "./favorites.js";import { CATEGORIES, handleSubmission } from "./submit.js";+import {+ APP_PANEL,+ APP_HTML,+ APP_RESOURCE_META,+ PANEL_MIME,+} from "./mcp-app.js";++const SERVER_ICONS = [+ {+ src: `${ORIGIN}/icon-192.png`,+ mimeType: "image/png",+ sizes: ["192x192"],+ },+ {+ src: `${ORIGIN}/favicon.svg`,+ mimeType: "image/svg+xml",+ sizes: ["any"],+ },+];const SERVER_INFO = {name: "designtaste",- version: "1.0.0",+ title: "DesignTaste",+ version: "1.1.0",+ description:+ "Curated website design inspiration gallery, interactive in-chat browser, and shareable moodboard lists (designtaste.wtf).",+ websiteUrl: ORIGIN,+ icons: SERVER_ICONS,};-const SUPPORTED_PROTOCOLS = ["2025-06-18", "2025-03-26", "2024-11-05"];+const SUPPORTED_PROTOCOLS = [+ "2025-11-25",+ "2025-06-18",+ "2025-03-26",+ "2024-11-05",+];++function uiToolMeta(invoking, invoked) {+ return {+ ui: { resourceUri: APP_PANEL },+ "ui/resourceUri": APP_PANEL,+ "openai/outputTemplate": APP_PANEL,+ "openai/toolInvocation/invoking": invoking,+ "openai/toolInvocation/invoked": invoked,+ };+}const TOOLS = [+ {+ name: "browse_gallery",+ title: "Browse DesignTaste gallery",+ description:+ "Open the interactive DesignTaste website gallery directly inside chat (or return structured results in text clients). Use this when the user wants to browse, explore, filter by category/tag, or pick visual references for a project. Users can search, switch categories, inspect sites, and heart sites into a shareable dt_... moodboard right inside the rendered UI. Do not repeat every card in prose when the UI renders.",+ inputSchema: {+ type: "object",+ properties: {+ query: {+ type: "string",+ description:+ "Optional keyword search across site name, domain, tags, category, and description.",+ },+ category: {+ type: "string",+ enum: CATEGORIES,+ description: "Optional category filter.",+ },+ tag: {+ type: "string",+ description:+ "Optional visual style tag (e.g. Dark, Minimal, Typography, Motion, Editorial).",+ },+ sort: {+ type: "string",+ enum: ["popular", "curated", "newest", "az"],+ default: "popular",+ description:+ "Sort order: popular (most favorited first), curated, newest, or az.",+ },+ limit: {+ type: "integer",+ minimum: 1,+ maximum: 24,+ default: 12,+ description: "Number of sites per page (1–24).",+ },+ offset: {+ type: "integer",+ minimum: 0,+ default: 0,+ description: "Pagination offset.",+ },+ },+ additionalProperties: false,+ },+ annotations: {+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: true,+ openWorldHint: false,+ },+ _meta: uiToolMeta("Opening DesignTaste gallery", "DesignTaste gallery ready"),+ },{name: "search_sites",+ title: "Search curated websites",description:- "Search and filter curated high-craft websites on designtaste.wtf by keyword, category, visual tag, or sort order (popular, curated, newest, az). Returns editorial notes, URLs, tags, and screenshot links.",+ "Search and filter curated high-craft websites on designtaste.wtf by keyword, category, visual tag, or sort order (popular, curated, newest, az). Renders the interactive gallery in MCP Apps hosts and returns editorial notes, URLs, tags, and screenshot links.",inputSchema: {type: "object",properties: {@@ -36,7 +130,8 @@ const TOOLS = [},tag: {type: "string",- description: "Optional visual style tag (e.g. Dark, Minimal, Typography, Motion, Editorial).",+ description:+ "Optional visual style tag (e.g. Dark, Minimal, Typography, Motion, Editorial).",},sort: {type: "string",@@ -63,14 +158,17 @@ const TOOLS = [},annotations: {readOnlyHint: true,+ destructiveHint: false,idempotentHint: true,openWorldHint: false,},+ _meta: uiToolMeta("Searching DesignTaste", "Search results ready"),},{name: "get_site",+ title: "Inspect one website",description:- "Fetch full details, design observation, tags, URL, and screenshot links for one DesignTaste website by its id. Set include_image=true to also receive the 640×400 thumbnail image directly.",+ "Inspect full details, design observation, tags, similar references, URL, and screenshot links for one DesignTaste website by its id. Set include_image=true to also receive the 640×400 thumbnail image directly as an MCP image block for vision models.",inputSchema: {type: "object",properties: {@@ -81,7 +179,8 @@ const TOOLS = [include_image: {type: "boolean",default: false,- description: "If true, attach the 640×400 JPEG thumbnail as an image content block.",+ description:+ "If true, attach the 640×400 JPEG thumbnail as an image content block.",},},required: ["id"],@@ -89,14 +188,95 @@ const TOOLS = [},annotations: {readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: true,+ openWorldHint: false,+ },+ _meta: uiToolMeta("Loading website details", "Website ready"),+ },+ {+ name: "find_similar_sites",+ title: "Find visually similar websites",+ description:+ "Find curated websites on designtaste.wtf that share a similar aesthetic to a given site id (e.g. 'linear') or a set of style tags and optional category. Renders an interactive visual comparison grid in chat.",+ inputSchema: {+ type: "object",+ properties: {+ id: {+ type: "string",+ description:+ "Optional reference site slug ID (e.g. linear, stripe, raycast).",+ },+ tags: {+ type: "array",+ items: { type: "string" },+ maxItems: 8,+ description:+ "Optional style tags to match (e.g. ['Dark', 'Typography', 'Minimal']).",+ },+ category: {+ type: "string",+ enum: CATEGORIES,+ description: "Optional category boost or filter.",+ },+ limit: {+ type: "integer",+ minimum: 1,+ maximum: 24,+ default: 9,+ description: "Number of similar sites to return (1–24).",+ },+ },+ additionalProperties: false,+ },+ annotations: {+ readOnlyHint: true,+ destructiveHint: false,idempotentHint: true,openWorldHint: false,},+ _meta: uiToolMeta("Finding similar websites", "Similar references ready"),+ },+ {+ name: "discover_random",+ title: "Discover random inspiration",+ description:+ "Surface a fresh random selection of high-craft websites from designtaste.wtf (optionally filtered by category or tag) for instant creative inspiration, with a live Shuffle button in chat.",+ inputSchema: {+ type: "object",+ properties: {+ count: {+ type: "integer",+ minimum: 1,+ maximum: 12,+ default: 6,+ description: "Number of random sites to pick (1–12).",+ },+ category: {+ type: "string",+ enum: CATEGORIES,+ description: "Optional category filter.",+ },+ tag: {+ type: "string",+ description: "Optional visual style tag filter.",+ },+ },+ additionalProperties: false,+ },+ annotations: {+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: false,+ },+ _meta: uiToolMeta("Shuffling curated websites", "Fresh inspiration ready"),},{name: "list_categories",+ title: "Explore categories and tags",description:- "List all DesignTaste website categories with site counts and top visual tags.",+ "List all 8 DesignTaste website categories with exact site counts, preview thumbnails, and top visual tags. Renders a clickable category explorer in MCP Apps hosts.",inputSchema: {type: "object",properties: {},@@ -104,14 +284,17 @@ const TOOLS = [},annotations: {readOnlyHint: true,+ destructiveHint: false,idempotentHint: true,openWorldHint: false,},+ _meta: uiToolMeta("Loading categories", "Categories ready"),},{name: "get_saved_list",+ title: "Open a shared saved list",description:- "Load a human- or agent-curated DesignTaste saved list by its unique ID (e.g. dt_k8x4m2p9). Returns every website in the moodboard with design notes, tags, and screenshot URLs.",+ "Load a human- or agent-curated DesignTaste saved moodboard by its unique ID (e.g. dt_k8x4m2p9). Renders the moodboard visually in chat and returns every website's editorial notes, tags, and screenshot URLs.",inputSchema: {type: "object",properties: {@@ -131,14 +314,17 @@ const TOOLS = [},annotations: {readOnlyHint: true,+ destructiveHint: false,idempotentHint: true,openWorldHint: false,},+ _meta: uiToolMeta("Loading saved moodboard", "Moodboard ready"),},{name: "create_saved_list",+ title: "Create a shareable moodboard",description:- "Create a shareable DesignTaste saved list from valid site IDs (1–50 sites) and receive a unique dt_... ID plus a live designtaste.wtf/?list=... link to share with humans or other agents.",+ "Create a shareable DesignTaste saved list from valid site IDs (1–50 sites) and receive a unique dt_... ID plus a live designtaste.wtf/?list=... link to share with humans or other agents. Renders the saved moodboard visually in chat.",inputSchema: {type: "object",properties: {@@ -147,12 +333,14 @@ const TOOLS = [items: { type: "string" },minItems: 1,maxItems: 50,- description: "Ordered list of DesignTaste site IDs (e.g. ['linear', 'anywr', 'vercel']).",+ description:+ "Ordered list of DesignTaste site IDs (e.g. ['linear', 'anywr', 'vercel']).",},title: {type: "string",maxLength: 80,- description: "Optional short title for the list (e.g. 'Dark Developer SaaS Direction').",+ description:+ "Optional short title for the list (e.g. 'Dark Developer SaaS Direction').",},},required: ["ids"],@@ -164,9 +352,11 @@ const TOOLS = [idempotentHint: false,openWorldHint: false,},+ _meta: uiToolMeta("Creating shareable moodboard", "Moodboard saved"),},{name: "submit_site",+ title: "Submit a website",description:"Submit a public HTTPS website URL to the DesignTaste curation queue for review. No account required; rate-limited and deduplicated.",inputSchema: {@@ -204,6 +394,15 @@ const TOOLS = [];const RESOURCES = [+ {+ uri: APP_PANEL,+ name: "DesignTaste Interactive Browser",+ description:+ "Interactive dark-studio website gallery and moodboard builder drawn inside MCP Apps conversations.",+ mimeType: PANEL_MIME,+ icons: SERVER_ICONS,+ _meta: APP_RESOURCE_META,+ },{uri: "designtaste://catalog/summary",name: "DesignTaste Catalog Summary",@@ -214,7 +413,8 @@ const RESOURCES = [{uri: "designtaste://categories",name: "DesignTaste Categories",- description: "Category counts and common design tags across designtaste.wtf.",+ description:+ "Category counts and common design tags across designtaste.wtf.",mimeType: "application/json",},];@@ -242,15 +442,24 @@ const PROMPTS = [function buildCategoryStats() {const map = new Map();for (const cat of CATEGORIES) {- map.set(cat, { category: cat, count: 0, topTags: new Map() });+ map.set(cat, { category: cat, count: 0, topTags: new Map(), previews: [] });}for (const s of catalogSites) {const entry = map.get(s.category) || {category: s.category,count: 0,topTags: new Map(),+ previews: [],};entry.count++;+ if (entry.previews.length < 2) {+ entry.previews.push({+ id: s.id,+ name: s.name,+ category: s.category,+ thumbUrl: `${ORIGIN}/images/${s.id}-thumb.jpg`,+ });+ }for (const tag of s.tags || []) {entry.topTags.set(tag, (entry.topTags.get(tag) || 0) + 1);}@@ -263,9 +472,129 @@ function buildCategoryStats() {.sort((a, b) => b[1] - a[1]).slice(0, 6).map(([tag]) => tag),+ previews: e.previews,}));}+function findSimilarCandidates({ referenceSite, tags = [], category = "", limit = 9 }) {+ const refTags = new Set(+ [+ ...(referenceSite?.tags || []),+ ...tags,+ ]+ .map((t) => String(t || "").trim().toLowerCase())+ .filter(Boolean),+ );+ const targetCategory = category || referenceSite?.category || "";+ const refWords = new Set(+ (referenceSite?.description || "")+ .toLowerCase()+ .split(/[^a-z0-9]+/)+ .filter((w) => w.length >= 4),+ );++ const scored = [];+ for (let i = 0; i < catalogSites.length; i++) {+ const s = catalogSites[i];+ if (referenceSite && s.id === referenceSite.id) continue;+ let score = 0;+ const siteTags = (s.tags || []).map((t) => t.toLowerCase());+ for (const t of siteTags) {+ if (refTags.has(t)) score += 3;+ }+ if (targetCategory && s.category === targetCategory) {+ score += 2.5;+ }+ if (refWords.size) {+ const desc = `${s.description} ${s.observation || ""}`.toLowerCase();+ let overlap = 0;+ for (const w of refWords) {+ if (desc.includes(w)) overlap++;+ }+ score += Math.min(2, overlap * 0.4);+ }+ if (score > 0 || (!refTags.size && !targetCategory)) {+ scored.push({ site: s, score, idx: i });+ }+ }++ scored.sort((a, b) => b.score - a.score || a.idx - b.idx);+ return scored.slice(0, limit).map((x) => formatPublicSite(x.site));+}++async function queryGallerySites(args = {}, { env, fetchImpl }) {+ const query = String(args.query || "").trim().toLowerCase();+ const words = query ? query.split(/\s+/).filter(Boolean) : [];+ const category = args.category ? String(args.category).trim() : "";+ const tag = args.tag ? String(args.tag).trim().toLowerCase() : "";+ const sort = ["popular", "curated", "newest", "az"].includes(args.sort)+ ? args.sort+ : "popular";+ const maxLimit = args._maxLimit || 40;+ const limit = Math.min(maxLimit, Math.max(1, Number(args.limit) || 12));+ const offset = Math.max(0, Number(args.offset) || 0);++ let matches = catalogSites.filter((s) => {+ if (category && s.category !== category) return false;+ if (tag && !(s.tags || []).some((t) => t.toLowerCase() === tag)) {+ return false;+ }+ if (words.length) {+ const hay = [+ s.id,+ s.name,+ s.url,+ s.category,+ ...(s.tags || []),+ s.description,+ s.observation || "",+ ]+ .join(" ")+ .toLowerCase();+ if (!words.every((w) => hay.includes(w))) return false;+ }+ return true;+ });++ const curatedIndex = new Map(catalogSites.map((s, i) => [s.id, i]));+ if (sort === "az") {+ matches = [...matches].sort((a, b) => a.name.localeCompare(b.name));+ } else if (sort === "newest") {+ matches = [...matches].sort(+ (a, b) =>+ b.capturedAt.localeCompare(a.capturedAt) ||+ curatedIndex.get(a.id) - curatedIndex.get(b.id),+ );+ } else if (sort === "popular") {+ const rankRes = await getFavoritesRanking({ env, fetchImpl });+ const rankList = rankRes?.body?.ranking || [];+ const rankMap = new Map(rankList.map((id, i) => [id, i]));+ matches = [...matches].sort((a, b) => {+ const ra = rankMap.has(a.id)+ ? rankMap.get(a.id)+ : 1000000 + curatedIndex.get(a.id);+ const rb = rankMap.has(b.id)+ ? rankMap.get(b.id)+ : 1000000 + curatedIndex.get(b.id);+ return ra - rb;+ });+ }++ const page = matches.slice(offset, offset + limit).map(formatPublicSite);+ return {+ kind: "gallery",+ query: String(args.query || "").trim(),+ category,+ tag: String(args.tag || "").trim(),+ sort,+ limit,+ offset,+ totalMatches: matches.length,+ categories: CATEGORIES,+ sites: page,+ };+}+async function fetchThumbAsImageBlock(siteId, fetchImpl = fetch) {if (!sitesById.has(siteId)) return null;try {@@ -289,91 +618,25 @@ async function executeTool(name, args = {}, ctx = {}) {if (name === "list_categories") {const categories = buildCategoryStats();+ const payload = {+ kind: "categories",+ totalSites: catalogSites.length,+ categories,+ };return {- content: [- {- type: "text",- text: JSON.stringify(- { totalSites: catalogSites.length, categories },- null,- 2,- ),- },- ],+ content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],+ structuredContent: payload,};}- if (name === "search_sites") {- const query = String(args.query || "").trim().toLowerCase();- const words = query ? query.split(/\s+/).filter(Boolean) : [];- const category = args.category ? String(args.category).trim() : "";- const tag = args.tag ? String(args.tag).trim().toLowerCase() : "";- const sort = ["popular", "curated", "newest", "az"].includes(args.sort)- ? args.sort- : "popular";- const limit = Math.min(40, Math.max(1, Number(args.limit) || 12));- const offset = Math.max(0, Number(args.offset) || 0);-- let matches = catalogSites.filter((s) => {- if (category && s.category !== category) return false;- if (tag && !(s.tags || []).some((t) => t.toLowerCase() === tag)) {- return false;- }- if (words.length) {- const hay = [- s.id,- s.name,- s.url,- s.category,- ...(s.tags || []),- s.description,- s.observation || "",- ]- .join(" ")- .toLowerCase();- if (!words.every((w) => hay.includes(w))) return false;- }- return true;- });-- const curatedIndex = new Map(catalogSites.map((s, i) => [s.id, i]));- if (sort === "az") {- matches = [...matches].sort((a, b) => a.name.localeCompare(b.name));- } else if (sort === "newest") {- matches = [...matches].sort(- (a, b) =>- b.capturedAt.localeCompare(a.capturedAt) ||- curatedIndex.get(a.id) - curatedIndex.get(b.id),- );- } else if (sort === "popular") {- const rankRes = await getFavoritesRanking({ env, fetchImpl });- const rankList = rankRes?.body?.ranking || [];- const rankMap = new Map(rankList.map((id, i) => [id, i]));- matches = [...matches].sort((a, b) => {- const ra = rankMap.has(a.id) ? rankMap.get(a.id) : 1000000 + curatedIndex.get(a.id);- const rb = rankMap.has(b.id) ? rankMap.get(b.id) : 1000000 + curatedIndex.get(b.id);- return ra - rb;- });- }-- const page = matches.slice(offset, offset + limit).map(formatPublicSite);+ if (name === "browse_gallery" || name === "search_sites") {+ const payload = await queryGallerySites(+ { ...args, _maxLimit: name === "browse_gallery" ? 24 : 40 },+ { env, fetchImpl },+ );return {- content: [- {- type: "text",- text: JSON.stringify(- {- totalMatches: matches.length,- offset,- limit,- sort,- sites: page,- },- null,- 2,- ),- },- ],+ content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],+ structuredContent: payload,};}@@ -386,17 +649,106 @@ async function executeTool(name, args = {}, ctx = {}) {content: [{ type: "text", text: `No site found with id "${id}".` }],};}+ const formatted = formatPublicSite(site);+ const similar = findSimilarCandidates({ referenceSite: site, limit: 3 });+ const structured = {+ kind: "site",+ site: formatted,+ similar,+ };const content = [{type: "text",- text: JSON.stringify(formatPublicSite(site), null, 2),+ text: JSON.stringify({ ...formatted, similar }, null, 2),},];if (args.include_image) {const img = await fetchThumbAsImageBlock(site.id, fetchImpl);if (img) content.push(img);}- return { content };+ return { content, structuredContent: structured };+ }++ if (name === "find_similar_sites") {+ const id = String(args.id || "").trim().toLowerCase();+ const referenceSite = id ? sitesById.get(id) : null;+ if (id && !referenceSite) {+ return {+ isError: true,+ content: [{ type: "text", text: `No site found with id "${id}".` }],+ };+ }+ const tags = Array.isArray(args.tags) ? args.tags : [];+ const category = args.category ? String(args.category).trim() : "";+ const limit = Math.min(24, Math.max(1, Number(args.limit) || 9));+ const sites = findSimilarCandidates({+ referenceSite,+ tags,+ category,+ limit,+ });+ const payload = {+ kind: "gallery",+ mode: "similar",+ title: referenceSite+ ? `Similar to ${referenceSite.name}`+ : "Similar references",+ subtitle: referenceSite+ ? `Matched on ${referenceSite.category} and tags: ${(referenceSite.tags || []).join(", ")}`+ : tags.length+ ? `Matched on tags: ${tags.join(", ")}`+ : "",+ category,+ tag: "",+ query: "",+ sort: "curated",+ limit,+ offset: 0,+ totalMatches: sites.length,+ categories: CATEGORIES,+ sites,+ };+ return {+ content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],+ structuredContent: payload,+ };+ }++ if (name === "discover_random") {+ const count = Math.min(12, Math.max(1, Number(args.count) || 6));+ const category = args.category ? String(args.category).trim() : "";+ const tag = args.tag ? String(args.tag).trim().toLowerCase() : "";+ let pool = catalogSites.filter((s) => {+ if (category && s.category !== category) return false;+ if (tag && !(s.tags || []).some((t) => t.toLowerCase() === tag)) {+ return false;+ }+ return true;+ });+ pool = [...pool];+ for (let i = pool.length - 1; i > 0; i--) {+ const j = Math.floor(Math.random() * (i + 1));+ [pool[i], pool[j]] = [pool[j], pool[i]];+ }+ const picked = pool.slice(0, count).map(formatPublicSite);+ const payload = {+ kind: "gallery",+ mode: "random",+ title: category ? `Random ${category}` : "Random Inspiration",+ category,+ tag: String(args.tag || "").trim(),+ query: "",+ sort: "curated",+ limit: count,+ offset: 0,+ totalMatches: pool.length,+ categories: CATEGORIES,+ sites: picked,+ };+ return {+ content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],+ structuredContent: payload,+ };}if (name === "get_saved_list") {@@ -412,15 +764,23 @@ async function executeTool(name, args = {}, ctx = {}) {],};}+ const list = res.body.list;+ const structured = {+ kind: "list",+ id: list.id,+ title: list.title,+ url: list.url,+ sites: list.sites,+ };const content = [{type: "text",- text: JSON.stringify(res.body.list, null, 2),+ text: JSON.stringify(list, null, 2),},];if (args.include_images) {const imgs = await Promise.all(- res.body.list.sites+ list.sites.slice(0, 6).map((s) => fetchThumbAsImageBlock(s.id, fetchImpl)),);@@ -428,7 +788,7 @@ async function executeTool(name, args = {}, ctx = {}) {if (img) content.push(img);}}- return { content };+ return { content, structuredContent: structured };}if (name === "create_saved_list") {@@ -447,13 +807,20 @@ async function executeTool(name, args = {}, ctx = {}) {],};}+ const sites = (res.body.ids || [])+ .map((id) => sitesById.get(id))+ .filter(Boolean)+ .map(formatPublicSite);+ const structured = {+ kind: "list",+ id: res.body.id,+ title: res.body.title,+ url: res.body.url,+ sites,+ };return {- content: [- {- type: "text",- text: JSON.stringify(res.body, null, 2),- },- ],+ content: [{ type: "text", text: JSON.stringify(res.body, null, 2) }],+ structuredContent: structured,};}@@ -509,7 +876,10 @@ export async function handleMcpMessage(msg, ctx = {}) {const { id, method, params } = msg;const isNotification = id === undefined || id === null;- if (method === "notifications/initialized" || method === "notifications/cancelled") {+ if (+ method === "notifications/initialized" ||+ method === "notifications/cancelled"+ ) {return null;}@@ -528,10 +898,15 @@ export async function handleMcpMessage(msg, ctx = {}) {tools: { listChanged: false },resources: { subscribe: false, listChanged: false },prompts: { listChanged: false },+ extensions: {+ "io.modelcontextprotocol/ui": {+ mimeTypes: [PANEL_MIME],+ },+ },},serverInfo: SERVER_INFO,instructions:- "DesignTaste is an open curated website design inspiration gallery (designtaste.wtf). Use search_sites, get_site, and get_saved_list to inspect real web design craft, editorial notes, and screenshots without copying creator trademarks or assets. Use create_saved_list to share curated shortlists back to humans via designtaste.wtf/?list=<id>.",+ "DesignTaste is an open curated website design inspiration gallery (designtaste.wtf) with an interactive in-chat browser (MCP Apps). Call browse_gallery when the user wants to browse or pick websites visually, search_sites or find_similar_sites to narrow references, discover_random for sparks, get_site (with include_image=true) to inspect a reference, get_saved_list to load a dt_... moodboard, and create_saved_list to share curated shortlists via designtaste.wtf/?list=<id>. Never copy reference brands or assets.",});}@@ -554,6 +929,18 @@ export async function handleMcpMessage(msg, ctx = {}) {if (method === "resources/read") {const uri = params?.uri;+ if (uri === APP_PANEL) {+ return rpcOk(id, {+ contents: [+ {+ uri: APP_PANEL,+ mimeType: PANEL_MIME,+ text: APP_HTML,+ _meta: APP_RESOURCE_META,+ },+ ],+ });+ }if (uri === "designtaste://catalog/summary") {return rpcOk(id, {contents: [@@ -662,11 +1049,13 @@ export default async function handler(req, res) {return res.status(200).json({name: "DesignTaste MCP",description:- "Open, zero-auth Model Context Protocol server for browsing designtaste.wtf, reading shared saved lists (dt_...), and submitting websites.",+ "Open, zero-auth Model Context Protocol server with interactive MCP Apps in-chat UI for browsing designtaste.wtf, reading shared saved lists (dt_...), and submitting websites.",endpoint: `${ORIGIN}/api/mcp/`,docs: `${ORIGIN}/mcp/`,+ icons: SERVER_ICONS,transport: "streamable-http",auth: "none",+ mcpApps: true,totalSites: catalogSites.length,tools: TOOLS.map((t) => ({ name: t.name, description: t.description })),configExample: {diff --git a/apps/gallery/render.mjs b/apps/gallery/render.mjsindex f3e80b4..12fbacc 100644--- a/apps/gallery/render.mjs+++ b/apps/gallery/render.mjs@@ -115,7 +115,7 @@ function submitFormMarkup(idPrefix = "submit") {function head({ title, description, path = "/", image = "/og.jpg", schema }) {const canonical = ORIGIN + path;- return `<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="dark"><meta name="robots" content="${process.env.VERCEL_ENV === "preview" || path === "/404.html" ? "noindex,nofollow" : "index,follow"}"><meta name="theme-color" content="#0b0b0b"><title>${e(title)}</title><meta name="description" content="${e(description)}"><link rel="canonical" href="${canonical}"><meta property="og:type" content="website"><meta property="og:site_name" content="DesignTaste"><meta property="og:title" content="${e(title)}"><meta property="og:description" content="${e(description)}"><meta property="og:url" content="${canonical}"><meta property="og:image" content="${ORIGIN + image}"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="${e(title)}"><meta name="twitter:description" content="${e(description)}"><meta name="twitter:image" content="${ORIGIN + image}"><link rel="icon" href="/favicon.svg"><link rel="stylesheet" href="/gallery.css"><link rel="preload" href="/fonts/geist-variable.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="/fonts/geist-mono-variable.woff2" as="font" type="font/woff2" crossorigin>${schema ? `<script type="application/ld+json">${JSON.stringify(schema).replace(/</g, "\\u003c")}</script>` : ""}`;+ return `<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="dark"><meta name="robots" content="${process.env.VERCEL_ENV === "preview" || path === "/404.html" ? "noindex,nofollow" : "index,follow"}"><meta name="theme-color" content="#0b0b0b"><title>${e(title)}</title><meta name="description" content="${e(description)}"><link rel="canonical" href="${canonical}"><meta property="og:type" content="website"><meta property="og:site_name" content="DesignTaste"><meta property="og:title" content="${e(title)}"><meta property="og:description" content="${e(description)}"><meta property="og:url" content="${canonical}"><meta property="og:image" content="${ORIGIN + image}"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="${e(title)}"><meta name="twitter:description" content="${e(description)}"><meta name="twitter:image" content="${ORIGIN + image}"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="icon" href="/icon-192.png" type="image/png" sizes="192x192"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><link rel="stylesheet" href="/gallery.css"><link rel="preload" href="/fonts/geist-variable.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="/fonts/geist-mono-variable.woff2" as="font" type="font/woff2" crossorigin>${schema ? `<script type="application/ld+json">${JSON.stringify(schema).replace(/</g, "\\u003c")}</script>` : ""}`;}function shell(content, options) {@@ -436,13 +436,17 @@ export function info(kind) {</section><section>- <h2>Available MCP tools</h2>+ <h2>Available MCP tools (with in-chat UI)</h2>+ <p>In hosts that support <strong>MCP Apps</strong> (Claude Desktop, Claude.ai, Claude Code, ChatGPT, and Cursor), DesignTaste renders an interactive dark-studio website browser right inside your chat — with live category pills, search, hover cards, heart moodboarding, and one-click direction prompts.</p><div class="mcp-tools-grid">- <div class="mcp-tool-card"><code>search_sites</code><p>Filter all curated websites by keyword, category, visual tag, or popular/curated/newest order.</p></div>- <div class="mcp-tool-card"><code>get_site</code><p>Inspect full editorial notes, metadata, and optionally receive the screenshot thumbnail directly as an image.</p></div>- <div class="mcp-tool-card"><code>list_categories</code><p>List all 8 design categories with exact site counts and top visual tags.</p></div>- <div class="mcp-tool-card"><code>get_saved_list</code><p>Fetch any shared <code>dt_...</code> moodboard with observations and optional thumbnail images for vision models.</p></div>- <div class="mcp-tool-card"><code>create_saved_list</code><p>Let your agent assemble a shortlist of valid site IDs and hand back a clickable <code>designtaste.wtf/?list=...</code> link.</p></div>+ <div class="mcp-tool-card"><code>browse_gallery</code><p>Open the interactive visual gallery inside chat — search, filter categories, paginate, and heart sites into a moodboard.</p></div>+ <div class="mcp-tool-card"><code>search_sites</code><p>Filter all curated websites by keyword, category, visual tag, or popular/curated/newest/A–Z order.</p></div>+ <div class="mcp-tool-card"><code>get_site</code><p>Inspect full editorial notes, similar references, and optionally receive the screenshot thumbnail directly as an image.</p></div>+ <div class="mcp-tool-card"><code>find_similar_sites</code><p>Find websites matching the aesthetic of any reference site ID or set of visual tags.</p></div>+ <div class="mcp-tool-card"><code>discover_random</code><p>Surface fresh random inspiration sparks with a live Shuffle button inside chat.</p></div>+ <div class="mcp-tool-card"><code>list_categories</code><p>Explore all 8 design categories with counts, preview thumbnails, and clickable top visual tags.</p></div>+ <div class="mcp-tool-card"><code>get_saved_list</code><p>Render any shared <code>dt_...</code> moodboard visually with optional thumbnail images for vision models.</p></div>+ <div class="mcp-tool-card"><code>create_saved_list</code><p>Assemble a shortlist of valid site IDs into a shareable <code>designtaste.wtf/?list=...</code> moodboard.</p></div><div class="mcp-tool-card"><code>submit_site</code><p>Recommend a public HTTPS website URL directly into the curated review queue.</p></div></div></section>diff --git a/docs/images/mcp-app.png b/docs/images/mcp-app.pngnew file mode 100644index 0000000..6fe4916Binary files /dev/null and b/docs/images/mcp-app.png differdiff --git a/scripts/build-gallery.mjs b/scripts/build-gallery.mjsindex 23e4415..40f9432 100644--- a/scripts/build-gallery.mjs+++ b/scripts/build-gallery.mjs@@ -31,6 +31,21 @@ for (const name of [])await cp(join(root, "fonts", name), join(out, "fonts", name));await cp(join(root, "favicon.svg"), join(out, "favicon.svg"));+const faviconBuf = await readFile(join(root, "favicon.svg"));+await Promise.all([+ sharp(faviconBuf, { density: 384 })+ .resize(180, 180)+ .png({ compressionLevel: 9 })+ .toFile(join(out, "apple-touch-icon.png")),+ sharp(faviconBuf, { density: 384 })+ .resize(192, 192)+ .png({ compressionLevel: 9 })+ .toFile(join(out, "icon-192.png")),+ sharp(faviconBuf, { density: 512 })+ .resize(512, 512)+ .png({ compressionLevel: 9 })+ .toFile(join(out, "icon-512.png")),+]);await cp(join(root, "gallery.css"), join(out, "gallery.css"));await build({entryPoints: [join(root, "gallery.js")],diff --git a/tests/gallery.test.mjs b/tests/gallery.test.mjsindex 5229360..e84ef51 100644--- a/tests/gallery.test.mjs+++ b/tests/gallery.test.mjs@@ -519,16 +519,25 @@ test("shared lists API validates catalog IDs, sanitizes titles, and loads savedassert.equal((await getSavedList("../bad", { env: {} })).status, 400);});-test("open MCP server handles initialize, tools/list, search_sites, saved lists, and resources", async () => {+test("open MCP server handles initialize, icons, MCP Apps UI, tools, saved lists, and resources", async () => {resetListsState();const init = await handleMcpMessage({jsonrpc: "2.0",id: 1,method: "initialize",- params: { protocolVersion: "2025-03-26" },+ params: { protocolVersion: "2025-11-25" },});assert.equal(init.result.serverInfo.name, "designtaste");- assert.equal(init.result.protocolVersion, "2025-03-26");+ assert.equal(init.result.serverInfo.title, "DesignTaste");+ assert.equal(init.result.protocolVersion, "2025-11-25");+ assert.ok(+ init.result.serverInfo.icons.some((i) => i.src === "https://designtaste.wtf/icon-192.png"),+ );+ assert.ok(+ init.result.capabilities.extensions["io.modelcontextprotocol/ui"].mimeTypes.includes(+ "text/html;profile=mcp-app",+ ),+ );const tools = await handleMcpMessage({jsonrpc: "2.0",@@ -536,10 +545,70 @@ test("open MCP server handles initialize, tools/list, search_sites, saved lists,method: "tools/list",});const toolNames = tools.result.tools.map((t) => t.name);- assert.ok(toolNames.includes("search_sites"));- assert.ok(toolNames.includes("get_saved_list"));- assert.ok(toolNames.includes("create_saved_list"));- assert.ok(toolNames.includes("submit_site"));+ for (const name of [+ "browse_gallery",+ "search_sites",+ "get_site",+ "find_similar_sites",+ "discover_random",+ "list_categories",+ "get_saved_list",+ "create_saved_list",+ "submit_site",+ ]) {+ assert.ok(toolNames.includes(name), `missing tool ${name}`);+ }+ const browseTool = tools.result.tools.find((t) => t.name === "browse_gallery");+ assert.equal(browseTool._meta.ui.resourceUri, "ui://designtaste/app.html");+ assert.equal(browseTool._meta["openai/outputTemplate"], "ui://designtaste/app.html");++ const uiRes = await handleMcpMessage({+ jsonrpc: "2.0",+ id: 20,+ method: "resources/read",+ params: { uri: "ui://designtaste/app.html" },+ });+ const uiDoc = uiRes.result.contents[0];+ assert.equal(uiDoc.mimeType, "text/html;profile=mcp-app");+ assert.ok(uiDoc.text.includes("ui/initialize"));+ assert.deepEqual(uiDoc._meta.ui.csp.resourceDomains, ["https://designtaste.wtf"]);++ const browse = await handleMcpMessage(+ {+ jsonrpc: "2.0",+ id: 21,+ method: "tools/call",+ params: { name: "browse_gallery", arguments: { category: "AI tools", limit: 6 } },+ },+ { env: {} },+ );+ assert.equal(browse.result.structuredContent.kind, "gallery");+ assert.equal(browse.result.structuredContent.sites.length, 6);++ const similar = await handleMcpMessage(+ {+ jsonrpc: "2.0",+ id: 22,+ method: "tools/call",+ params: { name: "find_similar_sites", arguments: { id: "linear", limit: 4 } },+ },+ { env: {} },+ );+ assert.equal(similar.result.structuredContent.kind, "gallery");+ assert.equal(similar.result.structuredContent.sites.length, 4);+ assert.ok(!similar.result.structuredContent.sites.some((s) => s.id === "linear"));++ const random = await handleMcpMessage(+ {+ jsonrpc: "2.0",+ id: 23,+ method: "tools/call",+ params: { name: "discover_random", arguments: { count: 4 } },+ },+ { env: {} },+ );+ assert.equal(random.result.structuredContent.mode, "random");+ assert.equal(random.result.structuredContent.sites.length, 4);const search = await handleMcpMessage({@@ -567,6 +636,7 @@ test("open MCP server handles initialize, tools/list, search_sites, saved lists,);const madeJson = JSON.parse(made.result.content[0].text);assert.match(madeJson.id, /^dt_[a-z0-9]{8}$/);+ assert.equal(made.result.structuredContent.kind, "list");const fetched = await handleMcpMessage({@@ -579,6 +649,7 @@ test("open MCP server handles initialize, tools/list, search_sites, saved lists,);const fetchedJson = JSON.parse(fetched.result.content[0].text);assert.deepEqual(fetchedJson.ids, ["anywr", "linear"]);+ assert.equal(fetched.result.structuredContent.kind, "list");const mcpPage = dom(info("mcp"));assert.match(mcpPage.window.document.body.textContent, /https:\/\/designtaste\.wtf\/api\/mcp\//);diff --git a/vercel.json b/vercel.jsonindex ab3ddce..d64d2b4 100644--- a/vercel.json+++ b/vercel.json@@ -6,11 +6,35 @@"outputDirectory": "apps/gallery/out","cleanUrls": true,"trailingSlash": true,- "headers": [{"source":"/(.*)","headers":[- {"key":"X-Content-Type-Options","value":"nosniff"},- {"key":"Referrer-Policy","value":"strict-origin-when-cross-origin"},- {"key":"X-Frame-Options","value":"DENY"},- {"key":"Permissions-Policy","value":"camera=(), microphone=(), geolocation=()"},- {"key":"Content-Security-Policy","value":"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'"}- ]}]+ "headers": [+ {+ "source": "/(.*)",+ "headers": [+ { "key": "X-Content-Type-Options", "value": "nosniff" },+ { "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" },+ { "key": "X-Frame-Options", "value": "DENY" },+ { "key": "Permissions-Policy", "value": "camera=(), microphone=(), geolocation=()" },+ {+ "key": "Content-Security-Policy",+ "value": "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'"+ }+ ]+ },+ {+ "source": "/images/(.*)",+ "headers": [+ { "key": "Access-Control-Allow-Origin", "value": "*" },+ { "key": "Cross-Origin-Resource-Policy", "value": "cross-origin" },+ { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }+ ]+ },+ {+ "source": "/(favicon\\.svg|icon-192\\.png|icon-512\\.png|apple-touch-icon\\.png)",+ "headers": [+ { "key": "Access-Control-Allow-Origin", "value": "*" },+ { "key": "Cross-Origin-Resource-Policy", "value": "cross-origin" },+ { "key": "Cache-Control", "value": "public, max-age=86400, stale-while-revalidate=604800" }+ ]+ }+ ]}