Skip to main content
Glama
vola-trebla

sourcemap-retrace-mcp

by vola-trebla

πŸ—ΊοΈ 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.


Related MCP server: butter-code-health

πŸ› οΈ 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:


License

MIT

Available Tools

7 tools
audit_sourcemap_matchB

Validate that .map files in a dist directory align with their compiled .js counterparts.

ParametersJSON Schema
NameRequiredDescriptionDefault
distDirYesPath to the dist/build directory containing .js and .js.map files

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of disclosing behavior. It states the validation intent but doesn't disclose whether the operation is read-only, what output it produces, or how misalignment is reported. This is a significant gap for a validation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that directly conveys the core purpose. It avoids unnecessary detail and is well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite the tool's relative simplicity, the description lacks key contextual details. It doesn't clarify what 'align' means in practical terms, what happens on failure, or how results are returned. With no output schema and no annotations, users are left without a complete picture of the tool's behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already fully describes distDir as the path to the dist/build directory containing .js and .js.map files. The description adds no additional meaning beyond what the schema provides, so a baseline score of 3 is appropriate given the 100% schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: validating that .map files align with their compiled .js counterparts. It uses a specific verb ('validate') and precise resource ('map files in a dist directory'), which distinguishes it from sibling tools focused on retracing or debug ID integrity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like verify_debug_id_integrity or retrace_stack. It doesn't mention specific scenarios that warrant this validation or exclude cases handled by sibling tools, leaving the agent without decision support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ingest_telemetry_payloadA

Directly ingest Sentry, Bugsnag, or Datadog crash dumps and return fully retraced stack frames.

ParametersJSON Schema
NameRequiredDescriptionDefault
payloadYesThe raw JSON string of the crash telemetry event
inAppOnlyNoOnly return frames marked as part of the application source code
sourcemapDirYesDirectory containing corresponding .map files

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility. It states the core behavior but does not disclose whether data is persisted, what happens on invalid input, or any side effects. This is insufficient for a tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that immediately leads with the action and resource. It is concise, front-loaded, and contains no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema and no annotations, so the description must cover return values and workflow context. It mentions 'fully retraced stack frames' as the return, but lacks details about the processing pipeline, failure modes, or how it fits among siblings. It is minimally complete but not rich.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are already documented. The description adds no extra parameter semantics or context beyond what the schema provides. The baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('ingest'), names concrete resources (Sentry, Bugsnag, Datadog crash dumps), and states the output ('fully retraced stack frames'). This clearly distinguishes it from sibling tools like retrace_stack, which likely operates on already-parsed stacks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for raw crash dumps from specific providers, but provides no explicit when-to-use vs. alternatives, no exclusions, and no mention of sibling tools. The context is clear but not actionable for choosing this over retrace_stack or others.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

normalize_bundler_pathsA

