23
7

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 サーバが Claude Desktop と繋がらない

Last updated at Posted at 2025-08-13

Claude for Desktop で 自作 MCP サーバ が繋がらないトラブルシューティング

状況

MCP インスペクターでは動作している

image.png

Claude for Desktop では繋がらない

image.png

image.png

 
claude_desktop_config.json の記載

claude_desktop_config.json
{
  "mcpServers": {
    "weather": {
      "command": "dotnet",
      "args": ["run", "--project", "/Users/chomado/Documents/dev/sandbox/weather/weather.csproj", "--no-build"]
    }
  }
}

この ↑ で定義した dotnet コマンドをターミナルで直打ちすると動く

image.png

でも Claude for Desktop では動かない。
なぜ、、、

ツイッターで神降臨

『やさしい MCP 入門』本の著者みのるんさんから
「dotnet をフルパス指定したらどうか」とアドバイスいただき、
その通りにしたら
動きました!!!

* mac の場合 ↓

claude_desktop_config.json
{
  "mcpServers": {
    "weather": {
      "command": "/usr/local/share/dotnet/dotnet",
      "args": ["run", "--project", "/Users/chomado/Documents/dev/sandbox/weather/weather.csproj", "--no-build"]
    }
  }
}

なぜ、、、?

ちゃんとパス通ってるはず(実際ターミナルで dotnet run で動く)なのになあ、なんでだったんだろうなあ。

という疑問に対し

先生 ありがとうございます!!!!

↑ 共有いただいている記事の記載:

ターミナル設定注意点
Macで使っていたとき、最初デフォルトのターミナルと挙動が違って悩んでいた(具体的には、起動しないアプリとかがあった)のですが、原因はObsidianのターミナルが~/.zprofileを読み込んでくれないことでした。
デフォルトのシェルだと、ログインシェルとして~/.zprofile→~/.zshrcと読み込むのですが、Obsidianのターミナルだと非ログインシェルとして~/.zshrcだけ読み込むようです。

なるほどなあ。

今使用してるプロセスの使ってるシェルがログインシェルかどうかっていうの、
こういうときに響くんだな、、、

結論

全部 フルパス指定したら安全

23
7
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
23
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?