Skip to main content
Glama
nitishkp001

NutriClarity MCP

by nitishkp001

NutriClarity MCP 🥗

CI PyPI Python License: MIT

An open-source Model Context Protocol server that gives any LLM access to food nutrition data — look up products by barcode, search by name, read Nutri-Score / NOVA / Eco-Score ratings, and compare products side by side.

Powered by Open Food Facts, a free, open, crowd-sourced food products database. No API key required.

Tools

Tool

Description

get_product_by_barcode(barcode)

Full nutrition facts, scores, allergens & ingredients for a barcode (EAN/UPC).

search_products(query, page_size=5)

Search products by name or brand; returns barcodes + a nutrition summary.

get_nutrition_scores(barcode)

Nutri-Score (A–E), NOVA processing group (1–4), and Eco-Score for a product.

compare_products(barcodes)

Side-by-side per-100g comparison table for 2+ products.

find_healthier_alternative(barcode, limit=5)

Suggest same-category products with a better Nutri-Score.

add_or_update_product(...)

Optional / opt-in. Create or edit a product. Only enabled when credentials are set (see below).

Reading needs no API key or account — it's open data. Only the optional write tool requires an Open Food Facts login.

Related MCP server: Open Food Facts MCP Server

Quick start

The easiest way to run it is with uvx (no install, no clone):

uvx nutriclarity-mcp

Claude Desktop / Cursor / any MCP client

Add this to your MCP config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "nutriclarity": {
      "command": "uvx",
      "args": ["nutriclarity-mcp"]
    }
  }
}

Then ask things like:

  • "What's the nutrition of barcode 3017620422003?"

  • "Search for oat milk and show me the healthiest option."

  • "Compare Coke and Pepsi nutrition."

Docker

docker run -i --rm ghcr.io/nitishkp001/nutriclarity-mcp

MCP config:

{
  "mcpServers": {
    "nutriclarity": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "ghcr.io/nitishkp001/nutriclarity-mcp"]
    }
  }
}

Optional: write support (adding/editing products)

By default the server is read-only — no account, no risk. If you want the LLM to be able to contribute or correct product data, enable the add_or_update_product tool by providing an Open Food Facts account:

Env var

Description

OFF_USERNAME

Your account username (not your email). Enables writes when set with the password.

OFF_PASSWORD

Your account password.

OFF_ENVIRONMENT

sandbox (default) or production.

Writes go to the sandbox by default, so you can test safely without touching the real database. Set OFF_ENVIRONMENT=production only when you deliberately want to edit the live, public database. Sandbox accounts are separate from production accounts — register on each site you target.

{
  "mcpServers": {
    "nutriclarity": {
      "command": "uvx",
      "args": ["nutriclarity-mcp"],
      "env": {
        "OFF_USERNAME": "your-username",
        "OFF_PASSWORD": "your-password",
        "OFF_ENVIRONMENT": "sandbox"
      }
    }
  }
}

⚠️ Open Food Facts is a shared, public database used by millions. If you enable production writes, make sure the data you submit is accurate and taken from the real product label. The tool changes only the fields you pass.

Local development

Requires uv.

git clone https://github.com/nitishkp001/nutriclarity-mcp
cd nutriclarity-mcp
uv sync --extra dev        # install deps
uv run nutriclarity-mcp    # run the server over stdio
uv run pytest              # run tests
uv run ruff check .        # lint

To inspect the tools interactively, use the MCP Inspector:

npx @modelcontextprotocol/inspector uv run nutriclarity-mcp

How it works

  • Built with FastMCP.

  • Calls the Open Food Facts REST API (/api/v2/product/{barcode} and /cgi/search.pl).

  • Sends a descriptive User-Agent as Open Food Facts requests, and asks only for the fields it needs to keep responses small.

Data & attribution

Product data comes from Open Food Facts and is made available under the Open Database License (ODbL). Individual contents are under the Database Contents License. Nutrition data is crowd-sourced and may be incomplete or inaccurate — do not rely on it for medical decisions.

License

MIT © 2026 — see LICENSE. This project is not affiliated with or endorsed by Open Food Facts.

Available Tools

5 tools
compare_productsA

Compare the nutrition of two or more products side by side.

ParametersJSON Schema
NameRequiredDescriptionDefault
barcodesYesA list of 2+ product barcodes (digits only).

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility. It only says 'compare nutrition side by side' without explaining the result format, whether data is fetched per product, or any side effects. The output schema exists but is not included.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, 11 words, front-loaded with purpose. Every word earns its place; no filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and an output schema, the description suffices for basic understanding. However, it omits behavioral details and usage context, which would be helpful but not critical given the low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the parameter description is already in the schema. The tool description adds no extra meaning beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool compares nutrition of products side by side, which distinguishes it from sibling tools like find_healthier_alternative (finding a single healthier option) or get_product_by_barcode (single product details). It uses a specific verb and resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use versus alternatives, but the purpose implies usage for comparing multiple products. The description does not mention exclusions or prerequisites, such as requiring at least two barcodes (though the schema enforces this).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

find_healthier_alternativeA

Suggest healthier products in the same category as the given product.

