Loading...
Loading...
Visual UI annotation tool for AI agents. Drop the React toolbar into any app — humans click elements and leave feedback, agents receive structured CSS selectors, bounding boxes, and React component trees to find exact code. Supports MCP watch-loop, platform-specific hooks (Claude Code / Codex / Gemini CLI / OpenCode), webhook delivery, and autonomous self-driving critique with agent-browser.
npx skill4agent add supercent-io/skills-template agentationThe missing link between human eyes and agent code.Instead of describing "the blue button in the sidebar," you hand the agent. It can.sidebar > button.primaryfor that directly.grep
agent-browseragentation (monorepo)
├── agentation → npm: agentation (React toolbar component)
│ └── src/index.ts → exports Agentation component + types + utilities
└── agentation-mcp → npm: agentation-mcp (MCP server + CLI)
├── src/cli.ts → agentation-mcp CLI (init, server, doctor)
└── src/server/ → HTTP REST API (port 4747) + SSE events + MCP stdio tools| Mode | How it works |
|---|---|
| Copy-Paste | Human annotates → clicks Copy → pastes markdown into agent chat |
| Agent Sync | |
# React toolbar (dev dependency)
npm install agentation -D
# or
pnpm add agentation -D
# MCP server (for agent integration)
npm install agentation-mcp -D
# or
pnpm add agentation-mcp -Dimport { Agentation } from 'agentation';
function App() {
return (
<>
<YourApp />
{process.env.NODE_ENV === 'development' && <Agentation />}
</>
);
}// app/layout.tsx
import { Agentation } from 'agentation';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html>
<body>
{children}
{process.env.NODE_ENV === 'development' && (
<Agentation endpoint="http://localhost:4747" />
)}
</body>
</html>
);
}// pages/_app.tsx
import { Agentation } from 'agentation';
export default function App({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
{process.env.NODE_ENV === 'development' && (
<Agentation endpoint="http://localhost:4747" />
)}
</>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
| | — | MCP server URL for Agent Sync mode |
| | — | Pre-existing session ID to join |
| | — | Callback when annotation created |
| | — | Callback when annotation deleted |
| | — | Callback when annotation edited |
| | — | Callback when all cleared |
| | — | Callback with markdown on copy |
| | — | On "Send Annotations" click |
| | | Set false to suppress clipboard write |
| | — | Called on new session creation |
| | — | Webhook URL to receive annotation events |
Start the server first before configuring any agent:bashnpx agentation-mcp server # HTTP :4747 + MCP stdio npx agentation-mcp server --port 8080 # custom port npx agentation-mcp doctor # verify setup
.claude/claude mcp add agentation -- npx -y agentation-mcp server~/.claude/claude_desktop_config.json.claude/mcp.json{
"mcpServers": {
"agentation": {
"command": "npx",
"args": ["-y", "agentation-mcp", "server"]
}
}
}npx agentation-mcp init.claude/settings.json~/.claude/settings.json{
"hooks": {
"UserPromptSubmit": [
{
"type": "command",
"command": "curl -sf --connect-timeout 1 http://localhost:4747/pending 2>/dev/null | python3 -c \"import sys,json;d=json.load(sys.stdin);c=d['count'];exit(0)if c==0 else[print(f'\\n=== AGENTATION: {c} UI annotations ===\\n'),*[print(f\\\"[{i+1}] {a['element']} ({a['elementPath']})\\n {a['comment']}\\n\\\")for i,a in enumerate(d['annotations'])],print('=== END ===\\n')]\" 2>/dev/null;exit 0"
}
]
}
}~/.codex/~/.codex/config.toml# Agentation MCP Server
[[mcp_servers]]
name = "agentation"
command = "npx"
args = ["-y", "agentation-mcp", "server"]
# Optional: teach Codex about watch-loop
developer_instructions = """
When user says "watch mode" or "agentation watch", call agentation_watch_annotations in a loop.
For each annotation: acknowledge it, fix the code using the elementPath CSS selector, resolve with summary.
"""config.toml~/.gemini/gemini mcp add agentation npx -y agentation-mcp server
# or with explicit scope
gemini mcp add -s user agentation npx -y agentation-mcp server~/.gemini/settings.json.gemini/settings.json{
"mcpServers": {
"agentation": {
"command": "npx",
"args": ["-y", "agentation-mcp", "server"]
}
}
}{
"mcpServers": {
"agentation": {
"command": "npx",
"args": ["-y", "agentation-mcp", "server"]
}
},
"hooks": {
"AfterAgent": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "curl -sf --connect-timeout 1 http://localhost:4747/pending 2>/dev/null | python3 -c \"import sys,json;d=json.load(sys.stdin);c=d.get('count',0);[print(f'[agentation] {c} pending annotations'),exit(1)]if c>0 else exit(0)\" 2>/dev/null;exit 0",
"description": "Check for pending agentation annotations"
}
]
}
]
}
}~/.config/opencode/~/.config/opencode/opencode.json{
"mcp": {
"agentation": {
"type": "local",
"command": ["npx", "-y", "agentation-mcp", "server"]
}
}
}{
"mcp": {
"agentation": {
"type": "local",
"command": ["npx", "-y", "agentation-mcp", "server"],
"environment": {
"AGENTATION_STORE": "sqlite",
"AGENTATION_EVENT_RETENTION_DAYS": "7"
}
}
}
}agentation_*npx add-mcp "npx -y agentation-mcp server"bash setup-agentation-mcp.sh [--all | --claude | --codex | --gemini | --opencode]#!/usr/bin/env bash
# setup-agentation-mcp.sh — Register agentation MCP for all agent platforms
set -euo pipefail
SETUP_CLAUDE=false; SETUP_CODEX=false; SETUP_GEMINI=false; SETUP_OPENCODE=false
while [[ $# -gt 0 ]]; do
case "$1" in
--claude) SETUP_CLAUDE=true ;;
--codex) SETUP_CODEX=true ;;
--gemini) SETUP_GEMINI=true ;;
--opencode) SETUP_OPENCODE=true ;;
--all) SETUP_CLAUDE=true; SETUP_CODEX=true; SETUP_GEMINI=true; SETUP_OPENCODE=true ;;
esac
shift
done
[[ "$SETUP_CLAUDE$SETUP_CODEX$SETUP_GEMINI$SETUP_OPENCODE" == "falsefalsefalsefalse" ]] && \
SETUP_CLAUDE=true && SETUP_CODEX=true && SETUP_GEMINI=true && SETUP_OPENCODE=true
MCP_JSON='"agentation": {"command": "npx", "args": ["-y", "agentation-mcp", "server"]}'
# Claude Code
if [[ "$SETUP_CLAUDE" == "true" ]]; then
mkdir -p ~/.claude
CFG=~/.claude/claude_desktop_config.json
if [[ -f "$CFG" ]] && command -v jq &>/dev/null; then
jq ".mcpServers += {$MCP_JSON}" "$CFG" > "$CFG.tmp" && mv "$CFG.tmp" "$CFG"
else
echo "{\"mcpServers\": {$MCP_JSON}}" > "$CFG"
fi
echo "✅ Claude Code: $CFG"
fi
# Codex CLI
if [[ "$SETUP_CODEX" == "true" ]]; then
mkdir -p ~/.codex
CFG=~/.codex/config.toml
if ! grep -q "agentation" "$CFG" 2>/dev/null; then
printf '\n[[mcp_servers]]\nname = "agentation"\ncommand = "npx"\nargs = ["-y", "agentation-mcp", "server"]\n' >> "$CFG"
fi
echo "✅ Codex CLI: $CFG"
fi
# Gemini CLI
if [[ "$SETUP_GEMINI" == "true" ]]; then
mkdir -p ~/.gemini
CFG=~/.gemini/settings.json
if [[ -f "$CFG" ]] && command -v jq &>/dev/null; then
jq ".mcpServers += {$MCP_JSON}" "$CFG" > "$CFG.tmp" && mv "$CFG.tmp" "$CFG"
else
echo "{\"mcpServers\": {$MCP_JSON}}" > "$CFG"
fi
echo "✅ Gemini CLI: $CFG"
fi
# OpenCode
if [[ "$SETUP_OPENCODE" == "true" ]]; then
mkdir -p ~/.config/opencode
CFG=~/.config/opencode/opencode.json
ENTRY='"agentation": {"type": "local", "command": ["npx", "-y", "agentation-mcp", "server"]}'
if [[ -f "$CFG" ]] && command -v jq &>/dev/null; then
jq ".mcp += {$ENTRY}" "$CFG" > "$CFG.tmp" && mv "$CFG.tmp" "$CFG"
else
echo "{\"mcp\": {$ENTRY}}" > "$CFG"
fi
echo "✅ OpenCode: $CFG"
fi
echo ""
echo "Done. Restart your agent(s) and run: npx agentation-mcp server"| Tool | Parameters | Description |
|---|---|---|
| none | List all active annotation sessions |
| | Get session with all annotations |
| | Get pending annotations for a session |
| none | Get pending annotations across ALL sessions |
| | Mark annotation as acknowledged (agent is working on it) |
| | Mark as resolved with optional summary |
| | Dismiss with required reason |
| | Add reply to annotation thread |
| | Block until new annotations arrive — core watch-loop tool |
1. Human opens app in browser
2. Clicks agentation toolbar → activates
3. Clicks element → adds comment → clicks Copy
4. Pastes markdown output into agent chat
5. Agent receives CSS selectors, elementPath, boundingBox
6. Agent greps/edits code using selectorAgent: agentation_watch_annotations (blocks up to 120s)
→ Human adds annotation in browser
→ Agent receives batch immediately
→ Agent: agentation_acknowledge(annotationId)
→ Agent makes code changes using elementPath as grep target
→ Agent: agentation_resolve(annotationId, "Changed button color to #3b82f6")
→ Agent: agentation_watch_annotations (loops again)When I say "watch mode" or "agentation watch", call agentation_watch_annotations in a loop.
For each annotation received:
1. Call agentation_acknowledge(annotationId)
2. Use elementPath to locate the code: Grep(elementPath) or search codebase for CSS class
3. Make the minimal change described in the comment
4. Call agentation_resolve(annotationId, "<brief summary of what was changed>")
Continue watching until I say stop, or until timeout.agent-browser# Start headed browser pointing at your dev server
agent-browser open http://localhost:3000
agent-browser snapshot -i
# Agent navigates, clicks elements via agentation toolbar, adds critique
# Annotations flow to agentation MCP server automaticallyagentation_watch_annotations → receives critique → acknowledge → edit → resolve → loop<Agentation webhookUrl="https://your-server.com/webhook" />
# or env var:
# AGENTATION_WEBHOOK_URL=https://your-server.com/webhooktype Annotation = {
// Core
id: string;
x: number; // % of viewport width (0-100)
y: number; // px from document top
comment: string; // User's feedback text
element: string; // Tag name: "button", "div", etc.
elementPath: string; // CSS selector: "body > main > button.cta" ← grep target
timestamp: number;
// Context
selectedText?: string;
boundingBox?: { x: number; y: number; width: number; height: number };
nearbyText?: string;
cssClasses?: string;
nearbyElements?: string;
computedStyles?: string;
fullPath?: string;
accessibility?: string;
reactComponents?: string; // "App > Dashboard > Button" ← component grep target
isMultiSelect?: boolean;
isFixed?: boolean;
// Lifecycle (server-synced)
sessionId?: string;
url?: string;
intent?: "fix" | "change" | "question" | "approve";
severity?: "blocking" | "important" | "suggestion";
status?: "pending" | "acknowledged" | "resolved" | "dismissed";
thread?: ThreadMessage[];
createdAt?: string;
updatedAt?: string;
resolvedAt?: string;
resolvedBy?: "human" | "agent";
};pending → acknowledged → resolved
↘ dismissed (requires reason)# Sessions
POST /sessions # Create session
GET /sessions # List all sessions
GET /sessions/:id # Get session + annotations
# Annotations
POST /sessions/:id/annotations # Add annotation
GET /annotations/:id # Get annotation
PATCH /annotations/:id # Update annotation
DELETE /annotations/:id # Delete annotation
GET /sessions/:id/pending # Pending for session
GET /pending # ALL pending across sessions
# Events (SSE streaming)
GET /sessions/:id/events # Session stream
GET /events # Global stream (?domain=filter)
# Health
GET /health
GET /status| Variable | Description | Default |
|---|---|---|
| | |
| Single webhook URL | — |
| Comma-separated webhook URLs | — |
| Days to keep events | |
~/.agentation/store.dbimport {
identifyElement, identifyAnimationElement,
getElementPath, getNearbyText, getElementClasses,
isInShadowDOM, getShadowHost, closestCrossingShadow,
loadAnnotations, saveAnnotations, getStorageKey,
type Annotation, type Session, type ThreadMessage,
} from 'agentation';| Platform | Config File | MCP Key | Hook |
|---|---|---|---|
| Claude Code | | | |
| Codex CLI | | | |
| Gemini CLI | | | |
| OpenCode | | | Skills system (no hook needed) |
| Cursor / Windsurf | | | — |
<Agentation>NODE_ENV === 'development'agentation_acknowledgesummaryagentation_resolveseverity: "blocking"elementPathreactComponentsagent-browseragentationagentation은 jeo 스킬의 VERIFY_UI 단계로 통합됩니다. plannotator가/planui에서 동작하는 방식과 동일한 패턴입니다.ExitPlanMode
plannotator (planui): agentation (agentui):
plan.md 작성 앱 UI에 <Agentation> 마운트
↓ 블로킹 ↓ 블로킹
plannotator 실행 agentation_watch_annotations
↓ ↓
UI에서 Approve/Feedback UI에서 어노테이션 생성
↓ ↓
approved:true 확인 annotation ack→fix→resolve
↓ ↓
EXECUTE 진입 다음 단계 또는 루프| 키워드 | 플랫폼 | 동작 |
|---|---|---|
| Claude Code | |
| Codex | |
| Gemini | GEMINI.md 지시: HTTP REST 폴링 패턴 |
| OpenCode | opencode.json |
# 1. jeo 실치 시 agentation 자동 등록
bash .agent-skills/jeo/scripts/install.sh --with-agentation
# 또는 전체 설치:
bash .agent-skills/jeo/scripts/install.sh --all
# 2. 앱에 agentation 컴포넌트 마운트
# app/layout.tsx 또는 pages/_app.tsx:
# <Agentation endpoint="http://localhost:4747" />
# 3. MCP 서버 실행
npx agentation-mcp server
# 4. 에이전트에서 agentui 키워드 입력 → watch loop 시작
# Claude Code: MCP 도구 직접 호출
# Codex: AGENTUI_READY 출력 → notify hook 자동 폴링
# Gemini: GEMINI.md HTTP 폴링 패턴
# OpenCode: /jeo-agentui 슬래시 커맨드jeo "<task>"
│
[1] PLAN (plannotator loop) ← plan.md 승인
[2] EXECUTE (team/bmad)
[3] VERIFY
├─ agent-browser snapshot
└─ agentui → VERIFY_UI (agentation loop) ← 이 단계
[4] CLEANUP자세한 jeo 통합 내용: jeo SKILL.md Section 3.3.1 상세 워크플로우 확인
agentation@2.2.1agentation-mcp@1.2.0