Africa's Talking Airtime MCP
Африканское говорящее эфирное время MCP
Этот проект реализует сервер Model Context Protocol (MCP) для управления транзакциями эфирного времени с использованием Africa's Talking API . Он предоставляет набор инструментов для проверки баланса счета, отправки эфирного времени, просмотра последних транзакций пополнения, суммирования сумм последних пополнений и подсчета пополнений для определенного номера телефона. Приложение использует SQLite для хранения данных транзакций и поддерживает африканские страны, поддерживаемые Africa's Talking Airtime Service, с правильным форматированием телефонных номеров.
Описание
Сервер MCP Africa's Talking Airtime интегрируется с API Africa's Talking Airtime для упрощения передачи эфирного времени. Основные функции включают:
Отправка эфирного времени на указанные номера телефонов.
Хранение сведений о транзакциях в базе данных SQLite.
Извлечение и обобщение истории транзакций.
Проверка баланса счета на Africa's Talking.
Приложение поддерживает страны, в которых поддерживается услуга Africa Talking Airtime.
Related MCP server: mpesa-mcp
Установка
Установка через Smithery
Чтобы автоматически установить Africa's Talking Airtime Server для Claude Desktop через Smithery :
npx -y @smithery/cli install @nasoma/africastalking-airtime-mcp --client claudeПредпосылки
Python 3.10 или выше
curl -LsSf https://astral.sh/uv/install.sh | shЧтобы настроить и запустить проект локально, выполните следующие действия:
Клонируйте репозиторий:
git clone https://github.com/nasoma/africastalking-airtime-mcp.git
cd africastalking-airtime-mcpНастройте виртуальную среду и установите зависимости, выполнив:
uv sync Вы готовы идти!
Использование с инструментами ИИ
С Клодом Десктопом
Добавьте это в ваш claude_desktop_config.json :
{
"mcpServers": {
"Airtime Server": {
"command": "{{PATH_TO_UV}}", // Run `which uv` and place the output here
"args": [
"--directory",
"{{PATH_TO_PROJECT}}", // cd into the repo, run `pwd` and enter the output here
"run",
"main.py"
],
"env": {
"username": "your_africastalking_username",
"api_key": "your_africastalking_api_key",
"country":"your_country", # e.g kenya, uganda, dr congo, rwanda, south africa
"currency_code":"currency-code" # e.g. KES, UGX, NGN
}
}
}
}С гусем
Goose — хороший вариант, если вы хотите использовать предпочитаемую вами LLM и предоставить ключ API.
Установите Goose.
Откройте панель настроек и добавьте пользовательское расширение (MCP Server).
Дайте вашему расширению имя. Тип — STDIO.
Добавьте команду. Сохраните изменения.

Добавьте переменные среды:
username,api_key,currency_codeиcountry.Сохраните изменения.

