Sourcemap Retrace Mcp

io.github.vola-trebla由 GitHub 帳號 vola-trebla 發布v0.2.0更新於 Oct 24, 2026

Decodes minified production stack traces back to original TypeScript source using source maps.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

使用 source map 將壓縮後的正式環境 JavaScript 堆疊追蹤還原為原始 TypeScript 原始碼檔案、行號與欄號。

可以做什麼
提供三個工具:retrace_stack 使用指定目錄中的 .js.map 檔案,把壓縮堆疊追蹤對應回原始原始碼位置;retrieve_code_context 顯示對應位置附近的原始原始碼行,並附上行號與欄指標;audit_sourcemap_match 檢查 dist 目錄中的 .map 檔案是否存在,以及它們指向的原始碼檔案是否仍在磁碟上。它會回報已對應與未對應的框架,讓助理知道追蹤中哪些部分被解析。
適用情境
當助理需要偵錯正式環境錯誤、而堆疊追蹤指向壓縮後的 bundle,且本機有 source map 與 dist 檔案時適用。也可在部署前用來找出過期或缺少的 source map。
執行需求
透過 stdio 在本機執行,通常以 npx sourcemap-retrace-mcp 啟動,因此需要 Node.js 與 npm。未宣告任何驗證、環境變數或標頭。需要本機存取包含 .js.map 檔案的目錄;稽核工具還需要 dist 目錄及其引用的原始碼檔案。
安裝前請注意
這些工具會讀取助理所指目錄中的本機檔案,因此只傳入你願意讓代理存取的路径。未描述任何憑證、付款或寫入動作;稽核工具只回報檔案狀況。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Sourcemap Retrace Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

🗺️ 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.


🛠️ 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

json
{  "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:


📦 Links

License

MIT

來源:README.md,提交 9a53d14

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分