Traplens

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 7, 2026

Dated, verified API breakages for coding agents: look up traps by provider or by error text.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

本機 MCP 橋接服務,讓程式設計助理查詢第三方 API 有日期、經查證的故障模式,並依錯誤文字比對已知陷阱。

可以做什麼
  • 依服務商查詢陷阱,可用服務面或任務情境縮小範圍,回傳含日期的症狀、原因、修正方式與程式碼範例
  • 貼上錯誤文字搜尋相符的陷阱,比對前會先遮蔽已知的金鑰與權杖格式
  • 故障修好後提交新陷阱,預設為私有,也可提交到共用登錄庫
  • 確認或質疑某個已知陷阱是否仍然成立,可選填損失工時與所見版本
適用情境
適合在助理針對第三方 API、SDK 或 AI 工具撰寫程式碼前,先檢查已知故障;也適合呼叫失敗後,把錯誤文字比對到有紀錄的原因與修正方式。
執行需求
以本機程序方式透過 npx 或 Docker 執行,需要能連線到上游端點的網路。選用環境變數 FOOTGUN_API_KEY 會為上游請求加上 Bearer 權杖,FOOTGUN_MCP_URL 可覆寫端點。提交私有陷阱與確認陷阱需要 Pro、Team 或免費 API 金鑰。
安裝前請注意
此橋接本身不保存陷阱資料,每次工具呼叫(包含你的參數)都會轉送到上游服務。錯誤文字會傳送到上游,但已知金鑰與權杖格式會先被遮蔽。以公開可見性提交陷阱會進入共用登錄庫,確認動作會影響陷阱的可信度分數。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

traplens

traplens gives a coding agent a memory for other people's API breakages. Before writing code against a third-party service, look up that provider and get back up to ten verified, dated failure modes, each with its symptoms, its cause, a fix, a code example, and the date it was last checked. When a call fails instead, paste the error text and search for traps whose symptoms match it. After a failure has been fixed, file a new trap so the next agent does not lose the same hours, and after hitting or avoiding a known trap, confirm whether it is still true.

The bridge keeps no trap data of its own. It serves the upstream Footgun server's tool list locally, exactly as captured from the live endpoint, and forwards each tool call upstream, returning the result untouched.

Tools

  • lookup_traps — traps for a provider. Required: provider (slug or common name, e.g. "stripe"). Optional: surface (part of the service, ranks matches first only), context (one-line task description), and include_stale.
  • search_traps — traps matching error text. Required: error_text (4 to 4000 characters; known key and secret formats are redacted before matching). Optional: provider and include_stale.
  • file_trap — draft a trap after a failure was fixed. Required: provider, surface_type (one of api, sdk, ui, billing, infra, tool), surface_name, title, symptoms, cause, fix, apply, and affected. Optional: sources, tags, and visibility (private by default, public to submit to the shared registry).
  • confirm_trap — record whether a trap is still true. Required: trap_id and still_true. Optional: hours_lost and version_seen.

Configuration

  • FOOTGUN_MCP_URL (optional) — override the upstream endpoint. Defaults to https://getfootgun.com/api/mcp. (The override hook is this rebuild's own labelled reconstruction.)
  • FOOTGUN_API_KEY (optional) — when set, every upstream request carries an Authorization: Bearer <key> header. When it is not set, no key header is sent. (The header name is pinned by the registry record; the Bearer scheme and this forwarding are labelled reconstructions — the original surface was captured keyless.)

Forwarding mechanics

On the first tool call the client opens a streamable HTTP session with the upstream: a JSON-RPC initialize request (protocolVersion 2025-03-26, clientInfo name traplens), then a notifications/initialized notification, then the tools/call request carrying the caller's arguments unchanged. When the upstream answers initialize with an Mcp-Session-Id header, that value rides on every later request of the session, which is reused for the life of the process. Replies may arrive as plain JSON or as server-sent events; both are read.

Successful upstream results pass through verbatim, including any isError flag the upstream sets. Failures — a JSON-RPC error, a non-2xx status, an unreadable response, or a request that cannot be completed — come back as an isError result whose text starts with traplens error: (this rendering is this rebuild's own labelled reconstruction).

CLI

Each tool is also a subcommand taking one JSON argument string:

bash
npx @reneturcios/traplens lookup_traps '{"provider":"stripe"}'npx @reneturcios/traplens search_traps '{"error_text":"No such payment_method"}'npx @reneturcios/traplens confirm_trap '{"trap_id":"fg-0158","still_true":true}'npx @reneturcios/traplens --version

Exit codes: 0 on success, 1 on an isError result, 2 on a usage error.

MCP server

bash
npx -y @reneturcios/traplens mcp

MCP client config:

json
{  "mcpServers": {    "traplens": {      "command": "npx",      "args": ["-y", "@reneturcios/traplens", "mcp"]    }  }}

Docker

bash
docker run -i ghcr.io/cloudcorprecords/traplensdocker run --rm ghcr.io/cloudcorprecords/traplens --version

The container's default command is mcp, so the first form is a stdio MCP server; any other arguments reach the CLI normally.

Development

bash
npm installnpm run buildnpm testnpm run dev

The test suite runs entirely against a stubbed JSON-RPC upstream — no live network calls.

License

MIT — see LICENSE.

來源:README.md,提交 2911b34

工具

4

lookup_traps

Look up traps for a provider

Call before writing code against a third-party API, platform, or AI tool. Returns up to 10 verified, dated failure modes for that provider, each with symptoms, cause, fix, a code example and the date it was last checked. Use search_traps instead when you already have an error message.

輸入參數contextsurfaceprovider必填include_stale

search_traps

Search traps by error text

Call when a call to a third-party service fails or behaves unexpectedly. Paste the error text. Returns up to 5 verified traps whose symptoms match it, closest first, each with cause and fix. Returns nothing when no trap matches closely. Use lookup_traps instead before writing code.

輸入參數providererror_text必填include_stale

file_trap

File a new trap

Draft a trap after a failure was fixed. Private by default with a Pro or Team key. Public filings are checked automatically against official sources and published only when an official source confirms them. A reviewer can still act on any filing. Citing the provider's official documentation or changelog in sources helps. No API key needed. Set visibility to public to submit to the public registry.

輸入參數fix必填tagsapply必填cause必填title必填sourcesaffected必填provider必填symptoms必填visibilitysurface_name必填surface_type必填

confirm_trap

Confirm or dispute a trap

After you hit or avoid a trap returned by lookup_traps or search_traps, record whether it is still true. Confirmations raise a trap's trust score and disputes lower it; several disputes send it back for review. One vote per trap per 30 days. Needs a free API key.

輸入參數trap_id必填hours_loststill_true必填version_seen

版本歷史

1
  1. v0.1.0最新Nov 4, 2026

評分

已滿足適用檢查項的 90%

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

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分