@sulagnaaaaa/communication
v1.0.0
Published
MCP Communication tools for email and WhatsApp
Maintainers
Readme
@mcp-utilities/communication
MCP Communication tools for email and WhatsApp messaging.
Features
- Email Communication: Send professional emails via Gmail API with OAuth2 authentication
- WhatsApp Communication: Send WhatsApp messages via WhatsApp Business API
- File Attachments: Support for various file formats in both email and WhatsApp
- HTML Formatting: Rich email content with HTML formatting
- Template Support: WhatsApp template messages with dynamic parameters
Installation
npm install @mcp-utilities/communicationUsage
As a Package
import CommunicationPackage from '@mcp-utilities/communication';
// Initialize with configuration
await CommunicationPackage.initialize({
oauth: {
clientId: 'your_gmail_oauth_client_id',
clientSecret: 'your_gmail_oauth_client_secret',
accessToken: 'your_access_token',
refreshToken: 'your_refresh_token'
},
whatsapp: {
token: 'your_whatsapp_api_token',
url: 'https://graph.facebook.com/v18.0/YOUR_PHONE_NUMBER_ID/messages'
}
});
// Get available tools
const tools = CommunicationPackage.tools;
// Call a tool
const result = await CommunicationPackage.callTool('mail_communication', {
subject: 'Test Email',
content: '<h1>Hello</h1><p>This is a test email.</p>',
recipient: ['[email protected]']
});Available Tools
mail_communication
Send formal emails with HTML content support, CC, and BCC capabilities.
Parameters:
subject(string): Email subject line (max 100 characters)content(string): HTML email content with formatting supportrecipient(array): Main recipient email addressescc(array, optional): Carbon copy recipientsbcc(array, optional): Blind carbon copy recipientsattachment_paths(array, optional): File paths to attachments
whatsapp_communication
Send quick WhatsApp messages to individual recipients.
Parameters:
content(string): Plain text message contentrecipient(string): WhatsApp phone number (E.164 or local format)attachment_path(string, optional): File path to attachment
Configuration
Gmail OAuth Setup
- Go to Google Cloud Console
- Create a new project or select existing
- Enable the Gmail API
- Create OAuth 2.0 credentials (Desktop application)
- Set authorized redirect URIs:
http://localhost:3000/oauth2callback
WhatsApp Business API Setup
- Set up WhatsApp Business API account
- Create a message template named "whatsapp_template"
- Get your phone number ID and access token
Dependencies
@modelcontextprotocol/sdk: MCP protocol supportgoogleapis: Gmail API integrationgoogle-auth-library: OAuth2 authenticationaxios: HTTP client for WhatsApp APIform-data: File upload supportpdfkit: PDF generationmime-types: MIME type detection
License
MIT License
