AgentBridge Africa
Click on "Deploy 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., "@AgentBridge AfricaSend 500 KES to Mom via Mpesa and stay under my $50 budget"
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.
AgentBridge Africa
Hardened multi-agent bridge for African payment rails: native MCP safety annotations, .well-known server discovery, HTTP 402 budget hard-stops, and NIST OSCAL 1.2.1 audit packs.
Local-context first (locale, rails, connectivity) — not a generic chatbot.
Inspired by: africa-payments-mcp, mpesa-mcp, LangGraph budget control, Harbor/LangChain golden-trajectory evals, NIST OSCAL.
Runtime shape
oauth/pkce → policy_gate → planner → worker → HITL → verifier → BudgetGuardian (402)
│ │
└─ MCP tools / resources └─ OSCAL AR + POA&MPiece | Role |
MCP Server Card |
|
Tool annotations |
|
Resources | Read-only state, profiles, balances, OSCAL artifacts |
| Hard stop + HTTP 402 + partial OSCAL evidence |
OAuth 2.1 PKCE | Remote MCP endpoints are not unauthenticated proxies |
HITL gate | Every destructive tool requires verified OTP/PIN/OAuth confirmation |
Circuit breaker | Per-provider open/half-open; fallback queue on outage |
| Versioned public API; new fields optional with defaults |
OSCAL exporter | Assessment Results + POA&M under |
Eval harness | Golden YAML trajectories + production-trace sampler |
Related MCP server: M-Pesa MCP Server
Layout
AgentBridge-Africa/
├── .well-known/mcp.json # MCP Server Card
├── agentbridge/
│ ├── core/
│ │ ├── orchestrator.py # planner / worker / verifier lifecycle
│ │ ├── graph.py # checkpointed payment lifecycle graph
│ │ ├── checkpointing.py # PostgresSaver / AsyncPostgresSaver
│ │ ├── rail_switch.py # currency/country/health provider router
│ │ ├── policy.py # allow / block / escalate
│ │ ├── budget_guardian.py # typed HTTP 402 cost hard-stop
│ │ ├── router.py # A2A routing
│ │ ├── oauth.py # OAuth 2.1 + PKCE
│ │ ├── hitl.py # destructive-tool interceptors
│ │ ├── circuit_breaker.py
│ │ ├── telemetry.py # OTEL-shaped traces
│ │ └── state.py # AgentState schema v2
│ ├── payments/ # live-ready async capability packs
│ │ ├── engine.py # production ContextProfile facade
│ │ ├── daraja.py # Safaricom OAuth, STK, status query
│ │ ├── paystack.py # initialize + verify transaction
│ │ ├── mtn_momo.py # request-to-pay + status query
│ │ ├── runtime.py # secrets, egress allowlist, transport
│ │ └── registry.py # allowlisted dependency injection
│ ├── tools/
│ │ ├── payment_mcp.py # unified annotated MCP contracts
│ │ ├── payment_engine.py # provider-neutral payment facade
│ │ ├── payment_adapter.py # sandbox provider implementation
│ │ └── resources.py # read-only resources
│ ├── webhooks/
│ │ ├── security.py # HMAC/token/SPIFFE verification
│ │ └── handlers.py # dedupe + reconcile, never callback-final
│ └── compliance/
│ ├── oscal_exporter.py
│ └── schemas/ # OSCAL JSON v1.2.1 subset
├── agentbridge/migrations/ # ledger + atomic callback/outbox SQL
├── src/bridge/ # deprecated compatibility imports only
├── tools/ # deprecated compatibility imports/stub
├── evals/ # golden + production sampler
├── frontend/ # Next.js operator console
└── tests/test_budget_guardian.pyOperator console
The responsive Next.js console in frontend/ demonstrates the production operator workflow: payment lifecycle visibility, provider health, run-cost budgets, reconciliation, immutable audit evidence, and five-step HITL approval. Demonstration identifiers are scrubbed; verifier references are accepted instead of raw OTPs, PINs, credentials, or recipient PII.
cd frontend
npm install
npm run dev # http://localhost:3000
# Production validation
npm run lint
npm run buildDashboard data is typed mock data for now. Approval actions update local UI state only; they do not invoke a payment connector.
Quick start
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
make eval
python -m pytest -q
# Live connector transport (credentials are still deployment-owned):
pip install '.[connectors]'Discovery card (no live connection required):
cat .well-known/mcp.jsonMCP safety annotations
Tools act. Resources read. Orchestrators gate on flags:
from agentbridge.tools import MPESA_STK_PUSH, MPESA_QUERY_STATUS
MPESA_STK_PUSH.annotations
# readOnly=False destructive=True idempotent=False
MPESA_QUERY_STATUS.annotations
# readOnly=True destructive=False idempotent=TrueDestructive tools require idempotency_key, payments:execute scope, and verifier-backed OTP/PIN/OAuth confirmation. Every destructive call pauses in awaiting_hitl; amounts above hitl_amount_threshold receive enhanced review.
Budget → HTTP 402
When spent_usd > max_run_cost_usd the guardian:
Sets
status=budget_exceededandhttp_status=402Halts further tool invocations
Writes partial OSCAL evidence to
.venturalitica/runs/{run_id}/
OSCAL continuous compliance
from agentbridge.compliance import Finding, export_oscal_results
export_oscal_results(run_id, findings)
# → assessment-results.oscal.json
# → poam.oscal.json (only when a control is not-satisfied)Failed budget, AML, or payment-limit controls auto-generate a Plan of Action and Milestones linking each finding to a remediation task.
Metrics (from make eval)
Metric | Meaning |
| Trajectory count (happy + failure injection) |
| Golden trajectories matching expected outcome |
| Median summed step latency |
| Median spend under BudgetGuardian |
Latest sandbox run: 7 / 7 expected outcomes (100%).
Profiles
File | Locale | Currency | Rails | Connectivity |
| en-NG | NGN | bank, ussd, mobile_money, paystack | intermittent |
| en-KE | KES | mpesa, mobile_money, bank | intermittent |
| en-NG | NGN | ussd | offline_first (fail closed) |
Safety
executerequiresidempotency_keyTool envelopes expose
readOnly/destructive/idempotentBudget is a hard stop (HTTP 402), not a soft warning
offline_firstblocks remote and side-effect tools before the worker runsNo infinite retry on tool timeout; circuit breakers open after repeated provider faults
OAuth 2.1 + PKCE on remote MCP; tokens bound to exact scopes
OpenTelemetry-shaped traces on every LLM / tool / policy span
See DEVELOPMENT.md, docs/architecture.md, docs/production-architecture.md, docs/webhooks.md, the Production Activation Verification audit, the Context Router & PostgreSQL FSM audit, the Provider Connector audit, docs/playbook.md, docs/mcp-safety.md, and docs/oscal.md.
Default execution remains sandboxed. Live connector classes perform no network I/O until explicitly registered with deployment-owned secrets, policy, callback hosts, and egress configuration.
This server cannot be deployed
Maintenance
Related MCP Connectors
Agent-native MCP for governed commerce, x402 payments, paid capabilities, and verifiable receipts.
Attribution and settlement infrastructure for AI agent content access over HTTP 402 and MCP.
Agent Commerce Protocol MCP — bridges Stripe ACP + Google AP2 + Coinbase x402 for agent payments
Paid token risk and security intelligence for AI agents over MCP with x402 payments.
Related MCP Servers
FlicenseNot gradedqualityDmaintenanceOpen-source MCP server that streamlines payment integration for AI agents and financial apps in Africa, providing unified tools for providers like M-Pesa.1-- FlicenseNot gradedqualityDmaintenanceAn 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-
- AlicenseNot gradedqualityCmaintenanceNon-custodial payment engine for AI agents supporting BTC, ETH, USDT, USDC, XRP, XMR, and ZEC. Exposes wallet, invoice, and payment tools over MCP with per-agent spend limits, plus x402 pay-per-call support.42 npmBusiness Source 1.1
- AlicenseNot gradedqualityCmaintenanceDual-rail MCP server for initiating and verifying MPP and x402 payments, plus MPP-attested identity claims, enabling agent-native financial settlement.MIT