Skip to main content
Glama
parseen254

daraja-mcp

by parseen254

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DARAJA_MODENoThe mode: simulator, sandbox, or production. Defaults to simulator when no credentials are set.simulator
DARAJA_PASSKEYNoLipa na M-Pesa passkey, for STK push.
DARAJA_SHORTCODENoPayBill or till number.
DARAJA_CONSUMER_KEYNoConsumer key from your Daraja app.
DARAJA_CALLBACK_PORTNoLocal listener port, default 8787.8787
DARAJA_CALLBACK_CIDRSNoOverride allowed source ranges for callbacks.
DARAJA_INITIATOR_NAMENoInitiator name for B2C, B2B, reversals, balance.
DARAJA_CONSUMER_SECRETNoConsumer secret from your Daraja app.
DARAJA_DISABLE_RECEIVERNoSkip the callback listener entirely (e.g., 'true' or 'false').
DARAJA_CALLBACK_PUBLIC_URLNoPublic URL Safaricom can reach.
DARAJA_SECURITY_CREDENTIALNoEncrypted initiator password.
DARAJA_CALLBACK_PATH_SECRETNoUnguessable path segment to protect callbacks.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
stk_pushA

Send an M-Pesa payment prompt (STK push) to a customer. Returns immediately with an acknowledgement; it does NOT confirm payment. Use stk_push_and_wait if you need the outcome.

stk_push_and_waitA

Send an M-Pesa payment prompt and wait for the customer to accept or decline. Returns the settled outcome including the receipt number on success. Use this when you need to know whether the payment actually completed.

stk_queryB

Query the status of a previous STK push using its CheckoutRequestID.

ratiba_createA

Create an M-Pesa Ratiba standing order for recurring collection: subscriptions, loan repayments, insurance premiums, SACCO contributions. The customer approves via an M-Pesa prompt. The standing order name must be unique per customer.

ratiba_create_and_waitA

Create an M-Pesa Ratiba standing order and wait for the customer to approve it. Returns the settled outcome including the reminder schedule id.

generate_qrB

Generate a dynamic M-Pesa QR code for a specific amount and till or paybill.

b2c_paymentA

Pay money out to a customer: refunds, withdrawals, salaries, promotional winnings. Asynchronous; the result arrives on a callback.

b2c_payment_and_waitB

Pay money out to a customer and wait for the result callback, returning the receipt number on success.

b2b_paymentB

Pay another business: a PayBill, a Buy Goods till, or a B2C working account top-up.

tax_remittanceB

Remit tax to the Kenya Revenue Authority using a Payment Registration Number.

business_to_pochiC

Pay a Pochi la Biashara number.

account_balanceB

Query the balance of your M-Pesa business account. Asynchronous; the balance arrives on a callback as a pipe-delimited string per account type.

transaction_statusA

Check the status of any past transaction by receipt number, or by conversation id when the original request timed out. Use this before retrying a payment you are unsure about.

reversalB

Reverse a transaction that was paid into your shortcode.

c2b_register_urlsA

Register the validation and confirmation URLs that Daraja calls when a customer pays your PayBill or till directly. Required once per shortcode before C2B notifications work.

c2b_simulateA

Simulate a customer paying your shortcode. Sandbox and simulator only.

pull_registerA

Register a shortcode for the Pull Transactions API, which lets you fetch missed C2B transactions after an outage.

pull_transactionsA

Fetch C2B transactions for a time window. Useful for reconciliation when callbacks were missed.

check_sim_swapA

Return the date a number was last SIM-swapped. A recent swap is a strong fraud signal; check this before disbursing to an unfamiliar number.

check_age_on_networkA

Return the date a number was first registered on the Safaricom network. Very new lines carry elevated fraud risk.

validate_identityB

Check whether a phone number is registered against a given national ID number.

query_org_infoA

Look up the registered name and tariff of a PayBill or till. Use this to confirm you are paying the business you intend to before sending money.

list_callbacksA

List callbacks this server has received, newest first.

get_callbackA

Fetch the full callback payload for a correlation id.

server_healthA

Report the current mode, which credentials are configured, and callback receiver status. Start here when something is not working.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/parseen254/daraja-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server