Africa's Talking Airtime MCP
アフリカのトーキングエアタイムMCP
このプロジェクトは**、Africa's Talking APIを用いて通話時間取引を管理するためのモデルコンテキストプロトコル(MCP)サーバー**を実装します。アカウント残高の確認、通話時間の送信、最近のトップアップ取引の表示、最近のトップアップ金額の合計、特定の電話番号のトップアップ回数のカウントなど、一連のツールを提供します。このアプリケーションはSQLiteを使用して取引データを保存し、Africa's Talking Airtime Service がサポートするアフリカ諸国の電話番号を適切な形式でサポートします。
説明
Africa's Talking Airtime MCPサーバーは、 Africa's Talking Airtime APIと統合されており、通話時間の転送を容易にします。主な機能は以下のとおりです。
指定された電話番号に通話時間を送信します。
トランザクションの詳細を SQLite データベースに保存します。
取引履歴の取得と要約。
Africa's Talking のアカウント残高を確認します。
このアプリケーションは、アフリカの Talking Airtime サービスがサポートされている国をサポートしています。
Related MCP server: mpesa-mcp
インストール
Smithery経由でインストール
Smithery経由で Claude Desktop に Africa's Talking Airtime Server を自動的にインストールするには:
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 準備完了です!
AIツールと併用する
クロード・デスクトップ
これを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
}
}
}
}ガチョウと
好みの LLM を使用し、API キーを提供する場合は、 Gooseが適切なオプションです。
Goose をインストールします。
設定パネルを開き、カスタム拡張機能 (MCP サーバー) を追加します。
拡張機能に名前を付けます。タイプは STDIO です。
コマンドを追加します。変更を保存します。

環境変数を追加します:
username、api_key、currency_code、country。変更を保存します。

ツールの説明
MCP は、通話時間トランザクションを管理するための次のツールを提供します。
残高確認:
説明: Africa's Talking アカウントの現在の通話時間残高を取得します。
使用法:
check_balance()出力: アカウント残高 (例: 「アカウント残高: KES 1234.00」) を返します。残高を取得できない場合はエラー メッセージを返します。
ロードエアタイム:
説明: 指定された電話番号に通話時間を送信し、トランザクションをデータベースに保存します。
パラメータ:
phone_number: 受信者の電話番号(例:「0712345678」または「+254712345678」)。amount: 送信する通信時間の量 (例: 100)。currency_code: 通貨コード (例: "KES")。
使用方法:
load_airtime("0712345678", 100.00, "KES")出力: 成功を確認します (例: 「KES 100.00 の通話時間を +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」)。通貨が異なる場合はエラーを返します。
カウントトップアップ数:
説明: 特定の電話番号への成功したトップアップの数をカウントします。
パラメータ:
phone_number: 照会する電話番号 (例: 「0712345678」)。
使用方法:
count_topups_by_number("0712345678")出力: カウント (例: 「+254712345678 への成功したトップアップの数: 5」) またはエラーを返します。
プロンプトの例
以下は、利用可能なツールに基づいて、ユーザーが AI に Africa's Talking Airtime MCP と対話するために尋ねることができる質問またはコマンドの例です。
口座残高を確認する
私のAfrica's Talkingアカウントの残高はいくらですか?
現在の残高を見せてもらえますか?
通話時間の残高を確認してください。
エアタイムを送信
100 KES の通話時間を 0712345678 に送信します。
0712345678 に 60 をチャージします。
+2348012345678 に 50 NGN をチャージします。
0755123456に200UGXをチャージできますか?
最近のトップアップを表示
過去 3 件の通話時間取引を表示してください。
最近のトップアップは何ですか?
過去 5 回の通話時間のトップアップを一覧表示します。
最近のトップアップの合計
過去 3 回のトップアップの合計はいくらですか?
過去 4 回の通話時間取引の金額を合計します。
過去 5 回のトップアップでいくら送金しましたか?
電話番号によるトップアップのカウント
0712345678 に何回チャージしましたか?
+254712345678 までのトップアップを数えます。
0755123456 へのトップアップが何回成功したか教えてください。
注記
通話時間を送信するには、Africa's Talking アカウントに資金があることを確認してください。
電話番号は、クライアントまたは
claude_desktop_config.jsonで設定されたcountry変数に基づいて自動的にフォーマットされます。初期化時に、SQLite データベース (
airtime_transactions.db) がプロジェクト ディレクトリに作成されます。ツール呼び出しをサポートするモデル(例:
Claude 3.7 Sonnetに最適です。価格を重視する場合は、Gooseなどのクライアントと併用すると、GPT-4.1 Nano安価で優れた選択肢となります。
🙏 クレジット
Africa's Talking API Africa's Talking ドキュメント。
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.
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 SMS, track delivery, check prices and balance, validate numbers and manage Sender IDs.
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.
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.5209 PyPI7MIT
- 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-
- AlicenseAqualityDmaintenanceEnables AI assistants to buy airtime and data, check wallet balance, list data plans, and view transactions for Nigerian mobile networks via an Azabill account.638 npmMIT