# Log level for the log file (logs/mcp-whatsapp.log): trace, debug, info, warn, error, fatal LOG_LEVEL=info # WhatsApp driver: webjs (default, browser) or baileys (optional, no browser). # Switching drivers requires a separate Linked Devices pairing; sessions are independent. WHATSAPP_BACKEND=webjs # Baileys credentials, Signal keys, local chat history, and OAuth tokens live here. # Use an absolute path to preserve the same session across working directories. # Default: /baileys-sessions. Only one process may own a session. #BAILEYS_SESSION_DIR=C:\path\to\baileys-sessions # Log level for stderr (visible in most MCP client logs) LOG_STDERR_LEVEL=warn # Show the browser window instead of running headless (OPTIONAL, debugging aid) WHATSAPP_HEADLESS=false # Disable the browser sandbox only when required by your container environment. # The default keeps sandboxing enabled. Applies only to the webjs backend. #WHATSAPP_NO_SANDBOX=true # Path to an ffmpeg binary (OPTIONAL - only needed to override the ffmpeg # binary that is installed automatically via the ffmpeg-static npm package) #FFMPEG_PATH=C:\ffmpeg\bin\ffmpeg.exe # Browser executable (OPTIONAL). Chrome and Edge are auto-detected in their # standard install locations; set this only to use a specific browser. # A real Chrome/Edge is required for sending videos and GIFs, because the # Chromium bundled with puppeteer doesn't support H.264/AAC codecs. # (CHROME_EXECUTABLE_PATH is still accepted as a legacy alias) #BROWSER_EXECUTABLE_PATH=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe # Pin the WhatsApp Web version (OPTIONAL). Only set this if a WhatsApp-side # update breaks the client; see https://github.com/wppconnect-team/wa-version #WA_WEB_VERSION=2.3000.1015010992 # Where the WhatsApp session (browser profile) is stored (OPTIONAL, default: # /whatsapp-sessions). Set this to run multiple instances # side by side or to keep test runs away from your real session. #WHATSAPP_SESSION_DIR=C:\path\to\whatsapp-sessions # Connection health check interval in milliseconds (OPTIONAL, default 60000; <=0 disables) #HEALTH_CHECK_INTERVAL_MS=60000 # How long tool calls wait for the WhatsApp client to become ready before # erroring (OPTIONAL, default 45000). Covers the ~15-20s startup window so # clients that call tools right after spawning the server don't get spurious # "client not ready" errors. #TOOL_READY_TIMEOUT_MS=45000 # Phone number pairing (OPTIONAL). When set (international, symbol-free format), # an 8-character pairing code is logged to stderr on startup instead of relying # on the QR code - visible directly in the MCP client's server logs. Enter it on # the phone: Settings > Linked Devices > Link a device > "Link with phone number # instead". A fresh code is generated every ~3 minutes until pairing succeeds. #WHATSAPP_PAIRING_PHONE_NUMBER=4915112345678 # Streamable HTTP transport (OPTIONAL). When the server runs with the default # stdio transport, setting MCP_HTTP_PORT additionally exposes the MCP endpoint # at http://127.0.0.1:/mcp from the same process. With --http (or # TRANSPORT=http) the server runs HTTP-only on this port (default 3001). #MCP_HTTP_PORT=3001 # Bind address for the HTTP endpoint (default 127.0.0.1; do not expose publicly, # the endpoint controls your personal WhatsApp account) #MCP_HTTP_HOST=127.0.0.1 # OAuth for the HTTP endpoint (OPTIONAL, default off). When enabled, /mcp # requires a bearer token and MCP clients that support OAuth (e.g. FLUJO) # authenticate via a browser page that shows the WhatsApp QR code / pairing # form. Unlinking WhatsApp revokes all tokens, prompting clients to re-run # the flow. Tokens/registrations persist in .oauth-store.json. #MCP_OAUTH=true