mcp-open-food-facts
v1.0.0
Published
MCP server to use Open Food Facts API
Downloads
9
Maintainers
Readme
MCP Open Food Facts Server
An MCP (Model Context Protocol) server that provides access to the Open Food Facts API, enabling searches and queries for nutritional information of food products.
🚀 Features
- Product search by name
- Product search by barcode
- Detailed product information retrieval
- MCP protocol integration
- TypeScript support
📋 Prerequisites
- Node.js (version 18 or higher)
- npm or yarn
- TypeScript
🔧 Installation
- Clone the repository:
git clone https://github.com/PayCode-Studio/mcp-open-food-facts
cd mcp-open-food-facts- Install dependencies:
npm install
# or
yarn install🚀 Usage
Development
To run the server in development mode:
npm run dev
# or
yarn devProduction
To build and run in production:
npm run build
npm start
# or
yarn build
yarn start📦 Project Structure
mcp-open-food-facts/
├── src/
│ ├── index.ts # Application entry point
│ ├── services/ # Application services
│ │ └── open-food-facts.services.ts
│ └── types/ # TypeScript type definitions
│ ├── mcp.type.ts
│ └── open-food-facts.type.ts
├── dist/ # Compiled code
├── package.json
├── tsconfig.json
└── README.md🔍 API
Product Search
Search by Name
const products = await searchProduct("coca cola");Search by Barcode
const product = await getProductByBarcode("5449000000996");Response
The API returns detailed information about products, including:
- Nutritional information
- Ingredients
- Allergens
- Brand
- Categories
- Ecoscore score
- And more...
🤝 Contribution
- Fork the project
- Create a branch for your feature (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📝 License
This project is under the ISC License. See the LICENSE file for more details.
✨ Author
cisco_juan - Initial Work - cisco_juan
🙏 Thanks
- Open Food Facts for providing the API
- Model Context Protocol for the MCP framework
- All contributors who participate in this project
📞 Support
If you have any questions or problems, please:
- Check existing issues
- Open a new issue if necessary
- Contact the maintenance team
Made with ❤️ by the community of developers
