DarajaMCP MCP Server

A Model Context Protocol (MCP) server designed to integrate AI applications with Safaricom's Daraja API, enabling seamless interaction with M-Pesa

Local serverstdioPython

What is the DarajaMCP MCP server?

A Model Context Protocol (MCP) server designed to integrate AI applications with Safaricom's Daraja API, enabling seamless interaction with M-Pesa services. Exposed over MCP by the darajamcp mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

MCP (Model Context Protocol) servers provide capabilities for LLMs to interact with external systems. MCP servers can provide three main types of capabilities:

Its toolset

Everything the assistant can do here goes through one of these:

  • stk_push — Initiate an M-Pesa STK push request to prompt the customer to authorize a payment on their mobile device
  • generate_qr_code — Generate a QR code for a payment request that customers can scan to make payments
  • stk_push_prompt — Generate a prompt for initiating an M-Pesa STK push payment request
  • generate_qr_code_prompt — Generate a prompt for creating an M-Pesa QR code payment request
  • create_source — Create a connector from data source to unstructured server for processing
  • create_destination — Create a connector from unstructured server to destination for data storage
  • create_workflow — Create a workflow to process data from source connector to destination connector
  • run_workflow — The run_workflow tool exposed by this server
  • get_workflow_details — The get_workflow_details tool exposed by this server
  • fetch_documents — The fetch_documents tool exposed by this server
  • Prompts — The Prompts tool exposed by this server
  • create_and_run_workflow_prompt — Generate a prompt to create and run a workflow for document processing

Configuration

  • Python 3.12 - Safaricom Daraja API Credentials (Consumer Key and Secret)

Adding it to your client

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

When to reach for it

Plenty of payments and commerce servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. DarajaMCP's toolset — stk_push, generate_qr_code, stk_push_prompt and 10 more — is a fair guide to whether it matches your workflow. It is maintained by jameskanyiri; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 13 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch DarajaMCP.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the darajamcp mcp server does with a few real requests.

Available tools

ToolWhat it does
stk_pushInitiate an M-Pesa STK push request to prompt the customer to authorize a payment on their mobile device.
generate_qr_codeGenerate a QR code for a payment request that customers can scan to make payments.
stk_push_promptGenerate a prompt for initiating an M-Pesa STK push payment request.
generate_qr_code_promptGenerate a prompt for creating an M-Pesa QR code payment request.
create_sourceCreate a connector from data source to unstructured server for processing.
create_destinationCreate a connector from unstructured server to destination for data storage.
create_workflowCreate a workflow to process data from source connector to destination connector.
run_workflowThe run_workflow tool exposed by this server.
get_workflow_detailsThe get_workflow_details tool exposed by this server.
fetch_documentsThe fetch_documents tool exposed by this server.
PromptsThe Prompts tool exposed by this server.
create_and_run_workflow_promptGenerate a prompt to create and run a workflow for document processing.
ResourcesThe Resources tool exposed by this server.

Configuration

  • Python 3.12 - Safaricom Daraja API Credentials (Consumer Key and Secret)

Example prompts to try

  • Use DarajaMCP to stk push.
  • Use DarajaMCP to generate qr code.
  • Use DarajaMCP to stk push prompt.

Frequently asked questions

It connects DarajaMCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 13 tools (stk_push, generate_qr_code, stk_push_prompt, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with DarajaMCP directly.