0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MCPを使おうとしたら動作しなかった(mise利用)

Posted at

解決方法

npx ではなく、 /Users/<username>/.local/share/mise/shims/npx を利用する

エラー内容

/Users/<username>/Library/Logsmcp-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を

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?