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 分