astrotation
Visual feedback for AI coding agents on Astro sites, providing live annotations with source file:line, CSS selector, Tailwind classes, and computed styles.
README
Astrotation
Visual feedback for AI coding agents on Astro sites. Annotate elements
right on your dev page; agents (Claude Code etc.) receive annotations live
over MCP — with the exact Astro source file:line, CSS selector, Tailwind
classes and computed styles attached.
Dev-only. Nothing ships to production builds.
Why Astro-native
file:lineprecision. Astro dev stamps elements withdata-astro-source-file/data-astro-source-loc— annotations point at the component source line, no selector guessing.- One process. The Astro integration hosts both the toolbar UI (Dev Toolbar app) and the MCP server inside the dev server. No separate CLI, no CORS, no extra ports to babysit.
- Live both ways. Agent finishes a fix → the pin turns red (◆ feedback, "review me") in your overlay; you resolve it green after checking. Agent asks a question → you reply in the overlay.
Install
npm install -D astrotation
// astro.config.mjs
import { defineConfig } from 'astro/config';
import astrotation from 'astrotation';
export default defineConfig({
integrations: [astrotation()],
});
Register the MCP server once (any project, same port):
claude mcp add --transport http astrotation http://localhost:7133/mcp
Use
npm run dev, open the site, click the ⊕ Astrotation icon in the Astro dev toolbar.- Hover an element (press
↑/↓to select its parent/child for pixel-exact targeting) → click → type a note at the❯prompt → Enter. Pin appears. - Tell your agent to check the annotations — or put it in hands-free mode: "call astrotation_watch in a loop; for each annotation: acknowledge, fix, hand back with astrotation_feedback + a summary".
- Pins recolor live: ○ open → ◑ in progress → ◆ feedback ("done, review me"). You review the change and hit resolve in the panel (✓ green) — or reply with more notes and the agent iterates. Agent questions show in the annotation thread; reply inline. Hit clear done to tidy resolved/dismissed pins.
MCP tools
| Tool | Purpose |
|---|---|
astrotation_list |
All annotations (filter by status, page) |
astrotation_get |
One annotation, full detail (thread, source, styles, outerHTML) |
astrotation_watch |
Block until new annotations/replies, return batch |
astrotation_acknowledge |
Mark as being worked on |
astrotation_feedback |
Hand a finished fix back for review, with a summary (agent's terminal action — resolving is yours, in the overlay) |
astrotation_dismiss |
Decline with a reason |
astrotation_reply |
Ask the owner a clarifying question |
astrotation_clear |
Bulk-remove annotations by status (default: resolved+dismissed) |
Options
astrotation({
port: 7133, // MCP HTTP port
file: '.astrotation/annotations.json', // store, relative to project root
})
Add .astrotation/ to your .gitignore (session artifacts, not source).
Annotation payload
{
"id": "a1b2c3d4",
"page": "/", "url": "http://localhost:4321/", "viewport": "1440x900",
"element": "p",
"selector": "section#hero > div > p",
"sourceFile": "src/components/Hero.astro", "sourceLoc": "49:8",
"classes": "max-w-xs",
"section": "Hero", // nearest heading — where on the page
"role": null, // explicit role / aria-label if present
"styles": "display: block; font-size: 14px; …",
"text": "Senior product designer across…",
"selectedText": null,
"outerHTML": "<p class=\"max-w-xs\">Senior product designer…</p>",
"box": { "x": 980, "y": 620, "w": 320, "h": 120 },
"comment": "make this column wider",
"status": "pending",
"thread": []
}
License
MIT © Dmytro Karpushyn
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。