Africa's Talking Airtime MCP is a server implementation that allows you to manage airtime transactions using Africa's Talking API. It provides tools to check account balance, send airtime to phone numbers, view transaction history, and analyze top-up patterns, all while storing transaction data in SQLite for future reference.
For automatic installation with Claude Desktop:
npx -y @smithery/cli install @nasoma/africastalking-airtime-mcp --client claude
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
Add this configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"Airtime Server": {
"command": "{{PATH_TO_UV}}",
"args": [
"--directory",
"{{PATH_TO_PROJECT}}",
"run",
"main.py"
],
"env": {
"username": "your_africastalking_username",
"api_key": "your_africastalking_api_key",
"country":"your_country",
"currency_code":"currency-code"
}
}
}
}
Replace the placeholders:
{{PATH_TO_UV}}
: Output of which uv
command{{PATH_TO_PROJECT}}
: Full path to project directoryyour_country
: e.g., kenya, uganda, dr congo, rwanda, south africacurrency_code
: e.g., KES, UGX, NGNIf you prefer using Goose:
username
, api_key
, currency_code
and country
Retrieves your current Africa's Talking account balance.
check_balance()
Example response: "Account Balance: KES 1234.00"
Sends airtime to a specified phone number and saves the transaction.
load_airtime("0712345678", 100.00, "KES")
Parameters:
phone_number
: Recipient's phone numberamount
: Amount of airtime to sendcurrency_code
: Currency code (e.g., "KES")Example response: "Successfully sent KES 100.00 airtime to +254712345678"
Retrieves the most recent airtime top-up transactions.
get_last_topups(3)
Parameters:
limit
: Number of transactions to retrieve (default: 3)Calculates the total amount of recent successful top-ups.
sum_last_n_topups(3)
Parameters:
n
: Number of transactions to sum (default: 3)Example response: "Sum of last 3 successful top-ups: KES 300.00"
Counts successful top-ups to a specific number.
count_topups_by_number("0712345678")
Parameters:
phone_number
: The phone number to queryExample response: "Number of successful top-ups to +254712345678: 5"
airtime_transactions.db
) is created to store transactionsThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.