srcmap-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SRCMAP_BINARY | No | Path to the srcmap CLI binary. Default: srcmap. | srcmap |
| SRCMAP_TOOLSETS | No | Comma-separated toolsets to enable. Toolset names match the Features categories: `SRCMAP_TOOLSETS=lookup,fetch` enables only the lookup and fetch tools. Default: all. | all |
| SRCMAP_CACHE_TTL | No | Cache TTL in seconds (0 to disable). Default: 300. | 300 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Debug production JavaScript and CSS with source maps. The srcmap CLI must be installed. Start with sourcemap_fetch to download a bundle and its source map from a URL. Then call sourcemap_info, sourcemap_validate or sourcemap_sources to inspect the map. Use sourcemap_lookup and sourcemap_resolve to map positions between generated and original code. Call sourcemap_extract_sources to write the original files to disk. Set SRCMAP_BINARY if the srcmap binary is not on PATH.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| sourcemap_infoA | 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. |
| sourcemap_validateA | Validate that a file is a valid source map. Reports whether the map is valid and its basic structure (sources, names, mappings count). |
| sourcemap_sourcesA | 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. |
| sourcemap_mappingsB | 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. |
| sourcemap_lookupA | 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. |
| sourcemap_resolveA | 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. |
| sourcemap_fetchA | 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. |
| sourcemap_extract_sourcesA | 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. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
The tools are mostly clearly distinct: lookup and resolve are explicit forward/reverse operations, while sources and extract_sources separate listing from writing files. The main overlap is between sourcemap_info and sourcemap_validate, which both report structural metadata, though their primary purposes are still distinguishable.
All tools consistently use the sourcemap_ prefix with snake_case verb/noun naming. The pattern is predictable throughout the set.
Eight tools are well-scoped for a source-map inspection and debugging server. Each tool covers a distinct part of the workflow without unnecessary bloat.
The surface covers the full source-map workflow: fetching, validation, metadata inspection, source listing/extraction, mappings listing, and bidirectional position lookup. No major dead ends are apparent for the stated domain.