Looks up the product, then searches its category for items with a better (lower) Nutri-Score, returning the healthiest matches first.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of alternatives to return (1-10, default 5).
barcodeYesThe product barcode, digits only.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses the key behavior: looking up product, searching category for lower Nutri-Score, and returning healthiest first. It does not mention error handling or edge cases, but the core algorithm is transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: a clear purpose statement followed by a brief process explanation. No wasted words; front-loaded with the most important information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 params, 100% schema coverage, output schema present), the description covers core functionality and algorithm. It lacks edge case details but is adequate for selecting and invoking the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with both parameters documented. The description adds no additional meaning beyond the schema, meeting the baseline of 3. It does not explain barcode format beyond 'digits' or limit semantics beyond max number.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Suggest healthier products in the same category as the given product', specifying a specific verb (suggest) and resource (healthier products). It distinguishes itself from sibling tools like compare_products and search_products by focusing on health-based alternatives within a category.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a user wants healthier alternatives but lacks explicit guidance on when not to use this tool or alternatives. It mentions the lookup process but does not compare with siblings or specify prerequisites like product existence.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_nutrition_scoresA

Get the Nutri-Score, NOVA processing group and Eco-Score for a product.

ParametersJSON Schema
NameRequiredDescriptionDefault
barcodeYesThe product barcode, digits only.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries full burden. It states the tool 'gets' scores but does not disclose behavioral traits such as read-only nature, authentication requirements, rate limits, or error handling. The minimal description assumes a straightforward retrieval without explaining side effects or constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with purpose, no redundant words. Every element earns its place. Ideal conciseness for a simple retrieval tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one required parameter and an existing output schema, the description is sufficiently complete. It enumerates the specific scores returned, which is adequate for agent decision-making. Minor improvement could be minor usage context, but overall high completeness given tool simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides a description for the single parameter 'barcode' ('The product barcode, digits only.'), achieving 100% coverage. The tool description adds no further meaning, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the verb 'Get' and specifies exactly which scores (Nutri-Score, NOVA processing group, Eco-Score) are retrieved. This differentiates from sibling tools like get_product_by_barcode which returns broader product info, and compare_products/find_healthier_alternative which involve cross-product logic.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use vs alternatives. However, the tool's narrow focus on three specific scores implicitly directs use when only those scores are needed. Given the simplicity of the tool (single parameter), the lack of explicit context is acceptable but leaves room for improvement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_product_by_barcodeA

Get full nutrition facts for a food product by its barcode (EAN/UPC).

ParametersJSON Schema
NameRequiredDescriptionDefault
barcodeYesThe product barcode, digits only (e.g. "3017620422003").

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states the purpose and does not disclose behavioral traits such as read-only nature, error handling (e.g., missing barcode), or rate limits. This is insufficient for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, straightforward sentence of 13 words. It front-loads the purpose and includes no extraneous information. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (so return values need not be described) and a single parameter with full schema coverage, the description is adequate but not complete. It lacks information about error cases (e.g., barcode not found) or any behavioral context. For a simple lookup, it is minimally sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%—the parameter 'barcode' already has a clear description with format and example. The tool description adds 'full nutrition facts' but that relates to the overall output, not the parameter semantics. Therefore, it adds no additional meaning beyond the schema, meeting the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'full nutrition facts for a food product', and specifies the method 'by its barcode (EAN/UPC)'. This distinguishes it from sibling tools like search_products (search by text) or compare_products (comparison).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a barcode and want nutrition facts, but it does not provide explicit guidance on when to use this tool versus alternatives (e.g., search_products for name-based lookup). No when-not or exclusion criteria are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_productsB

Search food products by name or brand.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesFree-text search, e.g. "nutella" or "oat milk".
page_sizeNoNumber of results to return (1-25, default 5).

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description does not disclose behavioral traits such as read-only/read-write, rate limits, or result sorting, leaving gaps for the agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with verb and resource, no extraneous content—efficient and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool is a simple search with two well-documented parameters and an output schema, the description is functional but lacks behavioral and usage context that would fully support autonomous agent decision-making.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% coverage with clear param descriptions (including examples and defaults); the tool description adds no additional semantic value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool searches food products by name or brand, which distinguishes it from sibling tools like 'compare_products' or 'get_product_by_barcode'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives; the description simply states the action without mentioning exclusions or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.3.0
    • First observedcompare_products
    • First observedfind_healthier_alternative
    • First observedget_nutrition_scores
    • First observedget_product_by_barcode
    • First observedsearch_products

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: search, get product details, get scores, compare, and find alternatives. No overlaps.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with snake_case, e.g., search_products, get_product_by_barcode.

Tool Count5/5

5 tools are well-scoped for a nutrition-focused server, covering core tasks without being excessive or sparse.

Completeness4/5

The tool surface covers search, retrieval, comparison, and recommendation. Missing batch operations or category listing, but core workflows are covered.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to access the Open Food Facts database to query detailed food product information, nutritional data, and environmental scores. Supports product lookup by barcode, smart search with filtering, nutritional analysis, product comparison, and dietary recommendations to help users make informed food choices.
    5
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to search the USDA's FoodData Central database and retrieve detailed nutritional information and ingredient lists. It supports comprehensive food data access through keyword searches and structured queries for specific food items.
    3
    MIT