stacktrace-mcp
Parses Node/V8 and browser stack traces: at fn (file:line:col), at async, eval at, [cause] chains, AggregateError [errors] lists and error properties such as code: 'ENOENT'. Minified frames are flagged as unmappable; node_modules frames are marked as library code.
Part of the JVM parser: handles Exception in thread, Caused by:, Suppressed: chains and ... N more elision by reconstructing the elided frames from the enclosing trace, plus module prefixes (java.base/, app//) and logback ~[jar:ver] suffixes, with JDK/framework frames separated from application frames.
Parses .NET stack traces: at Ns.Class.Method() in file:line N, ---> inner exceptions, AggregateException inner exception lists and async state-machine frames, resolving the root cause and the innermost application frame.
Parses Python 3.8–3.13 tracebacks: __cause__/__context__ chains and ExceptionGroup/TaskGroup trees (reduced to a single root cause), ^^^^/~~~~ caret ranges, SyntaxError caret lines, [Previous line repeated N more times] and add_note() lines. Frames are classified as application code vs. site-packages vs. stdlib so the innermost frame that is actually the user's is highlighted.
Parses Rust panics in both the classic and the 1.73+ message layout, and RUST_BACKTRACE short and full forms; std/core frames and cargo registry frames are marked as library so the user's own crate frames stand out.
Part of the JVM parser: handles Caused by:/Suppressed: chains and ... N more elision reconstruction, Native Method frames, module prefixes and framework classes, identifying the root cause and the innermost application frame.
Recognizes Vite dev-server URLs in browser stack traces so bundled frames can be matched back onto files under the configured project directory.
Recognizes [webpack](/mcp/integrations/webpack)-internal URLs produced by bundled front-end stack traces and resolves them against the project checkout where possible; minified frames are flagged and cannot be mapped without a source map.
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., "@stacktrace-mcp What's the root cause of this traceback, and which file of mine is at fault?"
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.
stacktrace-mcp
Paste a crash. Get the root cause, the line of your code that matters, and a hash that tells you whether you have seen it before.
stacktrace-mcp is an MCP server that turns raw crash output (Python, Node/V8, Java/Kotlin, Go, Rust, .NET) into a compact, correct report, and maps it onto the code in your project.
Why another stack trace tool?
Existing MCP servers in this space are either narrow or lossy: a paid hosted "log fingerprint" service (Apify Log Fingerprint & Triage), regex-based log analysers that read three languages (log-analyzer-mcp), or crash-dump tooling tied to WinDbg (mcp-windbg). What this one does differently:
Six hand-written parsers, one model. Python chains and ExceptionGroup trees, Node
[cause]/AggregateError, JavaCaused by:with... N morereconstructed, Go goroutine dumps and race reports, RustRUST_BACKTRACE, .NET inner exceptions. Every trace gets a root cause, not just a first line.Application vs library frames per language (site-packages, node_modules, JDK/framework packages, Go module cache, rustc std, .NET framework), so the innermost frame that is yours is highlighted.
Maps frames onto your checkout even when the trace came from a container (
/app/src/x.pyvs./src/x.py), a Windows box, or a webpack bundle, with strict directory-sandbox protection.Honest about bad input: truncated or garbled traces are parsed as far as possible and flagged PARTIAL with a reason.
Local, free, zero dependencies beyond
mcp, linear-time parsing, and every output is redacted (secrets, emails, IPs, home-directory user names) by default.
Related MCP server: @debugai/mcp
Install
Needs uv. Nothing to clone.
Claude Code
claude mcp add stacktrace -- uvx stacktrace-mcp --dir .Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"stacktrace": {
"command": "uvx",
"args": ["stacktrace-mcp", "--dir", "C:\\path\\to\\your\\project"]
}
}
}--dir is the sandbox for map_to_code and find_traces_in_file (repeat it for several
directories). Without it, the pure-text tools (parse_trace, fingerprint, compare_traces,
explain_exception, redact_trace) still work.
Try asking
"Here is the crash from CI: (paste). What is the root cause and which of my files is responsible?"
"Map this production traceback onto my repo and show me the offending lines."
"Scan
logs/app.logand group every stack trace by fingerprint. Which bug happens most, and when did it first appear?""Are these two tracebacks the same bug?"
"What does
ECONNREFUSEDusually mean, and what do I check first?""Redact this trace so I can paste it into a ticket."
Tools
Tool | What it does |
| Auto-detects the language; returns exception chain with the root cause, frames classified app/library/stdlib/framework/runtime, innermost application frame, fingerprint, PARTIAL notes. |
| Streams a big log (cap 256 MB), finds every trace among normal lines, groups by fingerprint with counts and first/last seen. |
| Stable hash over language + exception types + innermost application frames. Ignores messages, addresses, ids, path prefixes, generated class names and (by default) line numbers. Shows its components. |
| Resolves frames to files under |
| SAME / LIKELY SAME / POSSIBLY related / DIFFERENT with a per-frame diff. |
| About 80 common exceptions: meaning, three most common causes, what to check first. |
| Removes tokens, passwords, JWTs, emails, IPs and home-directory user names. |
All tools except explain_exception take redact (default true).
What it understands
Python: 3.8-3.13 tracebacks including
^^^^/~~~~caret ranges,__cause__/__context__chains,ExceptionGroup/TaskGroupboxes (nested),SyntaxErrorwith caret lines,KeyboardInterrupt,[Previous line repeated N more times],add_note()lines.Node/V8 and browsers:
at fn (file:line:col),at async,eval at,[cause],AggregateError[errors], webpack-internal and Vite URLs, minified frames (flagged), props such ascode: 'ENOENT'.Java/Kotlin/Scala:
Exception in thread,Caused by:,Suppressed:,... 23 more(the elided frames are copied from the enclosing trace),Native Method, module prefixes (java.base/,app//), logback~[jar:ver]suffixes.Go:
panic:(including[recovered]re-panics),fatal error:withruntime stack:, goroutine dumps withcreated by, the race detector'sWARNING: DATA RACE.Rust:
thread 'x' panicked atin the old and the 1.73+ message layout,RUST_BACKTRACEshort and full forms, std/core frames marked, cargo registry frames marked as library..NET:
at Ns.Class.Method() in file:line N,--->inner exceptions,AggregateExceptioninner exception lists, async state-machine frames.
Security
Trace text is untrusted data.
Nothing in a trace is executed, imported or evaluated.
Input is capped at 5,000,000 characters and 4,000 characters per line; every parser is single-pass and linear time. The test suite feeds each parser pathological shapes (a million open parentheses, 100k repeated headers, quadratic-regex bait) with a time limit.
Paths in traces are data.
map_to_codenever opens a path taken from a trace: it indexes the files that actually exist under--dirand matches frames against that index by trailing path components, so../../etc/passwdcan only ever select a file already inside the sandbox. Symlinks are resolved withrealpathbefore every read and refused when they leave the sandbox; symlinked directories are not followed.find_traces_in_fileandmap_to_code(project_dir=...)only accept paths inside--dir.Output is redacted by default. Redaction is pattern based (see
redact_trace); it is a safety net, not a guarantee, so review before publishing. IPv6 coverage is partial (full 8-group,fe80::, and bracketed forms).
Limits
Heuristics decide app vs library: a project vendored into site-packages or node_modules
looks like a library, and a library copied into your tree looks like your code. Minified
JavaScript frames cannot be mapped without a source map. Trace formats evolve; if a real trace
parses wrongly, please open an issue with the (redacted) text.
Development
uv sync --extra test
uv run pytest
uv run ruff check src tests
uv run mypy --strict srcMIT licensed. See also the companion course, stacktrace-mcp-the-hard-way.
Available Tools
7 toolscompare_tracesA
Decide whether two traces share a root cause and list the differences by frame.
Reports SAME / LIKELY SAME / POSSIBLY related / DIFFERENT with the fingerprints, the application frames both have, and the frames only one has (same function at a different line is called out as a code change).
Args: a: First trace text (the first trace in it is used). b: Second trace text. redact: Remove secrets etc. from the output (default true).
Inputs: a (required), b (required), redact. Returns: result
explain_exceptionA
Explain a common exception type: what it means, its three most common causes, what to check first.
Covers about 80 exceptions across Python, Node, Java/Kotlin, Go, Rust and .NET (for example KeyError, ECONNREFUSED, NullPointerException, "concurrent map writes", "unwrap on None", NullReferenceException). Package prefixes are ignored (java.lang.NullPointerException = NullPointerException).
Args: type: Exception name or distinctive message, e.g. "KeyError", "java.lang.OutOfMemoryError", "nil pointer dereference". language: Optional: python, node, java, go, rust or dotnet. Omit to search all.
Inputs: type (required), language. Returns: result
find_traces_in_fileA
Scan a log file for every stack trace and group them by fingerprint.
Streams the file (never loads it whole; caps: 256 MB scanned, 1000 distinct groups) and returns the groups sorted by count with first/last seen timestamps (when the lines have ISO timestamps) or line numbers, the exception, and the innermost application frame. The file must be inside the --dir sandbox (relative paths are relative to the first --dir).
Args: path: Log file path, absolute or relative to the sandbox directory. top: How many groups to list (default 15). redact: Remove secrets etc. from the output (default true).
Inputs: path (required), top, redact. Returns: result
fingerprintA
Compute a stable fingerprint for each trace in the text.
The hash covers the language, the top-level and root-cause exception types and the innermost application frames (function + file base name). Messages, memory addresses, ids, container-vs-local path prefixes, generated names ($$Proxy123) and, by default, line numbers are ignored, so the same bug on another run, host or commit hashes identically while a different bug does not. The components that went into the hash are listed so a changed fingerprint can be explained.
Args: text: One or more traces (max 5,000,000 characters). include_line_numbers: Also hash line numbers (stricter: edits to the file change the hash). redact: Remove secrets etc. from the output (default true).
Inputs: text (required), redact, include_line_numbers. Returns: result
map_to_codeA
Map the application frames of a trace onto files in the project and show the code.
Works when the trace's paths differ from the local ones: container paths (/app/src/x.py vs ./src/x.py), Windows vs POSIX separators, webpack/vite URLs, Java package paths. Frames are matched on their trailing path components against files that actually exist under the sandbox directory. For each frame it reports FOUND / NOT FOUND / ambiguous, whether the line number exists, the offending line with +-context lines, and warns when the source line recorded in the trace differs from the file (the code changed since the crash). Paths in the trace are treated as data: '../' tricks cannot reach outside --dir and symlinks that resolve outside it are refused.
Args: text: The trace (max 5,000,000 characters). project_dir: Directory to search; must be inside --dir. Default: the first --dir. context: Lines of context before/after the offending line (0-10, default 3). max_frames: Maximum application frames to map (default 8). index: Which trace if the text contains several (0-based). redact: Remove secrets etc. from the output, including source lines (default true).
Inputs: text (required), index, redact, context, +2 more. Returns: result
parse_traceA
Parse a pasted stack trace / crash output and explain it.
Auto-detects Python (chained exceptions, ExceptionGroup, SyntaxError), Node/V8 (cause, AggregateError, async frames), Java/Kotlin (Caused by, suppressed, "... N more"), Go (panic, fatal error, goroutine dumps, race reports), Rust (panic + RUST_BACKTRACE) and .NET (inner exceptions). Returns the exception chain with the ROOT CAUSE marked, every frame classified as application vs library/stdlib/framework/runtime, the innermost application frame, and a fingerprint. Truncated or garbled input is parsed as far as possible and flagged PARTIAL with a reason.
Args: text: The raw trace, optionally surrounded by other log lines (max 5,000,000 characters). index: If the text contains several traces, which one (0-based). The report says how many. format: "report" (compact text, default) or "json" (full structure). full: Show every frame instead of collapsing runs of library frames. max_frames: Maximum frames listed for the root cause (default 25). redact: Remove secrets, emails, IPs and home-directory names from the output (default true).
Inputs: text (required), full, index, format, +2 more. Returns: result
redact_traceA
Remove secrets and personal data from a trace or log excerpt, returning the cleaned text.
Removes API keys and tokens (JWT, Bearer, AWS, GitHub, Slack, Stripe, Google, sk-...), password=/token= style values, credentials in URLs, emails, IPv4 and full IPv6 addresses, and user names in home directories (C:\Users\name, /home/name, /Users/name). Safe to run before pasting a trace into a ticket. Every other tool also redacts its output by default.
Args: text: Text to clean (max 5,000,000 characters).
Inputs: text (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool maps to a distinct action in a clear pipeline: parse a trace, fingerprint it, scan a file for traces, map frames to source, compare two traces, explain a named exception type, and redact text. The only near-neighbors (parse_trace vs explain_exception, redact_trace vs the per-tool redact flag) are clearly separated by input type and scope, so misselection is unlikely.
All names are snake_case and almost all follow a verb_noun pattern (parse_trace, compare_traces, map_to_code, redact_trace, find_traces_in_file). The lone outlier is 'fingerprint', which is a bare verb with no object, a minor deviation but still unambiguous.
Seven tools is well within the ideal 3-15 range and each one covers a distinct step in a trace-triage workflow with no filler or redundancy. Nothing feels padded or missing at the count level.
The surface covers the full workflow: parse, stable identity via fingerprint, batch scanning of logs, source mapping, comparison, per-exception guidance, and sanitization. Minor gaps remain, such as no direct way to extract/normalize a single trace out of an arbitrary file path or to persist results, but agents can work around these with parse_trace and find_traces_in_file.
Maintenance
Related MCP Connectors
Production errors your coding agent can read: search, stack traces, releases, resolve, setup.
Production errors and incidents for your agent: stack traces, breadcrumbs, likely causes, triage.
Analytics and debugging for your MCP server — explore usage and sessions, then root-cause errors.
Exception tracking for .NET. Let your AI coding agent search and triage errors and stack traces.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceMCP server that parses stack traces and logs to generate deduplicated issue drafts with severity, repro steps, and owner guesses.-
- AlicenseAqualityBmaintenanceEnables AI agents to debug errors by providing root cause analysis and ranked fixes with code patches. Supports any MCP client.2117 npmMIT
- AlicenseNot gradedqualityCmaintenanceMCP server for enterprise operations, enabling Sentry error triage, Linear issue sync, and Slack incident response with tools for parsing stacktraces, dispatching alerts, and generating postmortems.MIT
- 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.443 npmMIT