@pipeworx/codex-mrl

Connect: https://gateway.pipeworx.io/codex-mrl/mcp · Install: one-click buttons

Tools: 6

The internationally agreed legal ceilings for pesticide residues and veterinary drug residues in food, adopted by the Codex Alimentarius Commission. Codex MRLs are the reference point for food trade — a shipment rejected at a border is usually rejected against one of these numbers.

This is the permission side of food chemistry. The safety side — the Acceptable Daily Intakes and toxicological evaluations behind the limits — is the jecfa pack; veterinary drug records here carry a jecfa_chemical_id that links the two.

Tools

ToolWhat it answers
codex_pesticide_searchFind a pesticide by name → id
codex_pesticide_mrlsOne pesticide → ADI, residue definition, and its limit in every commodity
codex_commodity_searchFind a food commodity by name → id
codex_commodity_mrlsOne food → every pesticide limit that applies to it
codex_vetdrug_searchList or search the 85 veterinary drugs
codex_vetdrug_mrlsOne drug → limits by species and tissue, plus its JECFA cross-reference

Coverage

240 pesticides and 85 veterinary drugs, with limits indexed in both directions (by substance and by food). Pesticide limits carry their adoption year, the JMPR evaluation year, and the step code — CXL means an adopted Codex limit; a numeric step means the limit is still moving through the 8-step adoption procedure and is not yet binding.

Auth

None. Keyless, no registration, no quota.

Data sources

No documented API. These endpoints back the site’s own jQuery pages, so they are undocumented and unversioned and can drift without notice.

What is NOT here: GSFA

Codex’s third database — GSFA, the General Standard for Food Additives, which is what says whether an additive is permitted in a given food and at what level — is not covered, because it is not reachable from a server. fao.org/gsfaonline sits behind a Cloudflare JavaScript challenge that returns 403 to every non-browser client, including for the standard’s own PDF. This is not an IP-reputation block, so an egress proxy does not help: the SharePoint mirror requires FAO SSO, the site’s own sh-proxy returns the same 403, and FAO’s OpenKnowledge repository API refuses too. Reaching GSFA would need a browser-driven scrape into a hosted table, which is a different kind of project.

Gotchas

Four upstream behaviours produce wrong answers if trusted. All are guarded here, but they matter if you extend it:

  1. About 10% of pesticide records are invalid JSON. Commodity names contain raw tab characters inside string literals — "Dry peas \t\t(subgroup)". RFC 8259 forbids unescaped U+0000–U+001F inside strings, so JSON.parse throws Bad control character in string literal and the record is simply unreachable. Sampling 30 records found 3 affected, including glyphosate. sanitizeJson() escapes control characters inside strings only, tracking in-string state, because tabs and newlines between tokens are legal whitespace that must be left alone.

  2. A search that matches nothing returns the search form, not an empty list. Ask for a commodity that doesn’t exist and you get back {forms: {...}} describing the search UI. Code that looks for commodities and finds nothing can easily report “no limits apply” — a confident wrong answer. isEmptySearchResponse() distinguishes the two shapes.

  3. Unknown ids answer HTTP 500, not 404. So a bad id is indistinguishable from the upstream being down. Both codex_pesticide_mrls and codex_vetdrug_mrls resolve their argument against the catalogue first and never probe a detail endpoint with an id they haven’t seen.

  4. Absence and zero are different, and both are meaningful.

    • Zero limits is a finding: chloramphenicol returns count: 0 because Codex declines to set any MRL for a substance it judges to have no safe residue level. Reporting that as “no data” inverts the meaning.
    • A missing substance is also a finding: this database lists only currently adopted limits, and Codex removes entries when it revokes them. Chlorpyrifos is absent for exactly that reason — verified against upstream’s own search, which likewise returns nothing. So absence is not evidence a substance was never evaluated, and the no_match hints say so.

Tools

  • codex_pesticide_search — Find pesticides in the Codex Alimentarius residue database by name or partial name (glyphosate, chlorpyrifos, 2,4-D). Returns each match with the id needed to fetch its maximum residue limits. Use whe
  • codex_pesticide_mrls — Get the internationally agreed maximum residue limits for one pesticide across every food commodity Codex has set a limit for, plus its Acceptable Daily Intake, the chemical definition of the residue
  • codex_commodity_search — Find food commodities in the Codex pesticide residue database by name (apple, rice, milk, poultry meat). Returns each match with the id needed to look up every pesticide limit that applies to it. Code
  • codex_commodity_mrls — List every pesticide with a Codex maximum residue limit in one food, with the limit for each. Accepts a commodity id, a Codex commodity code (“FP 0226”), or a food name. Use to answer which pesticide
  • codex_vetdrug_search — List or search the veterinary drugs for which Codex has adopted maximum residue limits in animal-derived food — antibiotics, antiparasitics, growth promoters. Omit the query to list all of them with t
  • codex_vetdrug_mrls — Get the Codex maximum residue limits for one veterinary drug, broken down by animal species and tissue (cattle muscle, liver, kidney, milk; fish fillet; poultry eggs), with its functional class and th

Tools

  • codex_commodity_mrls — List every pesticide with a Codex maximum residue limit in one food, with the limit for each. Accepts a commodity id, a Codex commodity code ( FP 0226 ), or a food name. Use to answer which pesticide
  • codex_commodity_search — Find food commodities in the Codex pesticide residue database by name (apple, rice, milk, poultry meat). Returns each match with the id needed to look up every pesticide limit that applies to it. Code
  • codex_pesticide_mrls — Get the internationally agreed maximum residue limits for one pesticide across every food commodity Codex has set a limit for, plus its Acceptable Daily Intake, the chemical definition of the residue
  • codex_pesticide_search — Find pesticides in the Codex Alimentarius residue database by name or partial name (glyphosate, chlorpyrifos, 2,4-D). Returns each match with the id needed to fetch its maximum residue limits. Use whe
  • codex_vetdrug_mrls — Get the Codex maximum residue limits for one veterinary drug, broken down by animal species and tissue (cattle muscle, liver, kidney, milk; fish fillet; poultry eggs), with its functional class and th
  • codex_vetdrug_search — List or search the veterinary drugs for which Codex has adopted maximum residue limits in animal-derived food — antibiotics, antiparasitics, growth promoters. Omit the query to list all of them with t

Regenerated from source · build August 6, 2026