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?

ClineでSSE errorによりMCPサーバーと接続できない問題の解決方法

Last updated at Posted at 2025-05-27

ClineでMCPサーバーが接続できない問題の解決方法

概要

ClineでMCPサーバーを使用しようとした際に「SSE error: TypeError: fetch failed: connect ECONNREFUSED 127.0.0.1:*」エラーが発生する問題と、その解決方法について解説します。

問題の背景

ClineはModel Context Protocol (MCP)を使用して外部ツールと連携します。
WSL下にMCPサーバを作成し、起動が出来た段階で以下のような現象が発生しました。

  • コンソールからのcurlリクエストは成功するが、ClineのGUIからMCPサーバーに接続できない
  • エラーメッセージ: SSE error: TypeError: fetch failed: connect ECONNREFUSED 127.0.0.1:3000

TL;DR

要するにClineはSSE形式が未対応(最新verでは対応済み)なので
stdioで実装しないと動作しません

Cline設定ファイルの更新

mcpサーバをstdio形式で再構築後
ClineのMCP設定ファイルは、VSCodeの拡張機能データディレクトリに保存されるので以下を編集
ここではWSLのVScode Serverで展開しているため以下の場所を見ること。

設定ファイルパス:

~/.vscode-server/data/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

注意: saoudrizwan.claude-devは、ClineのVSCode拡張機能のパッケージ名です(作者名.拡張機能名)。VSCodeの拡張機能は、この形式でデータを保存します。

変更前(HTTP/SSE):

{
  "mcpServers": {
    "hello-mcp-server": {
      "autoApprove": [],
      "disabled": false,
      "timeout": 60,
      "type": "sse",
      "url": "http://localhost:3000",
    }
  }
}

変更後(stdio):

{
  "mcpServers": {
    "hello-mcp-server": {
      "autoApprove": [],
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/dummy-mcp-server/dist/index.js"]
    }
  }
}

まとめ

3.17.11などの古いバージョンを理由があって使っている方は
sse形式を使わないようにしましょう

参考情報


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?