R

Relay Whatsapp MCP

by viaanshetty3-debug · io.github.viaanshetty3-debug/relay-whatsapp-mcp

Links your own WhatsApp account as a linked device on a computer you control and exposes it to Claude and ChatGPT over MCP, so assistants can search and read chat history, analyze attachments such as voice notes and PDFs, and send or manage messages only when explicitly asked. It runs self-hosted on macOS, Linux or Windows with an optional encrypted Cloudflare relay and a standby bridge for automatic, no-duplicate failover.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-viaanshetty3-debug-relay-whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "relay-whatsapp-mcp"
      ],
      "env": {
        "RELAY_HOME": "<VALUE>",
        "BRIDGE_URL": "<VALUE>",
        "HOST": "127.0.0.1",
        "PORT": "8787",
        "DATA_DIR": "./data",
        "READ_ONLY": "false",
        "PUBLIC_URL": "local",
        "AUTO_CONNECT": "true with npm run service",
        "BRIDGE_TOKEN": "generated",
        "ALLOWED_CHATS": "all chats",
        "RELAY_AGENT_ID": "generated",
        "RELAY_SITE_KEY": "none",
        "RELAY_WATCH_MS": "750",
        "RELAY_AGENT_KEY": "generated",
        "RELAY_DEVICE_ID": "generated",
        "RELAY_REMOTE_URL": "none",
        "RELAY_FAILOVER_ROLE": "primary"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-viaanshetty3-debug-relay-whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "relay-whatsapp-mcp"
      ],
      "env": {
        "RELAY_HOME": "<VALUE>",
        "BRIDGE_URL": "<VALUE>",
        "HOST": "127.0.0.1",
        "PORT": "8787",
        "DATA_DIR": "./data",
        "READ_ONLY": "false",
        "PUBLIC_URL": "local",
        "AUTO_CONNECT": "true with npm run service",
        "BRIDGE_TOKEN": "generated",
        "ALLOWED_CHATS": "all chats",
        "RELAY_AGENT_ID": "generated",
        "RELAY_SITE_KEY": "none",
        "RELAY_WATCH_MS": "750",
        "RELAY_AGENT_KEY": "generated",
        "RELAY_DEVICE_ID": "generated",
        "RELAY_REMOTE_URL": "none",
        "RELAY_FAILOVER_ROLE": "primary"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-viaanshetty3-debug-relay-whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "relay-whatsapp-mcp"
      ],
      "env": {
        "RELAY_HOME": "<VALUE>",
        "BRIDGE_URL": "<VALUE>",
        "HOST": "127.0.0.1",
        "PORT": "8787",
        "DATA_DIR": "./data",
        "READ_ONLY": "false",
        "PUBLIC_URL": "local",
        "AUTO_CONNECT": "true with npm run service",
        "BRIDGE_TOKEN": "generated",
        "ALLOWED_CHATS": "all chats",
        "RELAY_AGENT_ID": "generated",
        "RELAY_SITE_KEY": "none",
        "RELAY_WATCH_MS": "750",
        "RELAY_AGENT_KEY": "generated",
        "RELAY_DEVICE_ID": "generated",
        "RELAY_REMOTE_URL": "none",
        "RELAY_FAILOVER_ROLE": "primary"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-viaanshetty3-debug-relay-whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "relay-whatsapp-mcp"
      ],
      "env": {
        "RELAY_HOME": "<VALUE>",
        "BRIDGE_URL": "<VALUE>",
        "HOST": "127.0.0.1",
        "PORT": "8787",
        "DATA_DIR": "./data",
        "READ_ONLY": "false",
        "PUBLIC_URL": "local",
        "AUTO_CONNECT": "true with npm run service",
        "BRIDGE_TOKEN": "generated",
        "ALLOWED_CHATS": "all chats",
        "RELAY_AGENT_ID": "generated",
        "RELAY_SITE_KEY": "none",
        "RELAY_WATCH_MS": "750",
        "RELAY_AGENT_KEY": "generated",
        "RELAY_DEVICE_ID": "generated",
        "RELAY_REMOTE_URL": "none",
        "RELAY_FAILOVER_ROLE": "primary"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-viaanshetty3-debug-relay-whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "relay-whatsapp-mcp"
      ],
      "env": {
        "RELAY_HOME": "<VALUE>",
        "BRIDGE_URL": "<VALUE>",
        "HOST": "127.0.0.1",
        "PORT": "8787",
        "DATA_DIR": "./data",
        "READ_ONLY": "false",
        "PUBLIC_URL": "local",
        "AUTO_CONNECT": "true with npm run service",
        "BRIDGE_TOKEN": "generated",
        "ALLOWED_CHATS": "all chats",
        "RELAY_AGENT_ID": "generated",
        "RELAY_SITE_KEY": "none",
        "RELAY_WATCH_MS": "750",
        "RELAY_AGENT_KEY": "generated",
        "RELAY_DEVICE_ID": "generated",
        "RELAY_REMOTE_URL": "none",
        "RELAY_FAILOVER_ROLE": "primary"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-viaanshetty3-debug-relay-whatsapp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "relay-whatsapp-mcp"
      ],
      "env": {
        "RELAY_HOME": "<VALUE>",
        "BRIDGE_URL": "<VALUE>",
        "HOST": "127.0.0.1",
        "PORT": "8787",
        "DATA_DIR": "./data",
        "READ_ONLY": "false",
        "PUBLIC_URL": "local",
        "AUTO_CONNECT": "true with npm run service",
        "BRIDGE_TOKEN": "generated",
        "ALLOWED_CHATS": "all chats",
        "RELAY_AGENT_ID": "generated",
        "RELAY_SITE_KEY": "none",
        "RELAY_WATCH_MS": "750",
        "RELAY_AGENT_KEY": "generated",
        "RELAY_DEVICE_ID": "generated",
        "RELAY_REMOTE_URL": "none",
        "RELAY_FAILOVER_ROLE": "primary"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
RELAY_HOME No Folder with Relay's .env and WhatsApp session (default: ~/.relay-whatsapp-mcp). Run `npx relay-whatsapp-mcp setup` and `start` first.
BRIDGE_URL No Address of the running Relay bridge (default: http://127.0.0.1:8787)
HOST No Where the local bridge listens Default: 127.0.0.1
PORT No Where the local bridge listens Default: 8787
DATA_DIR No WhatsApp credentials, SQLite history, media cache Default: ./data
READ_ONLY No Block every outgoing action, draft change and schedule Default: false
PUBLIC_URL No Public HTTPS origin if you expose the bridge directly (enables OAuth) Default: local
AUTO_CONNECT No Reconnect a saved WhatsApp session on start Default: true with npm run service
BRIDGE_TOKEN No Owner token for the dashboard and local MCP (≥ 32 characters) Default: generated
ALLOWED_CHATS No Comma-separated chat JIDs the AI may access Default: all chats
RELAY_AGENT_ID No Shared by your devices; the key also encrypts the relay queue Default: generated
RELAY_SITE_KEY No Optional bearer credential if your relay sits behind an extra access layer Default: none
RELAY_WATCH_MS No Standby only: how often to check the primary (`3000` for the free tier) Default: 750
RELAY_AGENT_KEY No Shared by your devices; the key also encrypts the relay queue Default: generated
RELAY_DEVICE_ID No Unique per device; used for failover and read handoff Default: generated
RELAY_REMOTE_URL No Your relay's HTTPS origin (leave unset for local-only) Default: none
RELAY_FAILOVER_ROLE No Set `standby` on a second device Default: primary

Similar servers