Skip to main content
Glama
README.md
# PROCUREGUARD MCP | Statutory Procurement Auditor

> **Air-gapped forensic audit middleware for public sector procurement integrity under Kenya's PPADA 2015 Section 114.**

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Stack](https://img.shields.io/badge/stack-PHP%20%7C%20SQLite%20%7C%20FastMCP%20%7C%20Ollama-cyan)
![Jurisdiction](https://img.shields.io/badge/jurisdiction-PPADA%202015-emerald)

---

## 1. Problem Statement

Public procurement systems across emerging markets face systemic risks from structural overpricing, price drift, and covert cartel collusion (such as shared directorships or matching KRA PINs among seemingly distinct bidders). Standard digital procurement portals lack real-time, local forensic checks to catch line-item inflation before contract execution, leading to public revenue leakage.

---

## 2. Solution Overview

**ProcureGuard MCP** is an air-gapped, sovereign forensic auditing tool. It intercepts submitted bid envelopes, evaluates line-item rates against local statutory baselines, and flags price drift and corporate identity overlap. 

### Key Features
* **Zero-Leak Air-Gapped Intelligence**: Runs locally using `qwen2.5-instruct:3b` via Ollama to synthesize statutory briefs without leaking public procurement data to cloud APIs.
* **FastMCP Telemetry**: Connects local SQLite ledgers directly to high-contrast frontend dashboards.
* **Human-in-the-Loop Sign-Off**: Enforces Kenya’s **Public Procurement and Asset Disposal Act (PPADA) 2015 Section 114**, requiring cryptographic officer authentication before escalating or clearing flagged tenders.

---

## 3. Target Users

* **Public Procurement Officers**: Conducting initial bid evaluation and statutory compliance checks.
* **Forensic Internal Auditors**: Reviewing historical price drift across municipal supply chains.
* **Regulatory & Anti-Corruption Bodies**: Inspecting immutable audit logs and officer decision trails.

## 4. Architecture

```
[ Public Ledger / Tender Data ]
              │
              ▼
    [ Python Ingestion Sync ]
              │
              ▼
      [ SQLite Ledger ] (procureguard.db)
              │
              ├──────► [ FastMCP Server ] ◄───► [ Local Ollama Engine ]
              │             │                     (qwen2.5-instruct:3b)
              │             ▼
              └──────► [ PHP / Alpine.js Dashboard ] 
                            │
                            ▼
               [ PPADA Sec 114 Officer Gate ]

```

## 5. Setup & Installation Instructions
   
Prerequisites
 XAMPP / PHP 8.x running locally.

 Python 3.10+ with SQLite support.

 Ollama installed locally with qwen2.5-instruct:3b pulled:

 1)Pull model from terminal
 ollama pull qwen2.5-instruct:3b

 2)Clone the repository into your local web server root (e.g., htdocs):
 git clone [https://github.com/lxpjamboo/ProcureGuard-MCP.git](https://github.com/lxpjamboo/ProcureGuard-MCP.git)
 cd ProcureGuard-MCP

 3)Initialize the local SQLite database and seed forensic test baselines:
 python_init_db.py

 4)Ensure Apache is active in XAMPP, then access the local dashboard gateway:
 http://localhost/procurequred%20poject1/

## 6. Usage Instructions
  1)Dashboard Overview: Review global risk scores, maximum price drift percentages and submitted bid envelopes.
  2)Run Forensic Audit: Click 'Run Forensic Audit to execute real time statutory checks against local SQLite baselines.
  3)Statutory Brief: Read the air gapped summary generated by local Qwen 2.5 detailing unit rate inflation and shared identity matches.
  4)Officer Gate Sign-Off: Navigate to Officer Gate, input your officer badge ID, select the statutory action route(eg escalate to EACC) and commit the decision.
  5)Audit Logs: Access the immutable transaction records under the Audit Logs tab.

## 7. License
 Distributed under the MIT License. See LICENSE for details.

## Confidential Architectural Concept | © 2026 LXP