Express and Node.js error tracking your coding agent can read

Updated 2026-11-22

The Runheed Node SDK captures uncaught exceptions and unhandled rejections on its own. In Express, one error-handling middleware adds the request method and URL to each error. Your agent then reads them in Claude Code, Cursor or any MCP client.

Set it up

  1. 1.Install the SDK.

    terminalbash
    npm install https://runheed.com/dl/runheed-0.1.7.tgz
  2. 2.Initialize it before your app code and add the handler after your routes.

    server.tstypescript
    import express from 'express';
    import runheed, { expressErrorHandler } from 'runheed';
    
    runheed.init({ dsn: process.env.RUNHEED_DSN!, environment: process.env.NODE_ENV, release: process.env.GIT_SHA });
    
    const app = express();
    // ...your routes
    app.use(expressErrorHandler());
    app.listen(3000);
  3. 3.Connect your agent, then sign in when it asks (other clients: /connect).

    terminalbash
    claude mcp add --transport http runheed https://runheed.com/api/mcp

The npm and PyPI releases are not out yet, so these commands install the same package files straight from runheed.com. Nothing else changes when the registry versions ship.

What it catches

  • Errors thrown in routes and middleware, with method and URL (secret headers redacted)
  • Uncaught exceptions and unhandled promise rejections in the process
  • Errors you report yourself with runheed.captureException(err, { anything: "useful" })

What it does not do

  • Queues catch job errors themselves, so report them from the failure event: BullMQ worker.on('failed', (job, err) => runheed.captureException(err, { queue: job?.queueName, job: job?.name }))
  • No performance tracing: Runheed tracks errors only

Then ask your agent

> which Express routes threw in production today? fix the one with the most events and resolve it with the commit hash

Connect Runheed first: Claude Code, Cursor or another client. Then see how the agent fixes and resolves an error.

Common Node.js and Express errors

Read next for Node.js and Express

7-day trial, then $29/moOther agents and editorsCancel any time from the billing portal