Inspiration
Allergen labels are hard to read: in one consumer study of precautionary allergen labelling (PAL, "may contain"-type statements), "less than 40% of participants judged PAL information to be comprehensible" (Holleman et al., Clin Exp Allergy 2021, https://pmc.ncbi.nlm.nih.gov/articles/PMC8519062/). For travellers, a 2025 scoping review names "lack of food labeling, multiple mixtures of ingredients in local food, unfamiliarity with local cuisine, and language barriers" among the difficulties travellers with food allergies encounter (Charoensakulchai et al., Trop Dis Travel Med Vaccines 2025, https://pmc.ncbi.nlm.nih.gov/articles/PMC12860081/).
May Contain targets one moment: a traveller with a package they cannot read, who needs to ask staff a precise question.
What it does
May Contain is a mobile-first web app: you select allergens from 20 categories (the EU, US and Japanese mandatory lists), then paste label text, enter or scan a barcode (looked up in the Open Food Facts product database), or choose a label photo. Photo text is read on the device (Tesseract.js OCR); you correct and confirm it against the package before checking. The barcode number is the only user input sent to Open Food Facts, along with an identifying app header and normal network metadata. Photos and text stay on the device; saving your allergens is optional and off by default.
Each selected allergen gets one of three results, Contains, May contain, or Not found in this text, with the original words highlighted as evidence. Above the results is a large staff card in one of eight languages (English, Japanese, French, German, Spanish, Italian, Korean, Chinese). For the example profile it says: "I am allergic to milk, peanuts and sesame. Does this product contain any of them?" The phrases are fixed, not generated; switching card language never changes the results. Matching is dictionary-based with rules for precaution phrases ("may contain") and negation ("free from"); it can miss terms.
AI agents get the same core through the Model Context Protocol (MCP, a standard for agents to call tools) as two local, read-only tools: check_ingredients(text, allergens) returns per-allergen results with evidence; lookup_barcode(barcode) returns Open Food Facts ingredient text and tags. Every successful result, including MCP output, carries the notice: Not found does not mean safe. Always check the package and ask staff. If you have a severe allergy, follow your doctor's plan.
How I built it
I entered alone; AI agents wrote the code, as the hackathon rules allow. OpenAI Codex wrote the core, tests, evaluation scripts, web interface and demo scripts. Claude Code planned, reviewed every change, ran the tests locally, fixed defects and published the repository. This submission text began as a GPT-6 Pro draft that was then checked against the repository and sources and reviewed by four other AI models.
The stack is Vite, React and TypeScript, Tesseract.js 6.0.1 and the MCP TypeScript SDK 1.32.2. The lexicon holds 1,561 Open Food Facts term records, verified against source lines and SHA-256 hashes, plus 12 manually checked government and Wikidata terms. Matches keep UTF-16 offsets into the original text, so highlights point at the real words. Code is MIT; the derived data is ODbL 1.0 / DbCL 1.0.
Challenges I ran into
A term can sit in an ingredient list, inside a precaution statement, or after a negation, and a rule grammar cannot read every sentence. OCR can drop whole lines and its confidence is not a calibrated probability, so you review the text yourself; an unreadable photo is an error, never a negative result. Open Food Facts tags can be incomplete, so they stay separate from the text evidence. Open Food Facts allows 15 product reads per minute per IP address; the app spaces its own requests at least 4.1 seconds apart.
Accomplishments that I'm proud of
57 Vitest tests pass, including an MCP integration test with the official client. A Playwright suite covers phone layouts, the eight languages, storage and keyboard dialogs, with Axe accessibility checks.
The matcher was measured against 90 Open Food Facts products in seven languages (all but Chinese; that request failed twice with HTTP 503, so no Chinese products were scored) against the community allergen tags; only Contains counted as positive. Precision: flagged allergens the reference confirms; recall: reference allergens found. Milk reached precision 0.811 and recall 0.857, gluten 1.000 and 0.895, nuts 0.826 and 0.792. The weak spots: soybeans recall 0.593; sesame precision 0.667 and recall 0.500; mustard 0.000 on both. Japanese recall was 0.524, French 0.966. Six of the 20 categories (wheat, shrimp, crab, walnut, cashew, buckwheat) are unscored; the reference has no reliable separate tags. The reference shares taxonomy sources with the dictionary and only tagged products were sampled, so this is a non-independent check on a biased sample, not clinical validation. OCR accuracy was not measured.
What I learned
"Not found in this text" means a limited search of supplied words, so the interface shows evidence per allergen and never a product verdict. A small, biased sample cannot show real-world performance, but it shows where recall was low: soybeans (0.593) and sesame (0.500) among the common categories, and Japanese (0.524) among languages.
What's next
Independent review of the eight staff-card translations, tests on hard labels (plant-based "butter", ambiguous botanical terms), an OCR accuracy measurement, and adding the staff-card text to the MCP output. No user study or clinician review has been done yet.
Built With
- axe
- barcodedetector-api
- claude-code
- fullscreen-api
- gemini-tts
- github
- github-actions
- inter
- localstorage
- mcp-typescript-sdk
- model-context-protocol
- node.js
- open-food-facts-api
- openai-codex
- playwright
- react
- tesseract.js
- typescript
- vite
- vitest