Chomp Food Database API Exposure for AI Agents (MCP Server) - n8n Workflow

Use this n8n workflow to expose the Chomp Food Database API to AI agents using the powerful MCP trigger. Enable food data lookups via barcode, name, or search parameters using a dedicated n8n node.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • AI Agent developers who need reliable, structured access to food and nutrition data.

  • Nutrition application creators looking to integrate barcode lookup functionality.

  • Automation Specialists building custom large language model (LLM) toolkits.

  • Users seeking pre-built n8n templates for advanced serverless API exposure.

Overview

This comprehensive n8n workflow is designed to bridge the gap between AI agents and specific external APIs, turning the Chomp Food Database API into a reliable toolset for LLMs. This specialized n8n templates solution utilizes the Multi-Component Processor (MCP) functionality, enabling developers to expose four distinct food data operations (lookup by barcode, name, search parameters, or ingredient search) via a single, secure server endpoint. The primary benefit of this n8n automation is transforming complex API documentation into structured, AI-consumable functions, allowing agents to execute precise data queries and return raw results efficiently. This setup maximizes the utility of your n8n workflow by ensuring AI agents have real-time, accurate data access.

How it Works

The operational flow begins with the specialized MCP n8n trigger, which acts as the server endpoint. This n8n node is configured to listen for requests from external AI agents (like LangChain or similar frameworks). The MCP trigger analyzes the incoming query and delegates the task to the appropriate connected tool—in this case, one of the four HTTP Request nodes. Each HTTP Request n8n node is pre-configured to handle a specific food database function (e.g., searching by barcode or ingredient). Crucially, the parameters required for these API calls (like code, name, or limit) are dynamically populated using the $fromAI() expression. This ensures the AI agent intelligently supplies the necessary arguments without manual intervention. Once the correct node executes the request to the Chomp API, the raw data response is captured and returned directly by the MCP trigger to the initiating AI agent, completing the request cycle seamlessly within the n8n workflow.

Installation Guide


  1. Import the n8n workflow: Load the provided JSON data into your n8n instance.

  2. Configure Credentials: Set up a generic API key credential for the HTTP Request nodes.

- Authentication Type: API Key in Query
- Key Name: api_key
- Obtain the actual key by subscribing to the Chomp API.

  1. Activate the n8n workflow: Enable the workflow to start the MCP server endpoint.

  2. Retrieve the MCP URL: Copy the unique webhook URL generated by the MCP trigger n8n node.

  3. Connect to AI Agent: Use the copied MCP URL when configuring the external AI agent (e.g., in LangChain tool configuration) to allow it to utilize these four food database tools.

Node Details

Chomp Food Database API Documentation MCP Server (MCP Trigger n8n node): Serves as the central server endpoint for the AI agent. It receives the AI's intent and directs the request to the appropriate tool, ensuring the entire n8n workflow functions as a cohesive service.
Get Branded Food by Barcode (HTTP Request Tool n8n node): Fetches detailed branded food information using a UPC/EAN barcode. Key Configuration: Uses ={{ $fromAI('code', ...) }} to extract the required barcode from the AI request.
Get Branded Food by Name (HTTP Request Tool n8n node): Allows searching for branded food items using a general name keyword. Key Configuration: Uses $fromAI() for name, limit, and page parameters, making pagination and search terms AI-driven.
Search Branded Food Items (HTTP Request Tool n8n node): Provides advanced search capabilities, allowing filtering by numerous parameters like allergen, brand, category, ingredient, and vitamin. Key Configuration: This n8n node exposes a wide range of optional $fromAI() parameters, providing maximum flexibility to the AI agent.


  • Search Food Ingredients (HTTP Request Tool n8n node): Used to look up raw or generic food ingredients, supporting single or comma-separated lists (up to 10 items). Key Configuration: Takes the required find parameter and an optional limit via $fromAI() expressions.

Related n8n Workflows

Free

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by

A hacker by nature, programmer by trade ⚒️ I'm looking to collaborate on things that save human labor 📫 How to reach me Github👇 -> Discord

Featured*