Repository avatar
Other Tools
v0.3.0
active

agri-prices

io.github.luthandomaqondo-95/agri-prices

Sample fresh-produce prices (ZAR/kg) for five South African markets. Teaching server.

Documentation

Agri Prices MCP: MCP Africa Master Class 2026

A teaching MCP server built live at the MCP Africa Symposium 2026 Master Class (The Cortex Hub, East London, 23 November 2026). It serves sample fresh-produce prices (ZAR/kg) for five South African markets, and grows over four stages, one branch each.

BranchStageMaster Class session
stage-1-basic-mcpA simple MCP server with no auth: tools, a resource, a prompt11:00 Build studio
stage-2-deploy-vercelDeploy to Vercel, add health check and OpenTelemetry13:15 Secure and host, 14:15 Operate and observe
stage-3-publish-registryPublish to the Official MCP Registry with server.json and GitHub OIDC13:15 Secure and host
stage-4-google-oauthSign in with Google, then rate limits, audit trail and usage billing per customer15:15 Sell and price

Each branch builds on the one before it. main is the same as stage 1.

git clone https://github.com/AppimateSA/mcp-masterclass && cd mcp-masterclass
git checkout stage-1-basic-mcp   # or any stage
npm install
npm run dev                      # http://localhost:3000/api/mcp
npm run smoke                    # in a second terminal
npm run verify                   # checks the stage you have checked out, end to end

Running the whole demo on a new computer? Follow DEMO.md: every stage, in order, with what to show.

Sample data. Prices in lib/data/markets.ts are illustrative, not real market prices.


Stage 1: a simple MCP server (no auth)

Stack: Next.js App Router, mcp-handler v2, MCP TypeScript SDK v2 (@modelcontextprotocol/server), Zod v4. The server speaks the 2026-07-28 spec (stateless core) and still answers older clients.

PrimitiveWho controls itIn this server
Toolsthe modellist_markets, get_price, compare_markets
Resourcesthe applicationmarkets://catalogue
Promptsthe userweekly_price_brief

Files to read, in order:

  1. lib/data/markets.ts: the data boundary (swap in your own source here)
  2. lib/mcp/server.ts: tool, resource and prompt contracts (Zod schemas → JSON Schema)
  3. app/api/mcp/route.ts: the HTTP endpoint (about 10 lines)

Try it

npm run smoke                     # SDK client: lists everything, calls two tools
bash scripts/curl-demo.sh         # one raw JSON-RPC tools/call, no handshake
npm run inspector                 # MCP Inspector UI → connect to http://localhost:3000/api/mcp

Build-studio exercise

Pick your team's workflow (agriculture, health or finance). Replace the data file and add one tool, one resource and one prompt of your own. Keep every result carrying source and asOf.

No installation packages available.