解決方法
npx
ではなく、 /Users/<username>/.local/share/mise/shims/npx
を利用する
エラー内容
/Users/<username>/Library/Logs
に mcp-server-xxxx.log
にログが下記のようにはかれていた。
これはnpx自体にアクセス出来ない問題だ。 mise を利用している事で、環境変数の設定が行われておらず、この問題となった。
.bashrc, .zshrc などに mise の環境変数を入れてもここは読まれていない状態。
2025-05-26T00:13:36.938Z [playwright2] [info] Initializing server...
2025-05-26T00:13:36.989Z [playwright2] [error] spawn npx ENOENT {"context":"connection","stack":"Error: spawn npx ENOENT\n at ChildProcess._handle.onexit (node:internal/child_process:285:19)\n at onErrorNT (node:internal/child_process:483:16)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)"}
2025-05-26T00:13:36.990Z [playwright2] [error] spawn npx ENOENT {"stack":"Error: spawn npx ENOENT\n at ChildProcess._handle.onexit (node:internal/child_process:285:19)\n at onErrorNT (node:internal/child_process:483:16)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)"}
2025-05-26T00:13:36.992Z [playwright2] [info] Server transport closed
2025-05-26T00:13:36.992Z [playwright2] [info] Client transport closed
2025-05-26T00:13:36.993Z [playwright2] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. `console.error('...')` in JavaScript, `print('...', file=sys.stderr)` in python) and it will appear in this log.
2025-05-26T00:13:36.993Z [playwright2] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
良きMCPLifeを