Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Open Food Facts MCP Serversearch for nutella and show me the nutritional info"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Open Food Facts MCP Server Walkthrough
I have successfully created a Model Context Protocol (MCP) server that interfaces with the Open Food Facts API. This server allows LLMs (like Claude via Claude Desktop) to search for products and retrieve food product details using barcodes.
Components Created
1. Server Implementation (server.py)
This file uses FastMCP to expose two tools:
get_product_by_barcode(barcode): Retrieves detailed product info (Name, Brand, Nutri-Score, Ingredients).search_products(query): Searches for products by name and returns a list of matches.
2. Validation Script (validate_server.py)
A Python script that simulates an MCP client. It connects to the local server via standard input/output (stdio) and executes both tools to verify functionality.
How to Run
Prerequisites
Ensure you have the dependencies installed:
Running the Server
You can run the server directly (it listens on stdio):
Note: This will not output anything visible to the console unless you speak JSON-RPC to it.
Verifying Functionality
Run the validation script to see the tools in action:
You should see output demonstrating a search for "nutella" and a lookup of a specific barcode.
Integration with Claude Desktop (Example)
To use this with Claude Desktop, add the following to your claude_desktop_config.json:
This will open a browser window where you can interactively search for products and look up barcodes without writing scripts.