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

Claude DesktopでMCPサーバーエラーへの対処(Windows環境)

Last updated at Posted at 2024-12-01

はじめに

Keitoさんの動画を見ながら、Claude DesktopでMCPデビューを目指しましたが、私のWindows環境だと「Could not attach to MCP server」というエラーに遭遇。その解消方法を紹介します。

困った個所

・Claude desktopのsettingsDeveloperの個所にはbrave-searchが出てくる
・でもチャットで使えないし、トンカチマークみたいな2 MCP tools availableが出てこない

image.png

原因

・私の環境のNode.jsのバージョンがv20.16.0で、指定よりも高かった

  "devDependencies": {
    "@types/node": "^20.10.0"

解決策

Node.jsのバージョンを下げるために必要なnvmをインストール

Node.jsのバージョンをv20.10.0でダウンロード

nvm install 20.10.0

claude_desktop_configのJSONファイルを以下のように修正

{
  "mcpServers": {
    "brave-search": {
      "command": "node",
      "args": [
        "C:\\Users\\[ユーザー名]\\AppData\\Roaming\\npm\\node_modules\\@modelcontextprotocol\\server-brave-search\\dist\\index.js"
      ],
      "env": {
        "BRAVE_API_KEY": "取得したAPIキーを入れる"
      }
    }
  }
}

・Claude desktopを再起動して実行する

おわりに

Dockerを使って、コンテナ環境にMCPサーバを構築するスマートな方法も模索したいです。

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