YaVendió Tools 🧰
An MCP-based messaging and notifications system that allows AI systems to interact with various messaging platforms through the Model Context Protocol (MCP). This project implements an MCP server that exposes messaging tools for sending text, images, documents, buttons, and alerts.
Table of Contents
- Features
- What is MCP?
- Installation
- Configuration
- Running with Docker
- Running Locally
- Development
- Project Structure
- MCP Integration
- Testing
- Contributing
- License
Features
- Messaging Capabilities:
- Send text messages via WhatsApp and other platforms
- Send images and media with proper formatting
- Send videos with appropriate metadata
- Send documents with filenames and metadata
- Create interactive buttons for user engagement
- WhatsApp Client Management:
- Register and manage multiple WhatsApp clients with different credentials
- Store tokens securely using Infisical
- Stateless architecture for client management
- Dedicated tools for each WhatsApp operation
- Notification Features:
- Configure alerts across multiple channels (WhatsApp, Email, SMS)
- Support for payment buttons and transaction notifications
- Conversation Management:
- Track message delivery status and metadata
- Additional Utilities:
- Sleep/delay functionality for timed interactions
- Configuration management for companies and users
- Real-time message delivery with status tracking
What is MCP?
The Model Context Protocol (MCP) is an open standard developed by Anthropic that enables seamless integration between AI systems and external data sources or tools. It provides a universal, open standard for connecting AI systems with data sources, replacing fragmented integrations with a single protocol.
This project implements an MCP server that exposes various messaging tools, making them accessible to AI systems in a standardized way. By using MCP, AI assistants can:
- Send WhatsApp messages directly to users
- Upload and send media files
- Create interactive experiences with buttons
- Manage conversation context efficiently
- Trigger multi-channel notifications
Installation
This project uses uv for package management:
Requirements
- Python 3.13 or higher
- Docker and Docker Compose (for containerized deployment)
Configuration
Create a .env
file in the root directory with your configuration:
Running with Docker
Running Locally
Development
The project includes several Makefile commands to streamline development:
Project Structure
app/
: Main application codeserver.py
: The MCP server implementationlogging.py
: Logging configuration with structloglifespan.py
: Application lifecycle management
tools/
: Tool implementationsbase_tool.py
: Abstract base classes for all toolstext_tool.py
: Tool for sending text messagesimage_tool.py
: Tool for sending imagesvideo_tool.py
: Tool for sending videosdocument_tool.py
: Tool for sending documentsbutton_tool.py
: Tool for sending interactive buttonsalert_tool.py
: Tool for sending multi-channel alertssleep_tool.py
: Tool for adding delays in tool execution
services/
: Service implementationsinterfaces.py
: Service interfaces defining contractsmessage_service.py
: Service for message storage and retrievalmessage_service_mock.py
: Mock implementation for testingwhatsapp_service.py
: Service for WhatsApp client managementwhatsapp_service_mock.py
: Mock WhatsApp service for testing
tests/
: Test implementationsapp/
: Tests for application structuretools/
: Tests for individual toolsservices/
: Tests for servicesserver/
: Tests for MCP server integration
MCP Integration
This service can be integrated with LLM applications through the Model Context Protocol:
Available MCP Tools
send_text
Sends a text message to a WhatsApp number.
Parameters:
company_id
: Company identifierphone_number
: Recipient's phone numbermessage
: Text to send
Example:
send_image
Sends one or more images to a WhatsApp number.
Parameters:
company_id
: Company identifierphone_number
: Recipient's phone numberimage_urls
: List of image URLs to send
Example:
send_video
Sends one or more videos to a WhatsApp number.
Parameters:
company_id
: Company identifierphone_number
: Recipient's phone numbervideo_urls
: List of video URLs to send
Example:
send_document
Sends document files to a WhatsApp number.
Parameters:
company_id
: Company identifierphone_number
: Recipient's phone numberfiles
: List of document files as{"url": "...", "filename": "..."}
Example:
send_alert
Sends alerts through multiple channels (WhatsApp, Email, SMS).
Parameters:
company_id
: Company identifierphone_number
: Recipient's phone numbermessage
: Alert messagewhatsapp
: Whether to send WhatsApp messageemail
: Email configuration{"subject": "..."}
sms
: SMS configuration{"type": "...", "recipients": ["..."]}
pause_number
: Whether to pause the conversationtrack_sale
: Whether to track this as a sale
Example:
sleep
Pauses execution for specified seconds.
Parameters:
company_id
: Company identifierphone_number
: Recipient's phone numberseconds
: Number of seconds to sleep
Example:
send_button
Sends interactive buttons.
Parameters:
company_id
: Company identifierphone_number
: Recipient's phone numberbody_text
: Button message bodybuttons
: List of button configs[{"id": "...", "title": "..."}]
button_type
: "reply" or "payment"header
: Optional header configurationfooter_text
: Optional footer textpayment_data
: Payment data for payment buttons
Example (Reply Buttons):
Example (Payment Button):
get_config
Gets company configuration.
Parameters:
company_id
: Company identifier
Example:
update_config
Updates company configuration.
Parameters:
company_id
: Company identifierconfig
: New configuration
Example:
Testing
For detailed information on running and writing tests, see TEST.md.
Basic test commands:
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run tests to ensure they pass (
make test
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
An MCP-based messaging system that allows AI systems to interact with various messaging platforms through standardized tools for sending text, images, documents, buttons, and alerts.