Sourcemap Retrace Mcp

io.github.vola-treblaPublished by GitHub account vola-treblav0.2.0Updated Oct 24, 2026

Decodes minified production stack traces back to original TypeScript source using source maps.

VerifiedSTDIODesktop onlyDeveloper ToolsSecurity & Monitoring

Overview

AI-generated overview

Decodes minified production JavaScript stack traces back to original TypeScript source files, lines, and columns using source maps.

What you can do
Provides three tools: retrace_stack maps a minified stack trace to original source locations using .js.map files in a given directory; retrieve_code_context shows the original source lines around a mapped location with line numbers and a column pointer; audit_sourcemap_match checks that .map files exist in a dist directory and point to source files present on disk. It reports mapped and unmapped frames so an assistant can see which parts of a trace were resolved.
When to use it
Useful when an assistant is asked to debug a production error whose stack trace references minified bundles, and the source maps and dist files are available locally. Also helpful before deployment to catch stale or missing source maps.
Requirements
Runs locally over stdio, typically started with npx sourcemap-retrace-mcp, so Node.js and npm are needed. No authentication, environment variables, or headers are declared. It needs local access to the directory containing the .js.map files and, for the audit tool, the dist directory and the source files they reference.
Before you install
The tools read local files from directories the assistant points them at, so only pass paths you are comfortable exposing to the agent. No credentials, payments, or write actions are described; the audit tool only reports on files.

Installation

In SourceWeft

  1. Open Sourcemap Retrace Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

🗺️ sourcemap-retrace-mcp

[npm] [CI] [License: MIT]

Your app crashed in production. The stack trace is useless. Your AI agent has no idea where the bug is.

MCP server that decodes minified production stack traces back to original TypeScript source files, lines, and columns — using source maps. Before your agent spends 20 minutes guessing at obfuscated code.


🤔 The problem

Your monitoring tool sends you this:

TypeError: Cannot read properties of undefined (reading 'userId')    at e.<anonymous> (main.a3f2c1.js:1:47821)    at h (vendor.d4e5f6.js:1:12045)    at processQueue (main.a3f2c1.js:1:89234)

You ask your agent to debug it. The agent reads main.a3f2c1.js. It's 40,000 characters of minified JavaScript. It has no idea what e.<anonymous> at column 47821 means.

sourcemap-retrace-mcp maps that back to:

    at validateSession (src/auth/session.ts:142:8)    at handleRequest (src/api/middleware.ts:67:3)

Now the agent knows exactly where to look.


🛠️ Tools

retrace_stack

Decode a minified stack trace back to original TypeScript source locations. Pass the raw stack trace and the directory containing your .js.map files.

Retrace Results  Frames mapped: 3  |  Unmapped: 1
TypeError: Cannot read properties of undefined (reading 'userId')    at validateSession (src/auth/session.ts:142:8)    at handleRequest (src/api/middleware.ts:67:3)    at processQueue (src/queue/processor.ts:28:12)    at Module._compile (node:internal/modules/cjs/loader:1376:14)

retrieve_code_context

Show the original source lines surrounding a mapped error location — with line numbers and a column pointer.

Code Context  File: src/auth/session.ts  Target: line 142, column 8
  139 │   const session = await getSession(token);  140 │   if (!session) throw new AuthError("invalid token");  141 │> 142 │   return session.userId;        │         ^  143 │ }  144 │  145 │ export async function refreshSession(token: string) {

audit_sourcemap_match

Validate that .map files in your dist directory are present and point to source files that actually exist on disk. Catches stale or missing maps before deployment.

Sourcemap Audit  Directory: dist/  Files checked: 4  OK: 3  |  Missing maps: 0  |  Broken sources: 1
  ✓ main.a3f2c1.js — 47 source(s) mapped  ✓ vendor.d4e5f6.js — 312 source(s) mapped  ✓ worker.b1c2d3.js — 8 source(s) mapped  ⚠ legacy.e7f8a9.js — 2 source(s) not found on disk:      ../src/utils/deprecated.ts      ../src/utils/compat.ts

⚡ Setup

json
{  "mcpServers": {    "sourcemap-retrace": {      "command": "npx",      "args": ["-y", "sourcemap-retrace-mcp"]    }  }}

🚀 Usage

"I have a production error. Here's the stack trace: [paste]. My dist files are in /path/to/dist. Retrace it, show me the code around the error, and tell me what's wrong."

The agent runs retrace_stack, then retrieve_code_context on the mapped location, and can finally read the actual TypeScript that crashed.

Works great alongside:


📦 Links

License

MIT

Source: README.md at commit 9a53d14

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.2.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts