croquis-mcp
Enables AI agents to manage web production projects by providing tools for sitemap planning, content drafting, and review comment workflows.
README
Croquis
AI-native web production platform — sitemap, content drafts and visual review, unified around pages.
Croquis (クロッキー, "quick sketch") takes a web project from structure to sign-off in one place:
- 🗺 Sitemap — plan the page tree (hierarchy, purpose, audience, status)
- ✍️ Content — draft each page as typed blocks (heading / body / image / CTA)
- 💬 Review — clients right-click any element on the live site to leave comments, captured with rich element metadata (CSS selector, computed styles, DOM context, heading trail, screenshot)
- 🤖 AI-first — generate sitemap drafts and page copy from a brief, digest open comments into a prioritized action plan, export everything as LLM-ready JSON/Markdown, and operate it all from Claude Code via the bundled MCP server
Self-hosted on Cloudflare (Workers + D1 + R2) — runs comfortably in the free tier.
📖 日本語の使い方ガイド: docs/usage.ja.md

Tour
Reviewers right-click any element on the live site — the widget (isolated in a shadow root) captures the CSS selector, computed styles, surrounding heading context and viewport along with the comment. That's the screenshot above.
Plan the sitemap — pages form a tree with per-page purpose/audience/status. This one was generated by POST /ai/sitemap from a one-paragraph brief in Japanese:

Draft content per page — typed blocks (heading / body / image / cta), with AI drafts marked as such:

Work through review comments — filter by status, see the exact target selector, reply and resolve:

Hand everything to an AI — one click copies the whole project as LLM-ready Markdown (or JSON):

