next-design-overlay

next-design-overlay

MCP server for Next.js design overlay, enabling AI agents to query visual UI tasks, fetch annotated snapshots, and mark tasks as resolved.

Category
访问服务器

README

Next.js Design Overlay for AI Coding Agents 🎨

npm version License: MIT GitHub stars

An interactive Next.js Design Overlay & MCP server that lets you visually annotate UI tasks and instantly sync them with AI coding agents like Cursor, Claude or Gemini.

<!-- Demo showing visual annotation and agent handoff --> <div align="center"> <video src="demo.mp4" autoplay loop muted playsinline width="800"></video> </div>

A standalone mini-application and MCP (Model Context Protocol) server designed to bridge the gap between human designers/developers and AI coding agents. It provides an interactive UI inside your Next.js application to visually annotate, layout, and document design tasks, which are instantly synchronized with your AI agent.

Features

  • Visual Annotations: Draw bounding boxes, arrows, and drop pin markers directly over your local UI.
  • Grid Systems: Overlay customizable horizontal/vertical 8pt grid systems to verify alignment.
  • Component Inspector: Hover over any UI element to automatically capture its React component name, source file location (e.g. src/components/Button.tsx:L42), computed CSS styles, and Tailwind classes.
  • Task Management: Create structured tasks linked to visual areas. Tasks are stored in a .design-spec/annotations.json file and compiled to a UI_SPEC.md for agents to read.
  • MCP Server: Exposes tools for AI agents to query active design tasks, fetch visual snapshots, and mark tasks as resolved.

🚀 Quickstart

Run the following command in the root of your Next.js App Router project:

npx next-design-overlay init

Takes less than a minute! The installer will ask you a few questions and automatically copy the necessary components, API routes, and MCP scripts into your project. It will also install html-to-image as a dependency.

Prerequisites

  • Next.js 13+ (App Router)
  • Tailwind CSS (The UI is styled using standard Tailwind utility classes)
  • React 18+

Setup & Usage

1. Mount the Component

After installation, import and mount the <DesignOverlay /> component in your global layout file (e.g., src/app/layout.tsx):

import { DesignOverlay } from '@/components/design-overlay/DesignOverlay';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <DesignOverlay />
      </body>
    </html>
  );
}

Note: The component will automatically hide itself in production environments (process.env.NODE_ENV !== 'development').

2. Connect the MCP Server

To allow your AI Coding Agent to read the visual tasks you create, add the MCP server to your agent's configuration.

For example, in Cursor, go to Cursor Settings > MCP and add a new stdio server:

  • Name: Design Overlay
  • Command: node scripts/design-overlay-mcp.js

3. Using the UI

Start your Next.js dev server (npm run dev). You will see a small palette icon (🎨) in the bottom-left corner of your screen.

  1. Click the icon to activate Design Mode.
  2. Inspect: Hover over elements to see their source code location and CSS.
  3. Draw: Use the Bounding Box (🔲), Arrow (↘️), or Pin (📍) tools to highlight issues on the screen.
  4. Create Task: Click the element or finish your drawing to open the Annotation Modal. Write instructions for your AI agent (e.g., "Fix alignment of this button").
  5. Agent Handoff: The AI agent will automatically detect the new task via the MCP server or the generated UI_SPEC.md file, locate the exact file/line number, see a screenshot of your annotation, and write the code to fix it!

Architecture

When you save a task:

  1. The API Route (app/api/design-overlay/route.ts) receives the payload.
  2. Screenshots (clean, marked-up, composite) are generated and saved to .design-spec/snapshots/.
  3. The task metadata is written to .design-spec/annotations.json.
  4. A human/agent-readable markdown file UI_SPEC.md is compiled at your project root.
  5. The MCP Server serves these files directly to the LLM context when requested.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选