Skip to content

P2K0/agentlens

Repository files navigation

AgentLens Logo

AgentLens

The Eyes of AI, The Hands of Developer.

[中文] | English

License Node Version Stars

📚 Documentation   |   🎮 Online Demo


🌟 What is AgentLens?

AgentLens is a tool that empowers AI development assistants to "see" real-world UI defects. It captures visual context via a browser extension and synchronizes it in real-time to your AI (like Cursor, Claude) through the MCP (Model Context Protocol), enabling a "Annotate to Fix" workflow.


🚀 Quick Start (In 1 Minute)

No local compilation required. Start using it immediately:

1. Install Extension

  • Download this repository and load packages/extension/dist in Chrome via chrome://extensions (Developer Mode).

2. Configure AI (MCP)

Add the following configuration to your Claude Desktop or Cursor settings:

{
	"mcpServers": {
		"agentlens": {
			"command": "npx",
			"args": ["-y", "@p2k0/agentlens-mcp"]
		}
	}
}

🎮 Visual Playground

We have built-in a Visual Playground (apps/example) in the project, which you can use directly to experience the full AgentLens + MCP workflow:

  1. Start the Playground: Run in the project root:

    pnpm dev

    Visit the online demo https://agentlens-example.vercel.app or locally at http://localhost:3000, and you will see a demo page containing preset UI issues.

  2. Start the Trial:

    • Ensure your AI editor (Cursor/Claude) has MCP configured.
    • Limit the Playground page and open the AgentLens extension.
    • Circle any element on the page and add comments (e.g., "This button color is wrong").
    • Go back to the editor and send a command to AI: "Fix the issues I just annotated on the page".
    • Experience the magic of AI automatically reading visual contexts and accurately fixing code!

✨ Core Features

  • 🎯 Intuitive Annotation: Circle UI issues just like commenting in Figma.
  • 🤖 Native MCP: Seamless synchronization with AI assistants without manual copy-pasting.
  • 📸 Visual Enhancement: AI can directly see the DOM and snapshot when the issue occurs.
  • Auto-Fix: AI automatically locates source code and generates fix PRs.

📂 Development Guide (Contributing)

If you want to run the full environment locally or perform secondary development:

pnpm install
pnpm run build
# Start MCP Sidecar
cd packages/mcp && pnpm run sidecar

📄 License

This project is licensed under the Apache License 2.0.