ke-tenders-audit-mcp
An MCP server for the Ke-Tenders Audit agent that reviews Kenyan public procurement awards, runs integrity, price, and supplier checks, and with named human approval files sourced flags and drafts committee reports.
Search published awards by buyer, item, supplier, category, method, or signing date; explains empty results and suggests close buyer names.
Benchmark one award value against similar awards (same item group/category) with median, quartiles, ratio, and outlier flag; notes when comparables are under 5.
Profile a supplier: bids listed, awards won, win rate, buyers, and single-bidder wins via fuzzy name matching.
Check integrity for a tender or buyer: single bidder, direct method, signed before close, just below round amount, repeat winner; data problems listed separately.
File one sourced flag (write, human-gated) with finding, evidence, flag type, and ocid; refused if ocid is unknown or wording decides award/declares wrongdoing.
Draft a committee report (write, human-gated) from approved flags with OCDS citations and a data-computed totals table.
Read cleaned OCDS records and data-quality notes via
ocds://release/{ocid}andocds://data-quality-notesresources.Enforces grounding, named human approval only, no self-approval, rejected writes not reproposed, and no decision/guilt wording.
Read-only access to the local cases folder via the official Filesystem MCP server, letting the agent open and read earlier case files while preparing a procurement review.
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., "@ke-tenders-audit-mcp Review all published awards by PC Kinyanjui Technical Training Institute"
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.
Ke-Tenders Audit
An agentic AI that prepares a sourced review file on Kenyan public procurement awards for a human evaluation committee, then stops. It flags patterns. It never awards a tender, never recommends a winner and never declares wrongdoing. Every write needs a named human's approval.
Built for the African Agentic AI Design Challenge, Governance track (The Bid Box Challenge), theme Value for money.
Live demo: https://ke-tenders-audit-bxxfc4gmxjc9mpuuvkzypz.streamlit.app/ (opens on recorded real runs; switch to "Live review" in the sidebar for up to 3 live reviews a day on a free model tier)
pip install -r requirements.txt && streamlit run app.py(Python 3.12. Put a model key in .env first: see Setup.)
Problem statement
Kenyan public bodies (county governments, TVET colleges, schools, NG-CDF offices, water companies) publish every tender and award on the PPRA portal, tenders.go.ke, in the Open Contracting Data Standard (OCDS). Almost nobody has time to use it. Evaluation committees and internal auditors spend weeks checking bidders, comparing prices and writing reports; the challenge brief puts it at 26 days of committee work per tender. Oversight bodies face the opposite problem: thousands of records and no way to see which ones deserve a second look.
The warning signs are already in the data. In the FY2026/27 release (4,830 tenders, 136 with awards), 23 awards had a single bidder, some suppliers win repeatedly from the same buyer, some contracts are signed before the tender closed, and some awards sit just below round amounts.
Related MCP server: cerebro-mcp
Which half of the data this is built on
The brief notes that portals publish what was tendered and awarded, not the bids. This project is built on the tendered-and-awarded half: award values, bidder lists on awarded tenders, dates, methods and buyers. It does not evaluate bid documents, because none are published.
Solution overview
A reviewer asks a question such as "Review all published awards by PC Kinyanjui Technical Training Institute". The agent plans the review, calls tools on our MCP server to search awards, run integrity checks, compare prices and profile suppliers, then proposes flags. Each proposed flag pauses the run until a named reviewer approves, rejects or requests changes. Approved flags go into a case file, and the agent drafts a committee report where every finding cites its OCDS record.
What the code enforces, not just the prompt:
A flag must cite an ocid that a tool actually returned in this run, or it is refused before a human sees it.
A flag naming a company that is not a bidder or winner on that record is refused, with the correct name.
Only the human gate can fill
approved_by; the model cannot approve itself.A write the reviewer rejected is refused if the model proposes it again.
Wording that decides an award or declares guilt is refused.
Every report ends with a table of all patterns found, computed from the data, so a wrong model summary cannot hide anything.
No em dashes or en dashes in anything written to the case file.
Target users
Procurement evaluation committees and heads of procurement in counties, colleges and state agencies.
Internal audit units preparing for the Office of the Auditor-General.
Also useful to oversight bodies, journalists and civil society, and to honest suppliers who gain from fairer competition.
Architecture

