Feedback

Mpesa Daraja MCP Server

@jameskanyiri Claim

Basic information

Runtime
python
Category
License
Not specified
Transports
stdio
Author
jameskanyiri
Submitted by
Community
Quality
10

About Mpesa Daraja MCP Server

# Mpesa Daraja MCP Server

Mpesa Daraja MCP Server is a MCP server in the Other category listed in the AddMCP.net directory, published by jameskanyiri. Supported transport: stdio. Runtime: python. Source code is hosted on github.com.

Setup

{
    "mcpServers": {
        "mpesa_mcp_server": {
            "command": "python",
            "args": [
                "-m",
                "venv",
                "venv"
            ]
        }
    }
}

Mpesa Daraja MCP Server config

Add this server to your MCP-compatible client using the configuration below.

{
    "mcpServers": {
        "mpesa_mcp_server": {
            "command": "python",
            "args": [
                "-m",
                "venv",
                "venv"
            ]
        }
    }
}

Mpesa Daraja MCP Server tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is Mpesa Daraja MCP Server?

A Python-based server that implements the Mpesa Daraja API functionality using FastMCP. It provides a simple interface to interact with Safaricom's Mpesa Daraja API, starting with OAuth access token generation.

How to use Mpesa Daraja MCP Server?

  1. Install Python 3.7+, clone the repository, create and activate a virtual environment, and install dependencies with pip install -r requirements.txt. 2. Create a .env file with your Mpesa Daraja credentials: MPESA_CONSUMER_KEY, MPESA_CONSUMER_SECRET, PASSKEY, BUSINESS_SHORTCODE, and CALLBACK_URL. 3. Start the server by running python server.py. The server then listens for FastMCP client requests.

Key features of Mpesa Daraja MCP Server

  • OAuth token generation for Mpesa Daraja API
  • Secure credential management via environment variables
  • Comprehensive error handling and logging
  • FastMCP-based server implementation

Use cases of Mpesa Daraja MCP Server

  • Authenticating with Safaricom's Mpesa Daraja API for subsequent transactions
  • Automating access token refresh in M-Pesa integrations
  • Building AI-powered M-Pesa applications via the Model Context Protocol

Frequently asked questions

1 What does the Mpesa Daraja MCP Server do?

It generates OAuth access tokens for the Safaricom Mpesa Daraja API, handling authentication so you can make further API calls.

2 What are the prerequisites?

Python 3.7 or higher, Mpesa Daraja API credentials (Consumer Key and Secret), and pip.

3 What environment variables are required?

MPESA_CONSUMER_KEY, MPESA_CONSUMER_SECRET, PASSKEY, BUSINESS_SHORTCODE, and CALLBACK_URL.

4 How does the server communicate?

It uses the FastMCP protocol. You start python server.py and interact via a FastMCP client.

5 Where are credentials stored?

Credentials are read from a .env file in the project root, which is excluded from version control. All API communications use HTTPS.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