Daraja MCP
D

Daraja MCP

The Safaricom Daraja MCP Server is a model context protocol service that integrates the M-PESA payment API with Claude, supporting natural language payment processing and real-time transaction notifications.
2.5 points
0

What is the Daraja MCP Server?

The Daraja MCP Server is an intelligent bridge that connects Safaricom's M-PESA payment system with the Claude AI assistant. It allows you to process payments, query transaction status, and manage payment notifications through simple conversational commands, without the need to write code or use complex API interfaces.

How to use the Daraja MCP Server?

After installation and configuration, you can directly send payment instructions in the Claude conversation, such as 'Please send 500 Kenyan Shillings to 0712345678 to pay for order #INV-001'. The server will automatically process the payment request and notify you through Claude after the payment is completed.

Applicable scenarios

Suitable for scenarios where e-commerce merchants, freelancers, small business owners, event organizers, etc. need to conveniently process M-PESA payments. Especially suitable for businesses that want to integrate payment functions into customer service conversations.

Main features

STK Push Payment
Initiate an M-PESA payment request through natural language, and the system will automatically send a payment prompt to the customer's mobile phone.
Real-time Callback Processing
Automatically receive and process M-PESA payment completion notifications, and update the payment status in real-time.
Payment Tracking Management
Store and query payment history records, and support marking of read/unread status.
Natural Language Interface
Interact with the M-PESA system entirely through Claude conversations, without the need for technical knowledge.
Sandbox Testing Environment
Provide a complete testing environment to test all functions without affecting real funds.
Automated Testing Suite
Built-in comprehensive testing tools to ensure the system is stable and reliable.
Advantages
Use M-PESA payment functions without programming knowledge
Real-time payment notifications without manually checking transaction status
Support for a testing environment, allowing for safe learning without risk
Seamless integration with Claude to enhance the customer service experience
Automated payment record management
Limitations
Requires a Daraja API account (need to apply to Safaricom)
Local testing requires tunneling tools such as ngrok
Only supports the M-PESA payment system
The production environment requires an HTTPS server
Requires basic command-line operation knowledge for installation

How to Use

Obtain Daraja API Credentials
Visit the Safaricom developer portal to register an account and create an application, and obtain the Consumer Key, Consumer Secret, and Passkey.
Install and Configure
Clone the repository, create a virtual environment, install dependencies, and configure the environment variable file.
Set Up Claude Desktop
Add the MCP server configuration to the Claude Desktop configuration file, using the absolute path to point to the project directory.
Start the Server
Run the server and verify that all components are working properly.
Start Using
Restart Claude Desktop and start processing payments through conversations.

Usage Examples

E-commerce Order Payment
After the customer confirms the purchase in the chat, automatically send a payment request.
Service Fee Collection
Collect consulting service fees from the customer.
Payment Status Tracking
Check the status of incomplete payment requests.
Payment Record Management
View and manage historical payment records.

Frequently Asked Questions

Do I need programming knowledge to use this server?
Is there a fee for using this service?
Can I test locally without exposing to the Internet?
Is the payment secure?
What mobile phone number formats are supported?
What if the payment fails?
How to switch from the testing environment to the production environment?
Can multiple payment requests be processed simultaneously?

Related Resources

Safaricom Daraja Official Documentation
Complete technical documentation and API reference for the M-PESA Daraja API
GitHub Repository
Project source code, issue tracking, and contribution guidelines
Model Context Protocol Official Website
Official documentation and specifications for the MCP protocol
ngrok Tunneling Tool
HTTPS tunneling tool for local development and testing
Railway Deployment Platform
Recommended server deployment platform that provides free HTTPS
Claude Desktop Download
Download page for the Claude desktop application

Installation

Copy the following command to your Client for configuration
{
  "mcpServers": {
    "daraja": {
      "command": "/absolute/path/to/daraja-mcp/venv/bin/python",
      "args": ["/absolute/path/to/daraja-mcp/server.py"],
      "env": {
        "DARAJA_CONSUMER_KEY": "your_consumer_key",
        "DARAJA_CONSUMER_SECRET": "your_consumer_secret",
        "DARAJA_SHORTCODE": "174379",
        "DARAJA_PASSKEY": "your_passkey",
        "DARAJA_ENV": "sandbox",
        "CALLBACK_PORT": "3000",
        "PUBLIC_URL": "https://your-ngrok-url.ngrok.io"
      }
    }
  }
}
Note: Your key is sensitive information, do not share it with anyone.

Alternatives

F
Finlab Ai
FinLab AI is a quantitative financial analysis platform that helps users discover excess returns (alpha) in investment strategies through AI technology. It provides a rich dataset, backtesting framework, and strategy examples, supporting automated installation and integration into mainstream AI programming assistants.
7.0K
4 points
M
Maverick MCP
MaverickMCP is a personal stock analysis server based on FastMCP 2.0, providing professional level financial data analysis, technical indicator calculation, and investment portfolio optimization tools for MCP clients such as Claude Desktop. It comes pre-set with 520 S&P 500 stock data, supports multiple technical analysis strategies and parallel processing, and can run locally without complex authentication.
Python
10.2K
4 points
C
Contracts Wizard
OpenZeppelin Contracts Wizard is an interactive smart contract building tool that allows users to generate contract code based on OpenZeppelin components by selecting contract types, parameters, and functions. It supports multiple programming languages and provides API and embedding functions.
TypeScript
9.8K
4 points
A
Awesome Web3 MCP Servers
This is a curated list of Web3 Model Context Protocol (MCP) servers, covering multiple categories such as chain interaction, trading, DeFi, market data, tools, and social. MCP is an open protocol that standardizes how applications provide context to LLMs, similar to the USB - C port for AI applications. DeMCP is the first decentralized MCP network, focusing on providing self - developed and open - source MCP services for agents, supporting cryptocurrency payments, and redefining the security and reliability of MCP by combining TEE and blockchain registries.
17.7K
4.5 points
S
Stripe Agent Toolkit
The Stripe Agent Toolkit is a toolkit that supports the integration of multiple AI agent frameworks (such as OpenAI, LangChain, CrewAI, etc.) with the Stripe API. It provides support for Python and TypeScript, simplifying payment-related operations.
TypeScript
16.9K
5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
24.7K
4.3 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
34.6K
5 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
72.6K
4.3 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
20.5K
4.5 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
63.8K
4.5 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
31.5K
5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
21.1K
4.5 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
49.5K
4.8 points
AIBase
Zhiqi Future, Your AI Solution Think Tank
© 2026AIBase