One page: ARCHITECTURE.md. Project description (about 300 words): DESCRIPTION.md.
Setup
Requirements: Python 3.12, Node.js 18+ (for the borrowed Filesystem MCP server, run with npx).
Copy
.env.exampleto.envand choose a model:Hosted Qwen on Groq (free key at console.groq.com): set
KTA_LLM_BASE_URL=https://api.groq.com/openai/v1,KTA_LLM_MODEL=qwen/qwen3.8-27band your key inKTA_LLM_API_KEY.Fully local with Ollama (data never leaves the machine): install Ollama, run
ollama pull qwen3:4b, and keep the defaulthttp://localhost:11434/v1settings.
Install and start:
pip install -r requirements.txt && streamlit run app.pyThe cleaned data ships in data/clean/releases.jsonl, so no download is needed. To rebuild it from a
fresh PPRA download, save the JSON from https://tenders.go.ke/api/ocds/tenders?fy=2026-2027 into
data/raw/ and run ke-tenders-ingest.
Usage
Review screen: enter your full name, ask a question, watch each tool call with its input and output, then approve, reject or request changes on each proposed flag. Each proposal shows the record's own facts (title, winner, amount, bidders, method) beside the model's claim, with a red warning on any mismatch. Download the report when done.
Terminal:
python -m ke_tenders_audit.cli "Review Kilifi County Government's awards." --reviewer "Your Full Name"Tests and evals:
pytestpython evals/run_evals.py --runs 2Technology stack
Layer | Choice |
Orchestration | LangGraph (state graph, |
Model | Qwen3.8-27B (open weights) on Groq; Qwen3 4B locally through Ollama; any OpenAI-compatible endpoint |
MCP | Official MCP Python SDK (our server), |
Data | DuckDB in memory, built from cleaned OCDS JSONL; RapidFuzz for name matching |
Interface | Streamlit review screen, plus a terminal runner |
Logs | Append-only JSONL audit log per run |
Tests | pytest (36 tests), plus a graded eval harness (see EVALS.md) |
Agent architecture
plan -> agent -> read tools -> tools -> verify -> agent ...
-> write tools -> grounding check -> human gate -> tools -> verify -> agent ...
-> no tool calls -> doneplan: the model writes a short numbered plan for the request.
agent: the model chooses tools, at most 3 per step.
verify: after each tool round, deterministic checks look for errors, refusals, hints and "insufficient comparables", and tell the model plainly so it re-plans instead of guessing.
grounding check and human gate: described above.
memory: LangGraph checkpoints in SQLite, so a run pauses for approval and resumes exactly where it stopped, even after an error ("Retry last step").
budget: older tool results are shortened to keep each request under about 7,000 tokens, which fits free model tiers. Red-flag results put their totals first so shortening never loses them.
MCP implementation
Two MCP servers, both connected over stdio through langchain-mcp-adapters. A tool interceptor
writes every call (server, tool, inputs, output, duration) to the audit log.
MCP tools and servers
Built: ke-tenders-audit-mcp (server.py)
Tool | Kind | What it does |
| read | Find awards by buyer, item, supplier, category, method or date. Explains empty results and suggests close buyer names. |
| read | Single bidder, direct method, signed before close, just below a round amount, repeat winner at the same buyer. Totals first. |
| read | Compare an award with similar awards (same item group and category). Says so when there are fewer than 5. |
| read | Bids, wins, win rate, buyers and single-bidder wins for a company. |
| write, gated | Add a sourced flag to the case file, with the record's own facts attached. |
| write, gated | Build the committee report from approved flags, plus the data-computed totals table. |
Resources: ocds://release/{ocid} (the cleaned record behind any finding) and
ocds://data-quality-notes (known problems in the feed).
Borrowed: the official Filesystem MCP server (@modelcontextprotocol/server-filesystem), scoped to
the cases/ folder, read tools only. It lets the agent read earlier case files. It is maintained,
tested and sandboxed to one folder, so writing our own file access would add risk and no value.
Human-in-the-loop workflow
The agent proposes one or more writes. The run pauses (LangGraph
interrupt()).The reviewer sees each proposal with the record's facts and the full source record.
For each one: Approve, Request changes (with a note the agent uses to revise) or Reject (never proposed again in this run).
The gate writes the reviewer's name into
approved_by. The audit log records the decision.The final report says who approved it. The committee makes the award decision, outside this system.
Data conduct
Open data only, from PPRA. Cleaning removes contactPoint, street addresses and postal codes, and
strips emails and phone numbers that publishers typed into company names. Company records are used;
no individual's personal details are. No live tender in progress is evaluated: awards are by
definition closed.
Cost per run
Measured on Groq, Qwen3.8-27B at $0.80 and $4.00 per million input and output tokens: a full buyer review (31 awards, 7 model calls, 13 tool calls) used about 24,000 input tokens, about $0.03. A single-tender review costs under $0.02. Locally with Ollama the cost is zero. Every run's tokens and cost are in its audit log. Evaluation results: EVALS.md.
Limitations
No bid documents. The feed has no bids, so technical and financial evaluation of bids is out of scope.
Lump sums, not unit prices. Price comparisons point to scope questions, not proven overpricing.
Small award sample. Only 136 tenders have published awards in FY2026/27, so many items have too few comparables.
Item grouping is rule-based. Free-text titles are grouped with keyword rules; about 7% of awards stay ungrouped.
Thresholds are round numbers, not confirmed law. "Just below a round amount" needs checking against the PPADA Regulations 2020.
Free model tier. On Groq's free tier a review takes 1 to 3 minutes, mostly rate-limit waiting, and about 6 full reviews fit in a day.
The model's summary can still be wrong. The data-computed table at the end of each report is the safeguard.
Future improvements
Load past fiscal years (FY2025/26 and earlier) for stronger price comparisons and supplier histories.
Run against other OCDS portals (Rwanda, Tanzania, Nigeria, South Africa); the tools are schema-generic.
Confirm PPADA thresholds and replace round amounts with the real limits per procurement method.
Match suppliers on registration numbers if PPRA publishes them.
Unit-price extraction from contract documents, where those become public.
Licence
MIT. See LICENSE. Data: Public Procurement Regulatory Authority (Kenya), published as open data.
Available Tools
6 toolscheck_red_flagsB
Integrity checks for one tender (ocid) or all awards of a buyer.
Single bidder, direct method, signed before tender closed, just below a round amount, repeat winner at the same buyer. Data problems are listed separately and are not flags.
Inputs: ocid, buyer. Returns: result
draft_reportA
WRITE. Build the committee report (report.md) from the approved flags in a case.
Needs a named human approver. Each finding in the report cites its OCDS record.
Inputs: title (required), case_id (required), summary (required), approved_by. Returns: result
file_flagA
WRITE, needs human approval. Add one flag to the case file.
finding: the pattern in one plain sentence. evidence: the numbers behind it. Refused if the ocid is unknown or the wording decides the award or declares wrongdoing.
Inputs: ocid (required), case_id (required), finding (required), evidence (required), +2 more. Returns: result
price_benchmarkB
Compare one tender's award value with similar awards (same item group and category).
Returns median, quartiles, ratio to median, outlier yes/no. Says so when under 5 comparables.
Inputs: ocid (required). Returns: result
search_awardsB
Find published awards. All filters optional.
buyer: part of the buyer name. item: word from the title or item group. supplier: company name. category: goods|services|works. method: open|selective|direct. date_from/date_to: YYYY-MM-DD signing date. If nothing matches, explains why and suggests close buyer names.
Inputs: item, buyer, limit, method, +4 more. Returns: result
supplier_profileA
Profile a supplier company: bids listed, awards won, win rate, buyers, single-bidder wins.
Uses fuzzy matching on the company name. Company records only, never personal details.
Inputs: name (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct action: search, benchmark, profile, flag detection, flag filing, and reporting. There is mild overlap between price_benchmark and check_red_flags (both analyze award patterns) and between supplier_profile and check_red_flags, but the descriptions make the boundaries reasonably clear.
Four tools follow a verb-first pattern (search_awards, check_red_flags, file_flag, draft_report), while price_benchmark and supplier_profile use a noun-first pattern. Readable overall, but the convention is mixed rather than predictable.
Six tools is well-scoped for an audit workflow spanning discovery, analysis, flagging, and reporting. It is on the leaner side but each tool clearly earns its place; no redundancy.
The surface covers the full audit lifecycle: find awards, benchmark prices, profile suppliers, detect red flags, file flags, and produce a report. A detail-retrieval tool (e.g. get_award/get_tender by ocid) is a minor gap, but agents can work around it via search.
Maintenance
Related MCP Connectors
License-clean African & EM data as citable agent tools: company fundamentals, tenders (OCDS), macro.
Search EU, UK and US public tenders, look up award history, and get alerts on new matches.
Find public tenders, research buyers and suppliers, and track opportunities with source evidence.
Search, verify & screen 1M+ African companies + their government contracts across 18 registries.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to find, score, and monitor government contract opportunities across UK, EU, and US with AI-powered relevance scoring.264 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables searching and analyzing government tenders, contract awards, and pre-tender pipelines from 21 official sources, with tools for tender search, award intelligence, and detailed notice retrieval.MIT

GovCon API MCPofficial
AlicenseAqualityBmaintenanceEnables agents to search and analyze US federal procurement data across SAM.gov opportunities, FPDS awards, SAM entities, FFATA subawards, exclusions, and full-text solicitation attachments, with 6 tools for market research, opportunity discovery, teaming, pricing, and compliance.666 PyPIMIT- FlicenseNot gradedqualityCmaintenanceEnables automated forensic auditing of public procurement tenders by parsing RFQ specifications, detecting price drift against market baselines, flagging bidder collusion risks, and enforcing human officer approval before any decision is recorded.1-