LOOP Developer Agent
Provides tools for integrating with LOOP financial services, enabling payment initiation (M-Pesa STK Push, LOOP Prompt), transaction status and history lookup, money transfers, and reconciliation via the LOOP sandbox API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LOOP Developer AgentAdd LOOP payments to my Django project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LOOP Developer Agent
AI-powered developer platform for building on LOOP financial infrastructure. Built for the LOOP Hackathon — Sandbox environment.
What is this?
LOOP Developer Agent is an MCP-compliant AI platform that:
Inspects your project — detects framework (Django, FastAPI, Flask, Next.js, Express), package manager, and existing payment integrations.
Generates integration code — produces production-ready LOOP payment code tailored to your stack.
Runs sandbox tests — validates signing, authentication, and API calls against the real LOOP sandbox.
Enforces policy — a deterministic policy engine gates every financial operation before the LLM can act.
Provides a full CLI —
loop init,loop dev,loop tools,loop doctor,loop test.
The demo: a developer says "Add LOOP payments" → the agent inspects the Django shop → discovers the MCP server → generates the integration code → runs sandbox validation → detects issues → fixes → marks READY.
Related MCP server: PayLink MCP Server
Architecture
┌─────────────────────────────────────────────────────────────┐
│ Developer (CLI / Claude Desktop / IDE) │
└──────────────────────┬──────────────────────────────────────┘
│ MCP protocol (stdio)
┌──────────────────────▼──────────────────────────────────────┐
│ MCP Server (mcp_server/server.py) │
│ 14 tools · 2 resources · 2 prompts │
└──────────┬────────────────────────┬────────────────────────-┘
│ │
┌──────────▼──────────┐ ┌─────────▼─────────────────────────┐
│ Policy Engine │ │ Service Layer (mcp_server/ │
│ (policy/engine.py) │ │ service.py) — idempotency, │
│ ALLOW / DENY / │ │ credential validation │
│ REQUIRES_APPROVAL │ └──────────────┬────────────────────-┘
└─────────────────────┘ │
┌────────▼────────────────────┐
│ LOOP Adapter │
│ (loop/adapters/sandbox.py) │
│ All 10 LOOP APIs │
└────────────────────────────-┘Quick Start
1. Prerequisites
Python 3.11+
A LOOP Developer Portal account (https://sandbox.loop.co.ke/devportal)
Your Consumer Key and Consumer Secret from the portal
2. Install
git clone <this-repo>
cd loop_mcp
pip install -e ".[dev]"3. Configure
cp .env.example .envEdit .env — see docs/HUMAN_INPUT_REQUIRED.md for what each value means and where to get it.
Required:
LOOP_CONSUMER_KEY=your_consumer_key
LOOP_CONSUMER_SECRET=your_consumer_secret
LOOP_MERCHANT_TILL=133239 # Use sandbox test till
LOOP_TILL_SECRET_KEY=hyqd7bwMr9Kv-C5PW4n7uF4TiMnMp_hyvyhYYkYlcU8 # Sandbox shared secret4. Verify everything works
loop doctorExpected output:
✓ Settings loaded
✓ LOOP credentials present
✓ HMAC test vector: PASS
✓ MCP server importable
✓ Policy engine: ALLOW (sandbox, READ tool)
All checks passed.5. Start the MCP server
loop dev6. Explore tools
loop tools # List all 14 MCP tools
loop sandbox # Run sandbox scenarios interactivelyDemo: Django Laptop Shop
The demo ecommerce application sells a laptop for KES 75,000 and accepts M-Pesa payments via LOOP.
cd demo/django_shop
pip install -r requirements.txt
cp ../../.env .env # Reuse root .env
python manage.py migrate
python manage.py seed_products
python manage.py runserverOpen http://localhost:8000 — you will see the ProBook Laptop at KES 75,000. Click Buy with M-Pesa to trigger the full LOOP STK Push flow.
Webhook: For the callback to work in sandbox, expose your local server with ngrok http 8000 and set LOOP_WEBHOOK_CALLBACK_URL=https://<your-ngrok>.ngrok.io/loop/webhook/.
CLI Reference
Command | Description |
| Initialise a new LOOP integration in the current project |
| Start the MCP server (stdio) |
| List all available MCP tools with their LOOP API sources |
| Run health checks (credentials, signing, server import) |
| Run sandbox integration tests |
| Interactive sandbox scenarios menu |
| Open LOOP API documentation |
| Run the developer agent on a project path |
MCP Tools
Tool | Operation | Risk | LOOP API |
| M-Pesa STK Push | WRITE | Mpesa Prompt API |
| LOOP Prompt | WRITE | Loop Prompt API |
| Transaction inquiry | READ | Transaction Inquiry API |
| Transaction history | READ | Transaction History API |
| Pay to LOOP Till | WRITE | Pay to Loop Till API |
| Pay to M-Pesa Till | WRITE | Pay to Mpesa Till API |
| Pay to Paybill | WRITE | Pay to Paybill API |
| Send to LOOP | SENSITIVE | Send Money (LOOP) API |
| Send to M-Pesa | SENSITIVE | Send Money (Mpesa) API |
| Send via PesaLink | SENSITIVE | Send Money (PesaLink) API |
| Health check | READ | — |
| Reconciliation | READ | Transaction History API |
| Capabilities | READ | — |
| Sandbox creds | READ | — |
Policy Engine
Every tool call is gated by PolicyEngine.check() before any API call is made. The LLM cannot bypass it.
ALLOW — READ tools always; WRITE tools in sandbox.
REQUIRES_APPROVAL — SENSITIVE tools always; WRITE tools in production; amounts > KES 10,000.
DENY — Invalid amounts; wrong till number; missing credentials.
Project Structure
loop_mcp/
├── loop/ # Core library
│ ├── config.py # Settings (pydantic-settings)
│ ├── errors.py # Typed error hierarchy
│ ├── signing.py # HMAC-SHA256 signing
│ ├── auth/ # OAuth2 Client Credentials
│ ├── models/ # Pydantic request/response models
│ └── adapters/ # LOOP HTTP client (sandbox + production)
├── policy/ # Deterministic policy engine
├── mcp_server/ # MCP server (official MCP Python SDK)
│ ├── server.py # 14 tools, 2 resources, 2 prompts
│ └── service.py # Service layer with idempotency
├── agent/ # AI developer agent (Claude)
├── cli/ # Typer CLI
├── demo/django_shop/ # Demo ecommerce app
├── docs/ # API inventory, human input guide, security
├── pyproject.toml
├── .env.example
├── Dockerfile
└── docker-compose.ymlHuman Input Required
See docs/HUMAN_INPUT_REQUIRED.md for a full list of what must be provided. The critical items:
Variable | Where to get it |
| LOOP Developer Portal → Applications |
| LOOP Developer Portal → Applications |
| Use |
| Use documented sandbox secret (in |
Security
See docs/security.md for the full security model covering: secret management, OAuth2, HMAC signing, policy engine, idempotency, MCP security, Django app hardening, and OWASP Top 10 mitigations.
What is NOT implemented (by design)
No invented endpoints — every API call uses a URL from the official LOOP OpenAPI spec.
No production deployment —
RealLoopAdapterraisesNotImplementedErroruntil the production URL is confirmed.No webhook signature verification — LOOP docs do not specify this; see
docs/security.md §Known Gaps.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceProduction-grade MCP server that gives AI agents safe access to your local dev environment: filesystem, databases, processes, and OpenAPI specs.15483MIT

PayLink MCP Serverofficial
Flicense-qualityDmaintenanceOpen-source MCP server that streamlines payment integration for AI agents and financial apps in Africa, providing unified tools for providers like M-Pesa.1- Flicense-qualityBmaintenanceAn experimental MCP server that lets AI agents interact with guarded payment workflows through typed tools, enabling safe agent-assisted payments with M-Pesa and mock Airtel Money.2
- Alicense-qualityBmaintenanceMCP server that enables AI agents to propose USDC payments on the Soroban blockchain with deterministic policy enforcement and injection protection, while providing payment status and attestation tools.MIT
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
MCP server exposing the Backtest360 engine API as tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/ChristopherMwanginjoroge/loop_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server