2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WindowsのClaude CodeでMCPが動かない場合の対処法

Last updated at Posted at 2025-07-13

昨日2025年7月12日にClaude CodeがWindowsでも動作するようになりました。(それ以前はWindowsで利用しようとするとWSL経由で利用する必要がありました)

Claude Codeのインストール方法

npm install -g @anthropic-ai/claude-code

Windowsへの導入と利用がすごく簡単になりました。ただ、今までMacやWSL経由で利用できたMCPが動かない現象に遭遇しましたのでその対処法を記します。どうやらMCPサーバーを起動するためのnpxコマンドが動作しないことが問題のようです。そのうち、公式で対応すると思いますが、現段階でのワークアラウンドになります。Context7のMCPサーバーを例に取り説明します。

Screenshot 2025-07-13 at 21.03.35.png

まずは、Windows版Claude Codeで動作しないMCPの追加方法

claude mcp add -s user context7 -- npx @upstash/context7-mcp@latest

~/.claude.json に下記のJSONが追加されます

"mcpServers": {
    "context7": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@upstash/context7-mcp@latest"
      ],
      "env": {}
    }
}

Windows版Claude Codeで正常に動作するMCPの追加方法

claude mcp add -s user context7 -- cmd /c npx @upstash/context7-mcp@latest

~/.claude.json に追加されるJSONは下記の通り

"mcpServers": {
    "context7": {
        "command": "cmd",
        "args": [
            "/c",
            "npx",
            "@upstash/context7-mcp@latest"
        ]
    }
}

/mcpコマンドで正常に動作することを確認しましょう
Screenshot 2025-07-13 at 21.04.16.png

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?