Source Map Debugger

v0.2.1
io.github.BartWaardenburg/srcmap-mcp Checked 6 hours ago Published 4 days ago

Debug production source maps: fetch, inspect, look up and extract original sources

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

sourcemap_info Source Map Info

Show metadata and statistics for a source map file. Returns file name, source count, names, mappings count, lines, content size, and debug ID. Use this to understand what a source map contains before doing lookups.

ParameterTypeDescription
file *stringPath to a source map file (.map)

sourcemap_validate Validate Source Map

Validate that a file is a valid source map. Reports whether the map is valid and its basic structure (sources, names, mappings count).

ParameterTypeDescription
file *stringPath to a source map file (.map)

sourcemap_sources List Sources

List all original source files embedded in a source map. Shows each source path, whether it has embedded content, content size, and if it's on the ignore list. Use this to understand what files a bundle was built from.

ParameterTypeDescription
file *stringPath to a source map file (.map)

sourcemap_mappings List Mappings

List mappings in a source map with pagination. Shows generated and original positions for each mapping. Optionally filter by source file. Use --limit and --offset for pagination.

ParameterTypeDescription
file *stringPath to a source map file (.map)
limitnumberMaximum number of mappings to return (default: 50)
offsetnumberSkip first N mappings (default: 0)
sourcestringFilter by source filename

sourcemap_lookup Lookup Original Position

Find the original source position for a generated (minified) position. Given a line and column in the generated/minified file, returns the original source file, line, column, and optionally the identifier name. Use --context to also get surrounding lines of original source code. All positions are 0-based.

ParameterTypeDescription
column *numberGenerated column number (0-based)
file *stringPath to a source map file (.map)
line *numberGenerated line number (0-based)
contextnumberNumber of context lines to show around the matched position (default: 5)

sourcemap_resolve Resolve Generated Position

Reverse lookup: find the generated (minified) position for an original source position. Given a source file, line, and column, returns the generated line and column. All positions are 0-based.

ParameterTypeDescription
column *numberOriginal column number (0-based)
file *stringPath to a source map file (.map)
line *numberOriginal line number (0-based)
source *stringOriginal source filename (as it appears in the source map)

sourcemap_fetch Fetch Bundle & Source Map

Download a JavaScript or CSS bundle and its source map from a URL. Automatically resolves the sourceMappingURL reference (inline data URIs, external URLs, and conventional .map suffix fallback). Saves both files to the output directory. Use this as the first step when debugging a production website.

ParameterTypeDescription
url *stringURL of the JavaScript or CSS file to fetch
outputDirstringDirectory to save the downloaded files (default: /tmp/srcmap)

sourcemap_extract_sources Extract Original Sources

Extract all embedded original source files from a source map to disk. Writes each sourcesContent entry as a file, preserving the directory structure. Handles webpack://, file://, and relative path prefixes. Use this after fetching a source map to get the full original source tree.

ParameterTypeDescription
file *stringPath to a source map file (.map)
outputDirstringDirectory to extract source files to (default: /tmp/srcmap-sources)