Manage airtime transactions seamlessly using Africa's Talking API with tools for balance check, top-ups, and history.
The Africa's Talking Airtime MCP Server is a specialized server designed to integrate with the Africa's Talking API for managing airtime transactions. It offers a comprehensive set of tools tailored for sending airtime, checking balances, viewing transaction history, and summarizing top-up amounts—essential features for managing financial operations in African countries.
This MCP server is equipped to handle multiple functionalities through its core API endpoints:
Balance Checking (check_balance):
Airtime Loading (load_airtime):
Recent Transactions Retrieval (get_last_topups):
Top-Up Summation (sum_last_n_topups):
Frequency Counting by Phone Number (count_topups_by_number):
These features are integrated through the Model Context Protocol (MCP) to ensure seamless communication with various AI clients, making it a versatile addition to any application that requires these services.
The Africa's Talking Airtime MCP Server implements MCP by defining specific endpoints and data formats that compliant clients can use. The protocol ensures that the server can process requests from different applications and return appropriate responses efficiently. The underlying architecture uses SQLite for local storage, enhancing reliability and performance.
# Example check_balance response
{
"status": "success",
"balance": "KES 1234.00"
}
# Example load_airtime response
{
"status": "success",
"message": "Successfully sent KES 100.00 airtime to +254712345678"
}
The server also leverages the uv
framework for synchronization and management of tasks, ensuring that operations are handled with optimal efficiency.
To set up and run the project locally:
Clone the Repository:
git clone https://github.com/nasoma/africastalking-airtime-mcp.git
cd afrastalking-airtime-mcp
Install Dependencies:
uv sync
Run the Application:
python main.py
These steps ensure that all prerequisites are installed and the application is ready for use.
AI applications can invoke check_balance
to retrieve the current balance. This helps in making informed financial decisions by providing real-time account information.
By using load_airtime
, AI applications can automate the process of topping up phone numbers, reducing manual effort and increasing efficiency.
This server is compatible with several MCP clients:
{
"mcpServers": {
"Airtime Server": {
"command": "python",
"args": ["run", "main.py"],
"env": {
"username": "your_africastalking_username",
"api_key": "your_africastalking_api_key",
"country":"your_country",
"currency_code":"currency-code"
}
}
}
}
This configuration ensures that the server can be accessed and leveraged by various AI clients effectively.
Below is a performance matrix detailing the compatibility of the Africa's Talking Airtime MCP Server with different MCP clients:
Client Name | API Key | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ❌ |
Cursor | ❌ | ✅ | ❌ |
export username="your_afrastalking_username"
export api_key="your_africastalking_api_key"
export country="your_country_code"
export currency="currency_code"
These environment variables are essential for secure and proper functioning of the application.
Check transaction logs in the SQLite database (airtime_transactions.db
). Review API responses for error messages. For recurring errors, verify your API credentials.
Yes, it is compatible but consider testing thoroughly as response latency might affect performance significantly.
Use a task scheduler or cloud service to ensure constant availability and reliability of services.
No restrictions are placed on concurrent user access, but implement rate limiting measures as needed for shared instances.
Implement HTTPS communication whenever possible. Regularly audit your environment settings and application configuration to ensure compliance with best practices.
Contributions are welcome! If you encounter bugs or have feature requests, please submit issues or pull requests on GitHub. We encourage developers to contribute code improvements and documentation enhancements.
For more information about the Model Context Protocol (MCP) and additional resources:
By integrating this server into your AI workflows, you can enhance functionality and streamline operations for airtime management across multiple applications.
This comprehensive documentation positions the Africa's Talking Airtime MCP Server as a robust tool for developers building AI-driven financial solutions. It emphasizes the server's capabilities in handling critical transactions with ease, ensuring seamless integration with various MCP clients.
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Integrate AI with GitHub using MCP Server for profiles repos and issue creation
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Explore MCP servers for weather data and DigitalOcean management with easy setup and API tools
SingleStore MCP Server for database querying schema description ER diagram generation SSL support and TypeScript safety
Explore community contributions to MCP including clients, servers, and projects for seamless integration