npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agent-eyes

v1.0.6

Published

MCP server that bridges browser console errors to AI coding agents

Readme

👁️ AgentEyes

npm version License: MIT

Let your AI coding agent see your browser's console errors in real-time.

AgentEyes bridges the gap between your development browser and AI coding assistants. Instead of copy-pasting error messages, your AI can now directly query what's happening in your browser.


🎯 The Problem

When debugging web apps, you often need to:

  1. See an error in your browser console
  2. Copy it manually
  3. Paste it to your AI assistant
  4. Wait for a response

AgentEyes eliminates steps 1-3. Your AI assistant can now directly ask: "What errors are in the browser?"


🔧 How It Works

┌─────────────────┐    WebSocket     ┌─────────────────┐    Stdio/MCP    ┌─────────────────┐
│   Your Browser  │ ───────────────► │  AgentEyes      │ ◄────────────── │   AI Agent      │
│   (Next.js app) │   Port 3001      │  Server         │                 │   (IDE)         │
└─────────────────┘                  └─────────────────┘                 └─────────────────┘
  1. Your browser sends errors to AgentEyes via WebSocket (port 3001)
  2. AgentEyes server stores the last 20 errors in memory
  3. Your AI agent queries errors using the get_browser_logs MCP tool

📋 Prerequisites

Before you start, make sure you have:

  • Node.js 18+ installed (download here)
  • An AI-powered IDE that supports MCP (VS Code, Cursor, Windsurf, or AntiGravity)
  • A Next.js 13+ app (or any React app)

🚀 Quick Start (3 Steps)

Step 1: Install the Package

Open your terminal and run:

npm install agent-eyes

Step 2: Add AgentEyes to Your IDE

Choose your IDE below and follow the instructions:

Create or edit .vscode/mcp.json in your project:

{
  "servers": {
    "agent-eyes": {
      "command": "npx",
      "args": ["agent-eyes"]
    }
  }
}

Edit your Cursor MCP settings at ~/.cursor/mcp.json:

{
  "mcpServers": {
    "agent-eyes": {
      "command": "npx",
      "args": ["agent-eyes"]
    }
  }
}

Then restart Cursor.

Click on Manage MCPs in AntiGravity, then click View raw config and add:

{
  "mcpServers": {
    "agent-eyes": {
      "command": "npx",
      "args": ["agent-eyes"]
    }
  }
}

Click Refresh to apply.

  1. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  2. Type "Open Windsurf Settings" → Navigate to Advanced → Cascade
  3. Click "View raw config" to open ~/.codeium/windsurf/mcp_config.json
  4. Add the following:
{
  "mcpServers": {
    "agent-eyes": {
      "command": "npx",
      "args": ["agent-eyes"]
    }
  }
}
  1. Click the MCP servers button (hammer icon) and hit Refresh

Step 3: Add the React Component to Your App

In your Next.js app, edit app/layout.tsx (or create it):

import { AgentEyesProvider } from 'agent-eyes/react';

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

💡 Don't worry about production! The component automatically disables itself when NODE_ENV is not "development". It adds zero overhead to your production builds.


✅ Test It's Working

  1. Start your Next.js app in development mode:

    npm run dev
  2. Open your browser and navigate to your app (usually http://localhost:3000)

  3. Trigger a test error in the browser console (F12 → Console):

    console.error("Test error from AgentEyes!")
  4. Ask your AI agent:

    "Check my browser for any errors"

If everything is set up correctly, your AI will respond with the test error!


💬 Usage Examples

Once set up, you can ask your AI assistant things like:

  • "What errors are showing in my browser?"
  • "Check the browser console for any issues"
  • "Are there any unhandled exceptions in my app?"
  • "Debug my frontend - what's going wrong?"

The AI will use the get_browser_logs tool to fetch errors including:

  • console.error() calls
  • 💥 Uncaught exceptions (window.onerror)
  • ⚠️ Unhandled promise rejections

🔍 API Reference

Tool: get_browser_logs

Returns the last 20 browser errors with:

| Field | Description | |-------|-------------| | Timestamp | When the error occurred | | Type | error, crash, or unhandledrejection | | Message | The error message | | Stack | First 3 lines of the stack trace | | URL | The page where the error occurred |


🛠️ Troubleshooting

"Port 3001 is already in use"

AgentEyes automatically handles this! On startup, it will:

  • Detect if another Node.js process is using port 3001
  • Terminate the old instance (e.g., a zombie AgentEyes process)
  • Start fresh

If the port is used by a non-Node.js service (like Python or Java), AgentEyes will not kill it and will log a warning instead. In this case, you'll need to free the port manually.

"Cannot find module 'agent-eyes/react'"

Make sure you installed the package:

npm install agent-eyes

"No browser errors captured yet"

Check that:

  1. Your Next.js app is running in development mode (npm run dev)
  2. You added <AgentEyesProvider /> to your layout
  3. An error has actually occurred in the browser

AI says "Unknown tool: get_browser_logs"

Your IDE hasn't loaded the MCP server. Try:

  1. Restart your IDE
  2. Check your MCP config file for typos
  3. Look for MCP errors in your IDE's output panel

🏗️ Development

Want to contribute or run locally?

# Clone the repository
git clone https://github.com/oseifelix/agent-eyes.git
cd agent-eyes

# Install dependencies
npm install

# Build the TypeScript
npm run build

# Run the server
npm start

📄 License

MIT © 2024


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Made with ❤️ for the AI-assisted development community