sourcemap-retrace-mcp
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., "@sourcemap-retrace-mcp Retrace this stack trace and show code context: TypeError at main.a3f2c1.js:1:47821"
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.
πΊοΈ sourcemap-retrace-mcp
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.
Related MCP server: TypeScript AST MCP Server
π οΈ 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
{
"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:
env-secret-exposure-analyzer-mcp β scan for secrets before deploying
release-readiness-triage-mcp β CI health check before release
π¦ Links
License
MIT
Available Tools
7 toolsaudit_sourcemap_matchB
Validate that .map files in a dist directory align with their compiled .js counterparts.
Inputs: distDir (required).
ingest_telemetry_payloadA
Directly ingest Sentry, Bugsnag, or Datadog crash dumps and return fully retraced stack frames.
Inputs: payload (required), sourcemapDir (required), inAppOnly.
normalize_bundler_pathsA
Resolve dynamic bundle references (like webpack://, ng://, or Vite /@fs/ paths) to raw files.
Inputs: rawPath (required), sourceRoot, projectRoot.
retrace_stackA
Decode a minified production stack trace back to original TypeScript source files, lines, and columns.
Inputs: stackTrace (required), sourcemapDir (required).
retrieve_code_contextA
Show the original source code lines surrounding a mapped error location.
Inputs: line (required), originalFile (required), column, contextLines.
surface_async_causalityA
Detect and trace across async boundaries (e.g. await, processTicksAndMicrotasks) to locate scheduling origins.
Inputs: stackTrace (required), sourcemapDir (required).
verify_debug_id_integrityB
Validate that a minified production bundle matches its source map using embedded Debug IDs.
Inputs: jsPath (required), mapPath (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 7 tools
Most tools have clearly distinct purposes, but retrace_stack and ingest_telemetry_payload both produce retraced frames, and audit_sourcemap_match and verify_debug_id_integrity both validate sourcemap integrity, which could cause some confusion. However, descriptions clarify the differences well.
All tool names follow a consistent verb_noun pattern with underscores, e.g., retrace_stack, audit_sourcemap_match, surface_async_causality. The verbs are specific and the nouns clearly indicate the target, making the set predictable and readable.
With 7 tools, the server is well-scoped for sourcemap retracing and analysis. Each tool addresses a meaningful aspect of the workflow without excessive overlap or unnecessary bloat.
The tool set covers core retracing, context retrieval, validation, path normalization, telemetry ingestion, and async tracing. Minor gaps such as direct support for sourcemap generation or batch processing are not essential for the stated purpose, so the surface is largely complete.
Maintenance
Related MCP Connectors
Production errors your coding agent can read: search, stack traces, context, trends, resolve.
Ship production-ready TypeScript code in half the time, at half the cost.
Production telemetry for NestJS apps: traces, errors, regressions, jobs and alerts.
Stateless TS/JS compiler facts for agents: references, imports, impact. No repo index or OAuth.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables mapping JavaScript error stack traces back to original source code, extracting context information to help developers locate and fix issues.384 npm2MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible clients to analyze TypeScript code by finding method references, dependency imports, and React component trees.MIT

gn-tracing-mcpofficial
AlicenseNot gradedqualityCmaintenanceEnables coding agents to read a replay link or a gn-tracing-*.zip package, surfacing console errors with source-mapped stacks, failed requests, and the user timeline.GPL 3.0- AlicenseAqualityBmaintenanceEnables AI coding agents to observe real-time Node, Vite, Next.js, Storybook, TypeScript, and browser runtime errors from a wrapped dev server, source-mapped to exact file, line, and column with the log lines preceding each crash. It exposes MCP tools for listing open errors, fetching full stack details, and checking or marking fixes as resolved, all locally with no code changes.428 npmMIT