skills/debug-mcp-stdio/SKILL.md
用于在 VS Code 中对 **Node.js 的 stdio MCP Server** 做断点调试(Attach 到 Node Inspector)。只要用户提到:MCP stdio、@modelcontextprotocol/inspector、node --inspect/--inspect-brk、VS Code attach 调试、断点不命中、sourcemap、调 build/dist 构建产物、端口 9229 冲突/被占用、launch.json 配置等,都要使用本 skill。输出应直接给出可复制粘贴的 launch.json 片段、可运行的 inspector 启动命令(含换端口版本)、以及按优先级排序的排障清单。
npx skillsauth add adjfks/corner-skills debug-mcp-stdioInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
让用户能够在 VS Code 里稳定命中断点,调试通过 stdio 运行的 MCP Server(通常由 npx @modelcontextprotocol/inspector ... 启动),并在遇到端口占用、sourcemap 缺失、断点灰色等问题时有清晰的排查路径。
你已经有构建产物(例如 build/internal/index.js 或 dist/index.js),要对 stdio MCP Server 打断点:
.map 文件).vscode/launch.json 新增一个 attach 配置npx -y @modelcontextprotocol/inspector node --inspect=9229 build/internal/index.js
如果你发现“断点不进 / 断点灰色”,先改成:
npx -y @modelcontextprotocol/inspector node --inspect-brk=9229 build/internal/index.js
--inspect:会在本机开一个“调试口”(默认就是 9229),VS Code 能连进去控制断点/单步。请输出以下 3 块内容(都要可复制粘贴):
【1) VS Code Attach 配置(launch.json 片段)】
<给出一个完整 configuration 对象,提醒用户追加到 configurations 数组里;明确 port/outFiles 需要匹配>
【2) 启动命令(Inspector + Node --inspect)】
- 默认版:<一条命令>
- 稳定版(首行暂停):<一条命令>
- 换端口版(如果 9229 占用):<一条命令>
【3) 排障清单(从最可能到最少见)】
1. ...
2. ...
3. ...
launch.json 的 port == --inspect=PORT 的 PORT。--inspect-brk,避免“启动太快错过断点”。flowchart TD
A[确认入口与输出目录<br/>build/ dist/ 内的 index.js] --> B[确认 sourcemap 已生成<br/>能找到 *.map]
B --> C[追加 launch.json 的 attach 配置<br/>port/outFiles 对齐]
C --> D[VS Code 先启动 Attach<br/>处于 waiting]
D --> E[运行 inspector 命令启动 server<br/>建议用 --inspect-brk]
E --> F{断点命中?}
F -- 是 --> G[开始调试:单步/变量/调用栈]
F -- 否 --> H[按清单排查:端口/路径/outFiles/map/拼写错误]
H --> D
先把“我到底要跑哪个 js 文件”确定下来:
ls -la build dist 2>/dev/null
常见入口:
build/internal/index.js(注意:很多人会写成 internel,这是拼写坑)build/index.jsdist/index.js如果你是 TS 项目,tsconfig.json 里至少要有:
{
"compilerOptions": {
"sourceMap": true,
"inlineSources": true
}
}
核心原则就一句话:构建输出必须带 .map。
sourcemap: truesourcemap: true(或 --sourcemap)output.sourcemap: truedevtool(例如 source-map)outDir 下有 .js.map自检(你应该能看到 .map):
find build dist -maxdepth 4 -name "*.map" -print 2>/dev/null | head
如果找不到任何
.map,先别急着调断点:把 sourcemap 打开并重新构建一次。
.vscode/launch.json 新增 attach 配置(最关键)在 MCP 项目根目录新增/修改 .vscode/launch.json,把下面这段 作为一个新配置加进去(不要覆盖你已有的配置)。
你通常只需要改两处:
port:你准备使用的调试端口(默认 9229)outFiles:你的输出目录到底是 build/ 还是 dist/{
"version": "0.2.0",
"configurations": [
{
"name": "Attach: MCP stdio (Node Inspector)",
"type": "node",
"request": "attach",
"port": 9229,
"protocol": "inspector",
"restart": true,
"timeout": 30000,
"sourceMaps": true,
"smartStep": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"cwd": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/build/**/*.js",
"${workspaceFolder}/dist/**/*.js"
]
}
]
}
Attach: MCP stdio (Node Inspector)此时 VS Code 会进入“等待连接”状态。
npx -y @modelcontextprotocol/inspector node --inspect=9229 build/internal/index.js
--inspect-brk 会让 Node 在第一行就停住,确保 attach 成功后你再继续执行:
npx -y @modelcontextprotocol/inspector node --inspect-brk=9229 build/internal/index.js
pnpm dlx @modelcontextprotocol/inspector node --inspect=9229 build/internal/index.js
yarn dlx @modelcontextprotocol/inspector node --inspect=9229 build/internal/index.js
现象:
检查(macOS / Linux 常用):
lsof -nP -iTCP:9229 -sTCP:LISTEN
处理方式(二选一):
9230
launch.json 的 port 改为 9230--inspect=9230(或 --inspect-brk=9230)优先做这三件事:
--inspect-brk 先稳住:让进程在第一行停住.map 真实存在:输出目录里必须有 *.mapoutFiles 覆盖到了你的输出目录:例如你实际在 build/,就必须包含 ${workspaceFolder}/build/**/*.js额外检查点(看到一个就说明 sourcemap 生效了):
.js 末尾有类似 //# sourceMappingURL=xxx.js.map可能原因:
build/internel/index.js vs build/internal/index.js 这种拼写最常见)先做两个最小动作:
node -p "require('fs').existsSync('build/internal/index.js')"
node --inspect-brk=9229 build/internal/index.js
如果第二条能跑起来,说明问题更可能在 inspector 命令或你传参上。
npx -y @modelcontextprotocol/inspector node --inspect-brk=9229 build/internal/index.js
launch.json 把 port 改成 9230npx -y @modelcontextprotocol/inspector node --inspect-brk=9230 build/internal/index.js
如果你暂时搞不定 sourcemap(或打包太复杂),可以先用“开发态直接跑源码”的方式调试(前提是你的项目允许这么启动)。
例如使用 tsx:
npx -y tsx --inspect-brk=9229 src/index.ts
这条不走 inspector;适合先确认“断点/逻辑/流程”本身没问题,再回头补齐构建产物的 sourcemap 调试链路。
development
启动多智能体代码审查委员会(Code Review Council),对代码任务进行多角色并行分析与交叉审查。 适用于以下场景: - 需要理解一段陌生代码库的结构和调用链 - 排查 bug、性能问题、内存泄漏等疑难问题 - 设计新功能的实现方案,需要评估多个 tradeoff - 选型开源库,需要验证 API 用法、版本兼容性、已知坑 - 重构现有代码,需要评估影响面 当用户说"帮我看看这段代码"、"怎么实现 X"、"用哪个库好"、"这里为什么会有问题", 或者任何涉及代码分析、方案设计、库使用的问题时,都应该激活本 skill。 比单一回答更可靠,因为多个视角会互相纠错。
tools
Research top-performing Xiaohongshu (小红书 / XHS) image posts, analyze titles/content/comments for patterns and emotional resonance, enrich background via Firecrawl MCP, then write and publish an XHS note via Xiaohongshu MCP. Enforce hard limits: title <= 20 characters, body <= 1000 characters. Use when the user asks for 小红书笔记/种草文案/爆款标题/发布到小红书.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------