Resolve dynamic bundle references (like webpack://, ng://, or Vite /@fs/ paths) to raw files.

ParametersJSON Schema
NameRequiredDescriptionDefault
rawPathYesThe raw source path reference from the source map
sourceRootNoSource root configuration from the source map
projectRootNoRoot directory of the project

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('resolve...to raw files') but does not mention important behaviors such as failure modes for unresolvable paths, whether the operation is read-only, or any required permissions. This is a significant gap for a tool with no annotation safety net.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that immediately conveys the core purpose and examples, with no redundant or filler content. Every word contributes value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has moderate complexity (3 parameters, no output schema) and the description provides a clear high-level purpose. However, with no annotations, it lacks critical behavioral context (e.g., error handling, when to call it relative to sibling tools) that an agent would need to select and invoke it correctly. The schema fills parameter semantics, but overall guidance remains thin.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

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. The description adds relevant examples of path prefixes that map to rawPath, but it does not explain how sourceRoot and projectRoot interact with resolution beyond what the schema already states. It adds minimal value over the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb ('Resolve') and resource ('dynamic bundle references'), including concrete path examples (webpack://, ng://, Vite /@fs/) and the output ('raw files'). This distinguishes it from sibling tools like retrace_stack, which focus on stack traces rather than path normalization.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for resolving source map path references, reinforced by the schema's rawPath description, but it does not explicitly state when to use this tool versus alternatives like retrieve_code_context or audit_sourcemap_match. No exclusions or alternative tool names are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

retrace_stackA

Decode a minified production stack trace back to original TypeScript source files, lines, and columns.

ParametersJSON Schema
NameRequiredDescriptionDefault
stackTraceYesThe raw minified error stack trace (multi-line string)
sourcemapDirYesDirectory containing .map files (or the dist directory where .js.map files live)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the transparency burden. It conveys a non-mutating decode operation, but doesn't disclose error behavior, prerequisites (e.g., sourcemap existence), or limitations (e.g., only TypeScript). The core behavior is clear, but edge-case behavior is absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence that states exactly what the tool does with no extraneous words. Every part adds value, and the structure is immediately scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with no output schema, the description adequately conveys the return content (original file/line/column) and required inputs. It could mention failure modes (e.g., missing sourcemap) or return format details, but overall it is sufficient for an agent to understand the tool's role.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both required parameters, so the baseline is 3. The tool description doesn't add parameter-level detail beyond the schema; it only hints at the outcome (TypeScript files) rather than explaining how the parameters interact or expected formats.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Decode' with a clear resource ('minified production stack trace') and outcome ('original TypeScript source files, lines, and columns'). It distinctly differentiates from sibling tools that focus on context retrieval, sourcemap auditing, or path normalization.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies the use case: when you have a minified production stack trace and need to map it to original source. However, it does not explicitly mention alternatives or exclusions, so it stops short of full guidance on when not to use or which sibling tool to prefer.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

retrieve_code_contextA

Show the original source code lines surrounding a mapped error location.

ParametersJSON Schema
NameRequiredDescriptionDefault
lineYes1-based line number in the original source
columnNo0-based column number
contextLinesNoNumber of lines to show before and after the target line
originalFileYesAbsolute path to the original TypeScript source file

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. The verb 'Show' indicates a read-only operation, and 'surrounding' clarifies context scope. However, it omits details such as file system prerequisites, handling of invalid paths, or return format, leaving some behavioral ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler. Every word contributes meaning, achieving maximum clarity with minimal length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with fully documented parameters and no output schema, the description sufficiently explains what the tool does and what it returns (source lines). It is complete for the tool's complexity, though not as rich as a 5 would require.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

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. The description adds some context by linking 'mapped error location' to the parameters, but it does not provide additional semantic detail beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Show') and resource ('original source code lines') with a clear scope ('surrounding a mapped error location'). It distinguishes this tool from siblings like retrace_stack (which maps stack traces) and audit_sourcemap_match (which validates sourcemap integrity).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly conveys when to use the tool: when you have a mapped error location and need surrounding source lines. It does not explicitly mention alternatives or exclusions, so it stops short of a 5, but the use case is well implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

surface_async_causalityA

Detect and trace across async boundaries (e.g. await, processTicksAndMicrotasks) to locate scheduling origins.

ParametersJSON Schema
NameRequiredDescriptionDefault
stackTraceYesThe minified stack trace with async boundary markers
sourcemapDirYesDirectory containing corresponding .map files

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full responsibility for behavioral transparency. It discloses the core operation (tracing across async boundaries) but does not disclose expected output format, side effects, prerequisites, or read-only nature. The description is accurate but lacks depth about what happens when the tool is invoked.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, front-loaded with the action and including a concrete example. Every word contributes meaning, with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema and no annotations, so the description must explain what the tool returns or provides. It does not mention return values, result format, or failure conditions. For an async tracing tool, an agent needs to know what the output looks like to interpret it, making this a significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both parameters, so the baseline is 3. The description does not add additional parameter-specific meaning, but it does clarify the domain of the stackTrace and sourcemapDir through the async boundary focus. This is sufficient given the schema already explains each field.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific action verbs 'Detect and trace' with a clear resource ('async boundaries') and a defined goal ('locate scheduling origins'). It distinguishes itself from sibling tools like retrace_stack and retrieve_code_context by focusing on async scheduling behavior rather than general stack retracing or code lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when async boundary tracing is needed, but provides no explicit guidance on when to use it over alternatives. It does not mention exclusions or contrast with sibling tools, leaving the agent to infer applicability from the tool's name and purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

verify_debug_id_integrityB

Validate that a minified production bundle matches its source map using embedded Debug IDs.

ParametersJSON Schema
NameRequiredDescriptionDefault
jsPathYesAbsolute path to the compiled JS file
mapPathYesAbsolute path to the .map file

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must fully disclose behavioral traits. It only states the validation intent without mentioning read-only behavior, error handling, return format, or side effects. The agent is left guessing what 'validate' produces or whether files are modified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that states the tool's core function without unnecessary words. It is well-structured and immediately comprehensible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema and no annotations, yet the description does not explain what the validation result looks like (e.g., boolean, success/failure, exception). The agent lacks essential context to interpret the tool's outcome, making the description incomplete for practical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both parameters (jsPath and mapPath), so the schema already adequately documents their meaning. The description adds no extra parameter-level detail beyond the tool's purpose, which is fine given the coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (Validate) and the specific resource (minified production bundle vs source map) using a distinctive mechanism (embedded Debug IDs). This distinguishes it from sibling tools like audit_sourcemap_match, which may use a different validation approach.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for verifying bundle-map integrity after minification, but provides no explicit when-to-use guidance or mention of alternative tools. It does not state when this tool should be preferred over sibling tools like audit_sourcemap_match.

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. Dates show when Glama detected each change.

  1. 7 tool updatesv0.2.0
    • First observedaudit_sourcemap_match
    • First observedingest_telemetry_payload
    • First observednormalize_bundler_paths
    • First observedretrace_stack
    • First observedretrieve_code_context
    • First observedsurface_async_causality
    • First observedverify_debug_id_integrity

TDQS

A3.7/5.0

Scored across 7 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to analyze code health in TypeScript/JavaScript projects, providing tools to run analysis, start a dashboard, and get summaries.
    22
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables querying a TypeScript codebase's graph for call flows, type relationships, and symbol locations without reading file bodies.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vola-trebla/sourcemap-retrace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server