Skip to content

mcp-websocket-empty-url

MCP WebSocket transport URL cannot be empty

Error

Rule Details

This rule checks that MCP servers configured with type "websocket" include a url field that is present and non-empty. A missing or blank URL means Claude Code cannot establish a WebSocket connection to the MCP server, resulting in connection failures at runtime.

Incorrect

WebSocket server with an empty URL string

json
{
  "mcpServers": {
    "realtime": {
      "type": "websocket",
      "url": ""
    }
  }
}

WebSocket server with the url field missing

json
{
  "mcpServers": {
    "realtime": {
      "type": "websocket"
    }
  }
}

Correct

WebSocket server with a valid URL

json
{
  "mcpServers": {
    "realtime": {
      "type": "websocket",
      "url": "wss://mcp.example.com/ws"
    }
  }
}

How To Fix

Add a non-empty url field to the WebSocket server configuration. The URL should use the ws:// or wss:// protocol scheme.

Options

This rule does not have any configuration options.

Resources

Version

Available since: v0.2.0