Описания инструментов
MCP предоставляет следующие инструменты для управления транзакциями эфирного времени:
проверка_баланса :
Описание : Возвращает текущий баланс эфирного времени для вашего аккаунта Africa's Talking.
Использование :
check_balance()Вывод : Возвращает остаток на счете (например, «Остаток на счете: KES 1234.00») или сообщение об ошибке, если остаток не может быть получен.
load_airtime :
Описание : Отправляет эфирное время на указанный номер телефона и сохраняет транзакцию в базе данных.
Параметры :
phone_number: номер телефона получателя (например, «0712345678» или «+254712345678»).amount: количество отправленного эфирного времени (например, 100).currency_code: Код валюты (например, «KES»).
Использование :
load_airtime("0712345678", 100.00, "KES")Вывод : подтверждение успеха (например, «Успешно отправлено 100,00 KES на номер +254712345678») или сообщение об ошибке.
get_last_topups :
Описание : Извлекает последние
Nтранзакций пополнения счета из базы данных.Параметры :
limit: количество транзакций для извлечения (по умолчанию: 3).
Использование :
get_last_topups(3)Вывод : список последних транзакций (например, «Последние 3 транзакции пополнения: ...») или указание на отсутствие транзакций.
сумма_последних_n_пополнений :
Описание : Рассчитывает общую сумму последних
Nуспешных пополнений, гарантируя, что они используют одну и ту же валюту.Параметры :
n: Количество транзакций для суммирования (по умолчанию: 3).
Использование :
sum_last_n_topups(3)Вывод : Возвращает сумму (например, «Сумма последних 3 успешных пополнений: KES 300.00») или ошибку, если валюты различаются.
count_topups_by_number :
Описание : Подсчитывает количество успешных пополнений счета определенного номера телефона.
Параметры :
phone_number: номер телефона для запроса (например, «0712345678»).
Использование :
count_topups_by_number("0712345678")Вывод : Возвращает количество (например, «Количество успешных пополнений счета +254712345678: 5») или ошибку.
Примеры подсказок
Ниже приведены примеры вопросов или команд, которые пользователи могут задать ИИ для взаимодействия с MCP африканского Talking Airtime, на основе доступных инструментов:
Проверить баланс счета
Каков баланс моего счета Africa's Talking?
Можете ли вы показать мне текущий баланс?
Проверьте мой баланс эфирного времени.
Отправить эфирное время
Отправьте 100 KES эфирного времени на номер 0712345678.
Пополните мой счет 0712345678 на 60.
Пополните счет на 50 NGN на номер +2348012345678.
Можете ли вы пополнить счет на 200 UGX на номер 0755123456?
Просмотреть последние пополнения
Покажите мне последние 3 транзакции эфирного времени.
Каковы мои последние пополнения?
Перечислите последние 5 пополнений счета.
Сумма последних пополнений
Какова общая сумма моих последних трех пополнений?
Сложите суммы моих последних 4 транзакций по эфирному времени.
Какую сумму я отправил за последние 5 пополнений?
Подсчет пополнений по номеру телефона
Сколько раз я пополнял счет 0712345678?
Учитывайте пополнения на счете +254712345678.
Скажите, сколько успешных пополнений было совершено на номер 0755123456?
Примечания
Убедитесь, что на вашем счете Africa's Talking достаточно средств для отправки эфирного времени.
Номера телефонов автоматически форматируются на основе переменной
country, установленной в клиенте или вclaude_desktop_config.json.База данных SQLite (
airtime_transactions.db) создается в каталоге проекта при инициализации.Лучше всего работает с моделями, которые поддерживают вызов инструментов, например,
Claude 3.7 Sonnet. Если вы заботитесь о ценеGPT-4.1 Nano— хороший и более дешевый вариант при использовании с такими клиентами, как Goose.
🙏 Кредиты
API говорящей Африки Документация говорящей Африки .
Available Tools
5 toolscheck_balanceA
Checks the airtime balance of the Africa's Talking account.
This tool connects to the Africa's Talking API to fetch the user's
current application data, which includes the account balance.
Returns:
str: A message displaying the account balance or an error if the
balance cannot be retrieved.
Inputs: no named parameters.
count_topups_by_numberA
Counts the number of top-ups for a specific phone number.
Args:
phone_number (str): The phone number to count transactions for.
Returns:
str: The total count of top-ups for the given number or an error message.
Inputs: phone_number (required).
get_last_topupsA
Retrieves the last N top-up transactions from the database.
Args:
limit (int, optional): The number of recent transactions to fetch.
Defaults to 3.
Returns:
str: A formatted string listing the last N transactions or a message
if no transactions are found.
Inputs: limit.
load_airtimeA
Sends airtime to a specified phone number and logs the transaction.
This tool formats the phone number, sends the airtime using the
Africa's Talking API, and saves a record of the transaction in the
database.
Args:
phone_number (str): The recipient's phone number.
amount (float): The amount of airtime to send.
currency_code (str): The currency for the transaction (e.g., "KES").
Returns:
str: A message indicating the status of the airtime transaction.
Inputs: phone_number (required), amount (required), currency_code (required).
sum_last_n_topupsA
Calculates the sum of the last 'n' successful top-ups.
This tool retrieves the last 'n' transactions from the database and
calculates their total sum. It ensures that all transactions are in the
same currency before summing.
Args:
n (int, optional): The number of recent top-ups to sum. Defaults to 3.
Returns:
str: The total sum of the last 'n' top-ups or an error message if
the currencies are mixed or no transactions are found.
Inputs: n.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: check_balance for account status, load_airtime for sending airtime, and three tools (count_topups_by_number, get_last_topups, sum_last_n_topups) for analyzing transaction history from different angles. The descriptions reinforce these distinct roles, making misselection unlikely.
The naming follows a consistent snake_case pattern with clear verb_noun structures (e.g., check_balance, load_airtime). However, there is a minor deviation: 'count_topups_by_number' uses a prepositional phrase instead of a simple noun, slightly breaking the pattern compared to tools like 'get_last_topups' or 'sum_last_n_topups'.
With 5 tools, the count is well-scoped for an airtime management server. It covers core operations (checking balance, sending airtime) and transaction analysis without being overwhelming, ensuring each tool earns its place in the workflow.
The toolset provides good coverage for airtime operations: checking balance, sending airtime, and analyzing transaction history. A minor gap exists in not having tools for managing transaction errors or refunds, but agents can likely work around this with the existing tools for core workflows.
Maintenance
Related MCP Connectors
Read Africa's Talking balance, incoming SMS, transactions; send SMS, airtime, data and voice calls.
Prepaid SMS OTP and transactional SMS API. Eight priced markets: NG, GH, KE, ZA, GB, BJ, CI, US.
Send messages and automate conversations over SMS, MMS, WhatsApp, Viber, IVR, and USSD in 150+ countries. Manage contacts, campaigns, and automated services, analyze message history, and look up channel options and pricing. Organizations can require human approval before sending messages.
Send and schedule SMS and WhatsApp messages, manage contacts and templates, and track delivery.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA unified interface for major African payment providers including M-Pesa, Paystack, and MTN MoMo. It enables users to process payments, request funds, and manage transactions across the continent using natural language commands.19 npmMIT
- AlicenseAqualityBmaintenanceMCP server for East African fintech APIs — trigger M-Pesa STK Push payments, check transaction status, send SMS to 20+ African networks, and top up airtime via Africa's Talking.5213 PyPI6MIT
- FlicenseBqualityCmaintenanceEnables AI agents to interact with the BulkClix platform for SMS, OTP, airtime, mobile money, bank transfers, data bundles, KYC, contacts, and account management via natural language.25-
- AlicenseAqualityCmaintenanceEnables AI assistants to buy airtime and data, check wallet balance, list data plans, and view transactions for Nigerian mobile networks via an Azabill account.622 npmMIT