AgentSensor
AgentSensor is a local, zero-config MCP server that exposes your dev server's real runtime and browser errors so AI coding agents can find, inspect, and verify fixes for crashes.
List active errors —
get_runtime_errorsreturnsOPENruntime, bundler (Vite/Next.js/Storybook), TypeScript, and browser errors grouped by signature witherror_id,file:line:column, occurrence counts, and timestamps.Filter results — narrow by
since_minutes,limit(1–50, default 10),all_sessions,include_resolved, or a specificprojectpath.Inspect a crash —
get_error_detailgives the full source-mapped stack trace (app frames highlighted,node_modulescollapsed), ~30 preceding log lines, and the command or browser URL that produced it.Verify a fix —
check_fixreportsstill_failingornot_seenand moves the error fromopentoresolvedin.agentsensor/status.json.Manually resolve —
resolve_errormarks oneerror_idor all open errors as resolved, auto-reopening if the error fires again.Capture both sides — intercepts backend V8 exceptions, unhandled rejections, bundler/type errors, and in-browser errors (
window.onerror,unhandledrejection, React component errors).Stay private — 100% local: no accounts, cloud, telemetry, or background daemons.
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 · Supported stack · 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: intercepts backend runtime exceptions, bundler compilation errors, and in-browser exceptions (
window.onerror,unhandledrejection, React component errors).🎯 Source-mapped to your real code: automatically enables
--enable-source-maps, strips monorepo runner prefixes, collapsesnode_modulesnoise, and maps browser URLs back to exact workspace files.📋 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
Supported stack
AgentSensor currently supports the Node.js, JavaScript, and TypeScript ecosystem:
Layer | Supported | Details |
Runtimes | Node.js (>=18.17) | JavaScript & TypeScript |
Frontend & SSR | Next.js, Vite, Remix, Storybook | Dev server builds & browser crashes ( |
Backend | Express, Fastify, NestJS, Koa, Node CLI scripts | V8 exceptions, unhandled promise rejections, source-mapped stack traces |
Compilers & Bundlers |
| Build-time errors, type errors, syntax crashes |
Monorepos |
| Strips runner prefixes, maps local package paths |
Non-Node runtimes (Python, Go, Rust): Not supported yet. Dedicated runtime hooks and stack trace parsers for these languages are planned for upcoming releases.
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: stop acting as the manual copy-paste bridge between terminal errors, Chrome DevTools, and chat windows (Claude Code, Codex, Antigravity, Cursor, Windsurf, Copilot).
Full-stack teams: catch backend route crashes and frontend React component render errors in one unified stream.
Monorepo teams: 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)
Via Smithery (Automatic install for Claude Desktop)
npx -y @smithery/cli install @arif-js/agentsensor --client claudeClaude 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
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
Available Tools
4 toolscheck_fixA
ALWAYS call this after applying a code fix for an error_id to verify whether the error recurred in the running dev server or browser. Reports 'still_failing' if seen again, or 'not_seen' (and moves the error from 'open' to 'resolved' in .agentsensor/status.json).
| Name | Required | Description | Default |
|---|---|---|---|
| since | No | ISO timestamp marking when the fix was applied. If omitted, checks for occurrences newer than the previous latest occurrence. | |
| project | No | Optional project directory path if different from the current workspace. | |
| error_id | Yes | The error ID to check. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does meaningful work: it discloses the two result states ('still_failing', 'not_seen') and the important side effect that a 'not_seen' result mutates .agentsensor/status.json by moving the error from 'open' to 'resolved'. It omits whether the check is instantaneous or waits/samples the dev server, which matters for a recurrence check.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single dense sentence front-loaded with the imperative call condition, then the verification purpose, then the outcome enumeration. No filler and every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, and the description correctly compensates by naming both return states and the underlying status.json mutation. It remains slightly incomplete about timing (does the check wait for the fix to take effect?) and the absence of an error, but an agent has enough to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all three parameters (error_id, since, project) are already documented in the schema, including the 'since' fallback behavior. The description adds no parameter-level meaning beyond that, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: verifying whether an error_id recurred after a code fix. It also names its trigger condition and the two possible outcomes, letting an agent distinguish it from resolve_error (manual resolution) and get_error_detail (inspection only) without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly prescribes when to call it ("ALWAYS call this after applying a code fix for an error_id"), which is strong sequencing guidance. It does not, however, clarify when to use it instead of the sibling resolve_error, which appears to have overlapping resolution semantics.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_error_detailA
Call this immediately after get_runtime_errors to inspect an error_id. Returns the full source-mapped stack trace (user app frames highlighted, node_modules collapsed), preceding log lines, and the command/browser URL that produced it.
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | Optional project directory path if different from the current workspace. | |
| error_id | Yes | The error ID from get_runtime_errors. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses the return shape (source-mapped stack trace, highlighted user frames, collapsed node_modules, preceding log lines, originating command/URL), implying a read-only inspection. It omits failure modes such as an unknown or expired error_id, which keeps it short of a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, zero waste: the first front-loads the calling trigger, the second enumerates exactly what comes back. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description must describe the return value and does so in useful detail. It is nearly complete for a two-parameter read tool, with only error/edge-case behavior left unstated.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and both parameters are documented in the schema, including that error_id comes from get_runtime_errors, so the baseline is 3. The description reiterates the error_id source but adds no format, syntax, or project-path guidance beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('inspect an error_id', returns the source-mapped stack trace) and clearly distinguishes itself from get_runtime_errors (it is the follow-up drill-down) and resolve_error. An agent can tell what this tool does without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says to call it immediately after get_runtime_errors, which pins down the trigger condition and the predecessor tool. It does not, however, contrast with resolve_error or say when not to use it, so it falls short of full when/when-not guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_runtime_errorsA
ALWAYS CALL THIS TOOL FIRST whenever the user mentions an error, bug, crash, broken component/page, or asks you to fix/debug anything. Returns active OPEN runtime, bundler (Vite/Next.js/Storybook), TypeScript, and browser errors from the current dev session (or last 24h), grouped by signature with exact file:line locations.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of unique errors to return (default 10). | |
| project | No | Optional project directory path if different from the current workspace. | |
| all_sessions | No | Set true to include unresolved errors from older dev server sessions too. | |
| since_minutes | No | Only include errors seen within the last N minutes. | |
| include_resolved | No | Set true to include errors that were already marked resolved. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden, and it does most of that work: it discloses that only active OPEN errors are returned by default, the session/24h time window, the source coverage, and the grouping/location format. It stops short of explicitly declaring the operation is a safe read (no mutation) and says nothing about pagination or rate behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, zero filler, and the imperative call-to-action is front-loaded before the return-value detail. The capitalized ALWAYS is slightly loud but functionally effective for routing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 5-parameter, all-optional, no-annotation tool with no output schema, the description supplies the essential context: trigger conditions, scope, time window, and return grouping. It is nearly complete, missing only an explicit statement that it is a non-mutating read and any note on how limit interacts with grouping.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3, but the description genuinely adds meaning by mapping its wording onto parameters: 'active OPEN' implies include_resolved defaults false, and 'current dev session (or last 24h)' clarifies the all_sessions/since_minutes behavior. That is real added semantics rather than restatement.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a precise verb+resource and goes well beyond a label: it enumerates the error sources covered (runtime, bundler Vite/Next.js/Storybook, TypeScript, browser), the time window (current dev session or last 24h), and the return shape (grouped by signature with file:line). The 'ALWAYS CALL THIS TOOL FIRST' clause also positions it relative to the sibling set (resolve_error, check_fix, get_error_detail) as the entry point.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives an explicit and aggressive trigger list ('error, bug, crash, broken component/page, or asks you to fix/debug anything') and states ordering ('call this first'). What it lacks is any when-not condition or a named alternative for the follow-up case, so an agent must infer that the siblings are used after this call.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve_errorA
Explicitly marks an error_id (or all currently open errors if error_id is omitted) as resolved in .agentsensor/status.json. If the error ever occurs again later, it automatically moves back to open.
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | Optional project directory path if different from the current workspace. | |
| error_id | No | Specific error ID to resolve, or omit to resolve all currently open errors. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It usefully discloses the state file it mutates and the non-obvious behavior that a recurring error auto-reopens, but omits permissions, behavior when the error_id is unknown, and any confirmation/return semantics.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, zero filler, and the core mutation is front-loaded with the auto-reopen caveat following immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter mutation with no output schema, the description covers the action, its target state, and the important reversibility nuance. Only edge cases (unknown error_id, the 'project' parameter) are left unaddressed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both parameters are already documented, including the omit-all behavior. The description restates that behavior without adding format or constraint detail, matching the baseline for high-coverage schemas.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('marks ... as resolved') and resource ('error_id'), plus where the change lands ('.agentsensor/status.json'). It clearly isn't a read tool like the get_* siblings, though it doesn't name the alternatives explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use it (after fixing an error) and clarifies the omit-to-resolve-all case, but gives no explicit when-not guidance or comparison to check_fix, which an agent might reasonably confuse this with.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
check_fix - First observed
get_error_detail - First observed
get_runtime_errors - First observed
resolve_error
TDQS
Scored across 4 tools
The four tools map to distinct stages of the debug loop: listing errors, inspecting one, verifying a fix, and manually resolving. check_fix and resolve_error both mutate error state (open->resolved), which creates slight boundary overlap, but their intent differs (automatic verification vs explicit manual closure).
All names use snake_case with a verb_noun shape (get_runtime_errors, get_error_detail, resolve_error, check_fix). The verb choices vary a bit (get/check/resolve) but stay readable and predictable. Minor deviation in verb style keeps it from a perfect 5.
Four highly focused tools cover a tight detect-inspect-verify-resolve workflow with no redundancy. Each tool clearly earns its place and the scope is well-matched to the purpose.
The surface covers the full lifecycle: discover errors, inspect detail, verify a fix, and mark resolved. Minor gaps exist (no way to list/dismiss already-resolved errors or mute/ignore a known error), but core agent debugging workflows are supported.
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.35 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.9 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