Changelog
[0.4.0] - 2026-04-05
Removed
migrate_duplicate_chatstool — Temporary migration tool removed. Contact mappings are now created automatically when sending/receiving messages, making the manual migration tool unnecessary. Existing duplicate contacts from before the migration can remain, but all new messages will create correct mappings automatically.
All notable changes to WhatsApp MCP Docker will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.3.1] - 2026-04-04
JID Unification - Duplicate Chat Contacts Fixed
Implemented a contact mapping system to unify duplicate chat entries caused by WhatsApp’s different JID formats (@lid vs @s.whatsapp.net).
Added
- Contact mappings table — SQLite
contact_mappingstable to store JID relationships - JID utilities —
src/utils/jid-utils.tswith helper functions for JID detection and normalization - Automatic mapping — Mappings created automatically when sending/receiving messages
- Unified chat listing —
getAllChatsUnified()method merges duplicate entries - Migration tool —
migrate_duplicate_chatsadmin tool for backfilling existing duplicates - Integration tests — 20+ test cases for JID unification
Changed
list_chatstool — Now uses unified chat listing, shows both JID formats for referencesrc/whatsapp/client.ts— Stores contact mappings on message send/receivesrc/whatsapp/store.ts— Added mapping CRUD operations and migration method
Fixed
- Duplicate contacts — Same contact no longer appears twice in chat list
- Fragmented conversations — Messages from both JID formats now appear in single chat
- Unread count accuracy — Combined from duplicate entries
Technical Details
- Prefers
@lidformat for display (more stable, privacy-focused) - Backward compatible — existing tools continue to work
- Automatic mapping — works transparently during normal message exchange
- Migration available — run
/migrate_duplicate_chatsto fix historical duplicates
Files Modified
src/whatsapp/store.ts- Schema + mapping methodssrc/utils/jid-utils.ts- NEW - JID utilitiessrc/whatsapp/client.ts- Automatic mappingsrc/tools/chats.ts- Unified listing + migration tooltest/integration/jid-unification.test.ts- NEW - Tests
Test Results
✅ All 125 tests passed (including 20+ new JID unification tests)
[0.3.0] - 2026-04-03
TypeScript Migration Complete
The entire codebase has been migrated from JavaScript to TypeScript, providing full type safety and improved developer experience.
Added
- TypeScript configuration —
tsconfig.jsonwith strict type checking,NodeNextmodule resolution - Type declarations —
src/env.d.tsfor environment variables, ambient types for MCP SDK and whatsmeow-node - Build pipeline — TypeScript compilation in Dockerfile,
dist/output directory - Development workflow —
tsx --watchfor local development,tsc --noEmitfor CI type checking
Changed
- All source files — 26
.jsfiles insrc/converted to.tswith full type annotations - All test files — 16
.jstest files converted to.ts - Tool registration API — Migrated from
server.tool()(MCP SDK v1) toserver.registerTool()(current API) - ESLint — Migrated from ESLint 8 (
.eslintrc.json) to ESLint 9 (flat config,eslint.config.js)
Build & Runtime Changes
- Entry point — Changed from
src/index.jstodist/index.js(compiled output) - Dev runtime — Changed from
node --watch src/index.jstotsx --watch src/index.ts - Type safety — All tool inputs validated via Zod schemas with inferred TypeScript types
- No runtime behavior changes — All functionality remains identical; only type annotations added
Migration Statistics
| Metric | Count | |——–|——-| | Source files converted | 26 | | Test files converted | 16 | | Total lines of TypeScript | ~3,500 | | Type errors fixed | 0 (clean build) | | Tests passing | 100% |
Files Modified
src/**/*.ts— All source files convertedtest/**/*.ts— All test files convertedtsconfig.json— New TypeScript configurationtsconfig.test.json— Test-specific TypeScript configurationDockerfile— Updated for TypeScript build pipelinepackage.json— Added TypeScript,tsx, updated scriptseslint.config.js— New ESLint 9 flat config
Backward Compatibility
- No breaking changes for end users — all tools work identically
- No API changes — MCP tool signatures unchanged
- No data migration required — database schema unchanged
[Unreleased] - 2026-04-01
Added
Authentication & Session Management
disconnecttool - New tool to log out and disconnect from WhatsApp, clearing the session and requiring re-authentication- Use case: Users can unlink their device when they’ve unlinked their WhatsApp mobile app
- Use case: Switch to a different WhatsApp account
- Returns clear status messages about disconnection success/failure
- Audit logged for security tracking
AUTO_CONNECT_ON_STARTUPenvironment variable - Control automatic WhatsApp connection on container startup- Default:
true(backward compatible with existing deployments) - Set to
"false"to disable auto-connect (useful for testing, manual auth control) - Helps prevent unwanted connection attempts in test environments
- Documented in
docker-compose.ymlwith usage examples
- Default:
Enhanced Connection Status
- Improved
get_connection_statustool output - Clearer authentication state reporting- Shows three distinct states:
- ✅ Connected & Authenticated (ready to use)
- ⚠️ Session exists but disconnected (connection lost, needs re-auth)
- ❌ Not authenticated (no session, needs initial auth)
- Displays session JID when available for better debugging
- Shows uptime when connected
- Better error messaging for reconnection scenarios
- Shows three distinct states:
Startup Diagnostics
- Enhanced startup logging - Clear authentication state reporting on container start
- Logs auto-connect configuration (YES/NO)
- Reports current authentication state with JID if connected
- Audit log includes auth state for troubleshooting
- Helps users immediately understand container state
Changed
Documentation
docker-compose.yml- Added comprehensive comments for new configuration optionsAUTO_CONNECT_ON_STARTUPdocumented with use cases- Clear examples for testing scenarios
Technical Details
Modified Files
src/index.js- Enhanced startup diagnostics and auto-connect logicsrc/tools/auth.js- Addeddisconnecttool registrationsrc/tools/status.js- Enhanced connection status reporting with three-state auth detectiondocker-compose.yml- AddedAUTO_CONNECT_ON_STARTUPconfiguration option
Testing Implications
- Unit tests needed:
disconnecttool with active sessiondisconnecttool with no session (idempotent behavior)disconnecttool when disabled via permissionsget_connection_statusthree-state reporting- Auto-connect startup behavior (enabled vs disabled)
- Integration tests needed:
- Full auth → disconnect → re-auth flow
- Container startup with
AUTO_CONNECT_ON_STARTUP=false - Session persistence across container restarts
- Manual auth trigger when auto-connect disabled
- E2E tests needed:
- User workflow: start container → authenticate → use → disconnect → re-authenticate
- Test environment setup with auto-connect disabled
Migration Notes
For Existing Users
- No breaking changes - All changes are backward compatible
- Default behavior unchanged (auto-connect enabled)
- Existing sessions persist across updates
- New
disconnecttool is optional
For Test Environments
- Set
AUTO_CONNECT_ON_STARTUP=falseto prevent automatic connection attempts - Call
authenticatetool explicitly when ready to test - Use
disconnecttool to clean up test sessions - Check connection state with enhanced
get_connection_status
Security Considerations
disconnecttool is subject to permission checks (can be disabled viaDISABLED_TOOLS)- All disconnect actions are audit logged
- Session cleanup removes authentication tokens securely
- No sensitive data exposed in status messages
[0.1.1] - 2026-03-31
Previous Release
- Initial MCP server implementation
- 13 tools: authenticate, get_connection_status, send_message, send_file, download_media, list_chats, list_messages, search_messages, search_contacts, catch_up, mark_messages_read, request_approval, check_approvals
- QR code and pairing code authentication
- SQLite message store with encryption
- Audit logging
- Rate limiting and permissions
[Unreleased — Groups, Reactions, Contacts, Wait] - 2026-04-02
Added
Group Management (9 new tools)
create_group— Create a new WhatsApp group with specified participantsget_group_info— Fetch name, description, participant list, and admin status for a groupget_joined_groups— List all groups this account is a member ofget_group_invite_link— Retrieve the invite link for a group (requires admin)join_group— Join a group via invite link or invite codeleave_group— Leave a group permanentlyupdate_group_participants— Add, remove, promote, or demote participants (requires admin)set_group_name— Rename a group (requires admin)set_group_topic— Set or clear the group description (requires admin)
Message Actions (4 new tools)
send_reaction— React to any message with an emoji; empty string removes the reactionedit_message— Edit a previously sent message (own messages, ≤15 min window)delete_message— Revoke a sent message for everyone in the chatcreate_poll— Send a poll with 2–12 options; optionally allow multiple selections
Contact & User Info (3 new tools)
get_user_info— Fetch display name, status, and business details for up to 20 phone numbersis_on_whatsapp— Check whether up to 50 phone numbers have WhatsApp accountsget_profile_picture— Retrieve the CDN URL for a contact or group profile picture
Workflow (1 new tool)
wait_for_message— Block until an incoming message arrives (optional chat/sender filter), returning full message metadata; useful for interactive AI workflows
Chats (1 new tool)
export_chat_data— Export up to 10,000 messages as JSON or RFC 4180-compliant CSV for PIPEDA/Law 25 compliance
Summary
Total tool count: 32 (was 13 in v0.1.1, 14 after disconnect was added)
Implementation Checklist
✅ Completed (2026-04-01)
- Add
disconnecttool to auth.js - Enhance
get_connection_statuswith three-state auth detection - Add
AUTO_CONNECT_ON_STARTUPenv variable support - Enhanced startup diagnostics logging
- Update docker-compose.yml documentation
- Build and test container
- Create CHANGELOG.md
🔄 In Progress
- User-facing documentation updates
- Test suite updates
⏳ TODO
- Unit tests for
disconnecttool - Unit tests for enhanced status reporting
- Integration tests for auth lifecycle
- Update README.md with new features
- Add examples to documentation
- Update API documentation
Future Enhancements (Under Consideration)
Authentication Flow Improvements
- Session timeout configuration
- Automatic session refresh before expiration
- Multi-device support tracking
- Authentication webhook notifications
Developer Experience
- Interactive authentication status dashboard
- Real-time connection state notifications
- Enhanced debugging mode with verbose logging
- Container health check improvements
Security & Compliance
- Session audit trail export
- Compliance reporting for message retention
- Access control lists for specific contacts/groups
- Two-factor authentication support
Contributors: Benjamin Alloul Date Created: 2026-04-01 Last Updated: 2026-04-01