AgentSensor
Captures and source-maps esbuild build errors, helping agents fix bundling issues.
Captures backend route crashes and runtime exceptions from Express servers, with source-mapped stack traces.
Captures backend route crashes and runtime exceptions from Fastify servers, with source-mapped stack traces.
Captures Next.js build errors and browser runtime errors, mapping them to exact source files and injecting error listeners into Next.js dev chunks.
Resolves pnpm monorepo workspace roots and strips pnpm prefixes to map stack traces to correct source files.
Captures React console.error and component render errors from the browser, source-mapped to application code.
Captures Remix browser runtime errors and maps them to exact source files.
Captures Storybook browser runtime errors and maps them to exact source files.
Resolves Turborepo monorepo workspace roots and sub-package paths for accurate source mapping.
Captures TypeScript (tsc) compiler errors and source-maps them to the exact file and line.
Captures Vite browser runtime errors, injects a listener into the Vite dev server client, and source-maps them to monorepo files.
Captures Webpack build errors and source-maps them to application code.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AgentSensorfix the error I just hit"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AgentSensor
Zero-config runtime & browser error sensor for AI coding agents.
Wrap your dev server with one command, then let Claude Code, Codex, Cursor, Antigravity, or any MCP client see the real crashes from your terminal and browser — mapped to the exact file and line, with zero copy-paste.
What it does · Demo · Quick start · MCP tools · How it works · Contributing
Status: pre-release (0.1). Expect rapid improvements before 1.0.
What it does
⚡ Zero code changes: wrap your existing dev script (
agentsensor run -- npm run dev). No SDK imports, no middleware, no config files.🌐 Captures both server and browser crashes: hooks Node V8 exceptions, Vite / Remix / Storybook browser runtime errors (
window.onerror,unhandledrejection, Reactconsole.error), Next.js / Webpack / Turbopack build errors, esbuild errors, and TypeScript (tsc) errors.🎯 Source-mapped to your real code: automatically enables
--enable-source-maps, stripspnpm/turbomonorepo prefixes, collapsesnode_modulesnoise, and maps browser URLs (http://localhost:6006/src/...) back to exact monorepo files (packages/ui/src/...).📋 Live
openvsresolvedstatus board: maintains.agentsensor/status.jsonso fixed errors from earlier sessions never confuse the agent — while automatically reopening an error if it ever happens again.🤖 Automatic agent triggering: sends MCP server instructions so connected agents check
get_runtime_errorsfirst whenever you report a bug or crash.🔒 100% local: no accounts, no cloud, no telemetry, no background daemons.
AgentSensor doesn't guess fixes — it gives your coding agent the exact runtime reality (error type, message, source-mapped file:line:column, and the 30 log lines leading up to the crash) so the agent fixes the real bug on the first try.
Related MCP server: harness-fe
Demo
Run your dev server through agentsensor:
npx -y agentsensor-mcp run -- npm run devWhen your app or browser throws an error, just talk to your assistant naturally:
You: The checkout page just crashed — fix it.
Claude: (calls
get_runtime_errors→get_error_detail) FoundOPENerror[9e84385bb1]:TypeError: Cannot read properties of undefined (reading 'code')atsrc/checkout/total.ts:17:38. I added a guard for optionalcouponincalculateTotalCentsand calledcheck_fix— error[9e84385bb1]is now markedresolvedin.agentsensor/status.json.
Who it's for
Developers using AI coding agents (Claude Code, Codex, Antigravity, Cursor, Windsurf, Copilot): stop acting as the copy-paste bridge between your terminal/Chrome DevTools and your chat window.
Full-stack & UI engineers (Next.js, Vite, Remix, Storybook, Express, Fastify): catch both backend route crashes and frontend React component render errors in one place.
Monorepo teams (
pnpm, Turborepo, Nx): automatic workspace root detection and sub-package path resolution out of the box.
Quick start
1. Run your dev server with agentsensor
Prefix your normal dev command with npx -y agentsensor-mcp run -- (or install globally with npm i -g agentsensor-mcp and use agentsensor run --):
npx -y agentsensor-mcp run -- npm run devYour terminal output and colors stay completely unchanged, and .agentsensor/ is automatically added to .gitignore.
2. Connect your AI coding agent (one-time setup)
Claude Code
claude mcp add agentsensor -- npx -y agentsensor-mcpOpenAI Codex (~/.codex/config.toml)
[mcp_servers.agentsensor]
command = "npx"
args = ["-y", "agentsensor-mcp"]Antigravity / Cursor / Windsurf / GitHub Copilot (mcp_config.json)
{
"mcpServers": {
"agentsensor": {
"command": "npx",
"args": ["-y", "agentsensor-mcp"]
}
}
}3. Trigger a bug and ask your agent
Ask your agent:
"Fix the error I just hit."
MCP tools
Tool | Parameters | Description |
|
| Returns active |
|
| Returns the full source-mapped stack trace (user |
|
| Checks whether |
|
| Explicitly marks a specific |
How it works
flowchart LR
Dev["agentsensor run -- npm run dev"] -->|"Terminal stream + Browser hook"| Parser["Stack Trace & Bundler Parser"]
Parser -->|"Dedupe & sync"| Store[".agentsensor/status.json + errors.jsonl"]
Store -->|"Read"| MCP["agentsensor-mcp (stdio)"]
MCP <-->|"MCP Tools"| Agent["Claude Code / Codex / Antigravity / Cursor"]Terminal + Browser Capture:
agentsensor runspawns your dev command with--enable-source-mapsand a lightweight preload hook (agentsensor-mcp/register). It watchesstdout/stderrfor server/bundler errors and automatically injects a tiny listener into/@vite/clientand Next.js dev chunks to catch browser crashes (window.onerror,unhandledrejection, Reactconsole.error) viaPOST /__agentsensoron the same dev server port.Line-Number-Independent Fingerprinting: Errors are hashed by error type, normalized message, and top app file/function (excluding line numbers so signatures stay stable even after the agent edits the file).
Live Status Board (
.agentsensor/status.json): Every error starts inopen. When the agent fixes the code and runscheck_fix(orresolve_error), the error moves toresolved. If that error ever fires again later, it automatically moves back toopen.Multi-Project Root Resolution:
agentsensor-mcplocates the right.agentsensor/directory using MCP client workspaceroots, the--projectflag /AGENTSENSOR_PROJECTenv var, or by walking up from the current working directory.
Try the included broken app
Clone the repo and run the planted-bug demo server:
git clone https://github.com/arif-js/agentsensor.git
cd agentsensor-mcp
npm install && npm run build
AUTO_TRIGGER=1 node dist/cli.js run -- npx tsx examples/broken-app/server.tsThen ask your MCP-connected agent: "Check runtime errors and fix the bug in examples/broken-app/server.ts."
Contributing
Issues and pull requests are welcome! Before submitting a PR:
npm run lint
npm run typecheck
npm test
npm run buildLicense
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Sentry - error monitoring, issue tracking, and debugging for AI assistants
- BugTapeOAuthai.bugtape
Production bugs with replay, network, console and stack, ranked for your coding agent to fix.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Voice-powered bug reporting with 13 MCP tools. Record bugs by talking; let AI find and fix them.
Related MCP Servers
- AlicenseAqualityDmaintenanceZero-config MCP server that gives AI coding assistants a real-time diagnostic snapshot of your local dev environment. Detects framework, running services, recent errors, git state, and provides a health diagnosis in one call.310 npm1MIT
- AlicenseNot gradedqualityAmaintenanceA source-aware MCP server that connects AI agents to browser and server runtimes, enabling real-time debugging, monitoring, and automatic fixes via WebSocket or HTTP.2MIT
- AlicenseNot gradedqualityCmaintenanceRuntime feedback MCP server for AI coding agents. It watches dev server logs, parses errors, and exposes them as MCP tools so AI agents can instantly verify code changes.20 npm3AGPL 3.0
- AlicenseAqualityBmaintenanceEnables AI agents to monitor and debug browser runtime errors, console logs, and page diagnostics in real time via a Chrome extension and local MCP server.4MIT