MCP server · for AI agents

Nigerian food prices, inside your AI agent.

Lokoja Intelligence now speaks the Model Context Protocol. Point Claude, ChatGPT, Cursor, VS Code or any MCP-capable agent at one endpoint and it can ask for the current price of maize in Dawanau, the history of rice in Lagos or the haulage cost down the Kano–Aba corridor, and quote the answer with a source. Same data as the price pages and the free endpoints, same free key, same attribution rule.

MCP https://api.lokoja.app/mcp Streamable HTTP · header X-API-Key: lk_…

Connect in two steps

1. Get a free API key on the developers page: one email, instant key, no approval. 2. Add the server to your agent with the key in the X-API-Key header (Authorization: Bearer also works). Discovery (initialize, tools/list) is open; only tool calls need the key.

claude mcp add --transport http lokoja https://api.lokoja.app/mcp \ --header "X-API-Key: lk_YOUR_KEY"

Then ask Claude Code anything about Nigerian food prices; it will call the Lokoja tools itself.

{ "mcpServers": { "lokoja": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.lokoja.app/mcp", "--header", "X-API-Key:lk_YOUR_KEY"] } } }

Paste into claude_desktop_config.json (Settings → Developer → Edit Config) and restart Claude Desktop. The mcp-remote bridge forwards the header to the remote server.

{ "mcpServers": { "lokoja": { "type": "http", "url": "https://api.lokoja.app/mcp", "headers": { "X-API-Key": "lk_YOUR_KEY" } } } }

Cursor: .cursor/mcp.json. VS Code (Copilot agent mode): .vscode/mcp.json, with "servers" in place of "mcpServers".

In ChatGPT, open Settings → Connectors → Create (developer mode), set the MCP server URL to https://api.lokoja.app/mcp and, where the client lets you add a custom header, X-API-Key: lk_YOUR_KEY. Clients that only support OAuth or no-auth connectors can still list the tools; calls will return a 401 text until a key is supplied.

curl -s https://api.lokoja.app/mcp \ -H "Content-Type: application/json" -H "X-API-Key: lk_YOUR_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call", "params":{"name":"latest_prices","arguments":{"commodity":"Maize","market":"Dawanau"}}}'

Stateless Streamable HTTP: JSON-RPC 2.0 in, JSON out, batches accepted, no session header required. Protocol versions 2025-06-18, 2025-03-26 and 2024-11-05.

runs the real MCP call from this page

    

The tools

Prices are naira per tonne, with per-100kg and per-50kg bag figures derived (÷10 and ÷20). Markets with a fresh ambassador stall check carry source: "field"; the rest come from the monthly reference feed. Call list_commodities first for exact names.

ToolWhat it returnsAccess
list_commoditiesCommodities covered, latest periods, data source.free key
latest_pricesLatest price of one commodity in every market, cheapest first, per tonne / 100kg / 50kg, with period and source. Optional market filter.free key
price_seriesMonthly history across markets for the last N periods. Identical to GET /price-series and the /prices pages.free key
haulage_summaryHaulage rate per tonne-km, fixed charge, diesel price and index, transport cost on representative corridors. Powers /haulage.free key
market_pairBuy here, sell there: distance, both price histories, gross spread, haulage, net spread per tonne.corridors scope
corridor_risk0–100 Corridor Risk Score with band, confidence grade, components and drivers.risk scope

Kenya

Pass country: "KE" to list_commodities, latest_prices or price_series and the same tools answer from Lokoja's Kenya layer: WFP-observed staple prices across Kenyan markets in Kenyan shillings, the data behind lokoja.app/ke. Kenya is data-only for now, so the haulage and corridor tools stay Nigerian. Nigeria is the default when country is omitted.

{"name":"latest_prices","arguments":{"commodity":"Maize","country":"KE"}}

Free keys carry 10 calls per hour per tool, the same fair limit as the REST endpoints; over it the tool returns a 429 message with the reset time rather than failing the agent. Commercial scopes come with data plans: hello@lokoja.app.

What to ask once it is connected

Showing examples for NigeriaKenya. Switch with the NG / KE picker in the top bar.

  • “What does a 100kg bag of maize cost in Dawanau this month, and how does that compare with Lagos?” — latest_prices, one call.
  • “Plot rice in Kano over the last year and tell me whether the harvest dip has started.” — price_series with months: 13.
  • “If diesel is where it is now, what does it cost to truck a tonne of beans from Kano to Aba?” — haulage_summary.
  • “Which of our three sourcing markets lands cheapest in Ibadan after transport?” — market_pair per corridor (commercial scope).
  • “What does a 90kg bag of maize cost in Nairobi this month, and how does that compare with Eldoret?” — latest_prices with country: "KE", one call; the agent derives the 90kg bag from the per-tonne figure.
  • “Plot maize flour in Mombasa over the last year and tell me whether unga has come off its peak.” — price_series with country: "KE", months: 13.
  • “Where are dry beans cheapest right now: Nairobi, Kisumu or Nakuru?” — latest_prices returns every Kenyan market cheapest first; the agent picks out the three.
  • “Has sugar moved in Kenyan markets since April?” — price_series with country: "KE", months: 6.

Kenya is data-only: ask for haulage or a corridor and the agent should say the transport model is calibrated for Nigeria and stop there, which the tool descriptions tell it.

Every answer should cite Lokoja Intelligence and link to lokoja.app: that attribution is the only price of the free tier, and the server's instructions tell the agent so.

Discovery and listing

The server publishes a registry-style description at api.lokoja.app/.well-known/mcp/server.json (mirrored at lokoja.app/.well-known/mcp/server.json) under the name app.lokoja/prices, so MCP registries and directories can index it. The initialize and tools/list methods are open to anyone, which lets agents and crawlers see the tool set without a key.

Same data, three doors. The price pages are for people, the REST endpoints for code and this MCP server for agents. All three read the same engine: 67 markets, weekly ambassador stall checks, the diesel-indexed haulage index. If a number differs between them, that is a bug: write to hello@lokoja.app.

Frequently asked

Is it free?

Yes, for the price and haulage tools, with a free key and attribution to lokoja.app. Corridor maths and risk scores need a commercial key with the matching scope.

Does the server keep my conversation?

No. The endpoint is stateless: each tool call is one request, logged like any API call against your key for rate limiting. Nothing the agent says to you reaches Lokoja.

How fresh is the data?

Reference feeds update monthly per source cadence; ambassador stall checks weekly; the haulage layer is re-indexed to diesel weekly. latest_prices labels each row with its period and source so the agent can say how old a figure is.