Why Croquis?
| Typical feedback tools | Croquis | |
|---|---|---|
| Captured context | element selector only | selector + computed style + outer HTML + heading context + viewport + screenshot |
| AI integration | none | MCP server + versioned JSON/Markdown export designed for LLM agents |
| Scope | review only | sitemap → content → review, one Page entity end-to-end |
| Hosting | vendor SaaS | your Cloudflare account (AGPL-3.0, self-hosted) |
The loop this enables: a client right-clicks "make this CTA bigger" → the comment lands with the exact selector and computed styles → you (or Claude Code, via MCP) read it, fix it, reply and resolve — without leaving the editor.
Architecture
┌────────────────────────────────────────────┐
│ Any website │
│ <script src="croquis-widget.js" │ @croquis/widget
│ data-croquis-ingest-key="ing_…"> │ Shadow DOM, right-click → comment
└──────────────┬─────────────────────────────┘
│ POST /ingest/comments (write-only ingest key)
▼
┌────────────────────────────────────────────┐
│ Cloudflare Workers (Hono) + D1 + R2 │ @croquis/api
│ multi-tenant: admin / project token / │
│ ingest key / share link (+password) │
└──────┬─────────────────────┬───────────────┘
│ │
▼ ▼
┌──────────────┐ ┌─────────────────────────┐
│ Dashboard │ │ MCP server (stdio) │ @croquis/mcp
│ Preact+Vite │ │ 14 tools for Claude Code│
└──────────────┘ └─────────────────────────┘
Monorepo (pnpm workspaces):
| Package | What it is |
|---|---|
@croquis/shared |
Zod schemas, types, constants, Markdown export — single source of truth |
@croquis/tokens |
W3C-DTCG design tokens → generated --cq-* CSS custom properties + typed TS map |
@croquis/api |
Workers + Hono + D1 + R2 multi-tenant API |
@croquis/dashboard |
Admin UI (Preact + Vite, ITCSS + BEM, tokens only) |
@croquis/widget |
Embeddable feedback widget (vanilla TS, Shadow DOM, single IIFE) |
@croquis/mcp |
MCP server exposing the whole platform to AI agents |
Quickstart (local)
Prerequisites: Node ≥ 22, pnpm ≥ 10.
git clone <this repo> croquis && cd croquis
pnpm install
pnpm build # generates tokens + builds everything
# 1. API (terminal A)
cd packages/api
cp .dev.vars.example .dev.vars # set ADMIN_TOKEN
pnpm migrate:local # apply D1 migrations locally
pnpm dev # http://localhost:8787
# 2. Dashboard (terminal B)
pnpm dev:dashboard # http://localhost:5173
# connect with API URL + your ADMIN_TOKEN, create a project
Embed the widget on any page you want reviewed:
<script
src="/path/to/croquis-widget.js"
data-croquis-api="http://localhost:8787"
data-croquis-ingest-key="ing_…" <!-- from project creation -->
></script>
Right-click any element → comment → it appears in the dashboard's Review tab.
Deploy to Cloudflare
cd packages/api
wrangler d1 create croquis # put database_id into wrangler.jsonc
wrangler r2 bucket create croquis-screenshots
wrangler d1 migrations apply croquis --remote
wrangler secret put ADMIN_TOKEN
wrangler deploy
Host the dashboard anywhere static (Cloudflare Pages works well: pnpm --filter @croquis/dashboard build → deploy packages/dashboard/dist). Serve packages/widget/dist/croquis-widget.js from any static host or R2.
Claude Code / MCP
// .mcp.json
{
"mcpServers": {
"croquis": {
"command": "node",
"args": ["<repo>/packages/mcp/dist/index.js"],
"env": {
"CROQUIS_API_URL": "https://croquis-api.<you>.workers.dev",
"CROQUIS_TOKEN": "<admin or project token>"
}
}
}
}
17 tools: croquis_list_projects, croquis_get_project, croquis_create_project, croquis_list_pages, croquis_create_page, croquis_update_page, croquis_list_content_blocks, croquis_create_content_block, croquis_list_comments, croquis_get_comment, croquis_resolve_comment, croquis_reply_comment, croquis_export_project, croquis_export_project_markdown, croquis_generate_sitemap, croquis_generate_content, croquis_digest_comments.
Typical prompts: "list the open review comments and fix each one in the code, then resolve them" / "generate the sitemap for a bakery brand site and draft the homepage copy".
AI generation
Configure a provider on the API (Wrangler secret / .dev.vars):
| Env | Meaning |
|---|---|
ANTHROPIC_API_KEY or OPENAI_API_KEY |
enables AI endpoints (501 otherwise) |
AI_PROVIDER |
force anthropic / openai (default: first key found) |
AI_MODEL |
override model (defaults: claude-sonnet-5 / gpt-5-mini) |
| Endpoint | What it does |
|---|---|
POST /projects/:id/ai/sitemap {brief} |
drafts a page tree from a brief and inserts the pages |
POST /projects/:id/ai/content {page_id, brief?} |
drafts content blocks for a page (marked ai_generated) |
GET /projects/:id/ai/digest |
prioritized Markdown digest of open comments (selectors included) |
Design system: no hardcoded values
Croquis enforces its own design discipline mechanically:
- All design values live in DTCG token JSON (
packages/tokens/src/*.tokens.json) — a dependency-free generator emits--cq-*CSS custom properties (namespaced to survive injection into third-party pages) and a typed TS map. - Component CSS follows ITCSS layering (via native
@layer) with BEM naming. pnpm check:tokensfails CI on any raw color / absolute length in component CSS.- Tokens attach to
:where(:root, :host)so the same sheet works in the document and inside the widget's shadow root.
API surface (summary)
| Route | Auth | Purpose |
|---|---|---|
POST /projects · GET /projects |
admin | create (returns token once) / list |
GET/PATCH/DELETE /projects/:id |
admin or project token | manage project |
GET /projects/:id/export |
admin or project token | versioned JSON export |
…/pages + …/pages/:id |
project scope | sitemap CRUD (hierarchy via parent_id) |
…/pages/:id/content-blocks |
project scope | draft content CRUD |
…/comments (+replies, screenshot) |
project scope | review comments, threads |
POST /ingest/comments |
X-Croquis-Ingest-Key |
widget write-only ingest |
GET /share/:slug |
public (+password) | read-only client view, no keys exposed |
Development
pnpm test # Vitest 4 everywhere; API tests run in workerd via @cloudflare/vitest-pool-workers
pnpm typecheck # strict TS across the monorepo
pnpm check:tokens # design-token enforcement
Roadmap
- Widget screenshot capture (html-to-image) — the API/storage path already supports it
- Slack / GitHub / Linear notifications
- Full user accounts & roles (schema already carries
members)
License
AGPL-3.0. You can self-host freely; if you run a modified version as a service, you must publish your changes. For a commercial license, open an issue.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。