Hi all,

I am trying to connect to Claude Desktop but Claude > Settings > Developer says "mcp-server-drupal failed, Error:server disconnected"

Any ideas please ?

I am using Windows WSL2 / Docker Desktop / DDEV / Ubuntu terminal

I am using Basic Auth at /admin/config/mcp and I am following the example claude_desktop_config.json at https://drupalmcp.io/en/mcp-server/connect-to-llms/

my claude_desktop_config.json =

{
  "mcpServers": {
    "mcp-server-drupal": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DRUPAL_AUTH_USER",
        "-e",
        "DRUPAL_AUTH_PASSWORD",
        "--network=host",
        "ghcr.io/omedia/mcp-server-drupal:latest",
        "--drupal-url=https://d11-test.ddev.site",
        "--unsafe-net"
      ],
      "env": {
        "DRUPAL_AUTH_USER": "admin",
        "DRUPAL_AUTH_PASSWORD": "admin"
      }
    }
  },
  "globalShortcut": ""
}

Claude log files = https://pastebin.com/aHqzPFaE

An ideas please?

error

CommentFileSizeAuthor
#2 claude-error2.jpg310.59 KBjuc1

Comments

juc1 created an issue. See original summary.

juc1’s picture

Issue summary: View changes
StatusFileSize
new310.59 KB
keiserjb’s picture

I've spent all day on this with the same problem. Did you ever find a solution?

gagosha’s picture

Hey,

The issue is that on Windows WSL2, the Docker bridge container runs in a separate network from DDEV, so it can't reach d11-test.ddev.site. Your logs confirm this: "Failed to connect to d11-test.ddev.site port 443."

On Windows, you can use npx to connect to the server instead of Docker.

For example:

{
  "mcpServers": {
    "drupal-mcp": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "mcp-remote",
        "https://d11-test.ddev.site/mcp/post"
      ],
      "env": {
        "DRUPAL_AUTH_USER": "admin",
        "DRUPAL_AUTH_PASSWORD": "admin"
      }
    }
  }
}

I can't check this as I don't have access to a Windows machine, but hopefully it works.

If the npx approach doesn't work, you can also try enabling mirrored networking in WSL2. Add this to C:\Users\\.wslconfig:

[wsl2]
networkingMode = mirrored

Then run wsl --shutdown in PowerShell and restart WSL. This should make your DDEV site accessible from Docker containers.

gagosha’s picture

Status: Active » Closed (works as designed)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

keiserjb’s picture

I will try this and report back, thank you.