Background Removal API Integration for AI Agents (MCP) - n8n Workflow

Leverage this specialized n8n workflow to turn the remove.bg API into an AI Agent tool using the MCP n8n trigger. Fetch balances, remove backgrounds, and automate image processing via AI.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI Developers and Engineers seeking to integrate real-world API tools into their language models.
Automation specialists utilizing n8n to build custom AI Agents.
Users needing a pre-built n8n template for image background removal automation.
DevOps personnel configuring microservices communication between n8n and AI infrastructure.

Overview

This professional n8n template solves the challenge of connecting sophisticated external APIs, like the popular remove.bg service, directly to autonomous AI agents. By utilizing the Modular Chat Protocol (MCP) n8n trigger, this architecture establishes a reliable, standardized endpoint. The entire n8n workflow operates as an AI tool server, providing three distinct functions:


  1. Background removal from images.

  2. Checking the current account credit balance.

  3. Submitting images to the improvement program.

This configuration ensures that AI agents can utilize these image processing tools dynamically. The structure of this n8n node setup guarantees secure communication, leveraging API Key authentication defined within the generic n8n credentials.

How it Works

The n8n workflow initializes with the 'Background Removal MCP Server' n8n trigger, which acts as the listening endpoint for the AI agent. When an AI agent decides it needs to perform an image operation (e.g., removing a background), it sends a request to the URL exposed by this n8n trigger, specifying the desired tool function.


  1. Trigger Activation: The specialized MCP n8n trigger receives the request, automatically routing it based on the tool requested by the AI.

  2. Tool Execution: Depending on the request, one of the three linked httpRequestTool n8n node components is executed.

  3. Parameter Handling: If required (such as providing an image URL or file), parameters are dynamically populated using expressions like $fromAI(), which is a core feature of these n8n templates.

  4. API Call: The selected httpRequestTool n8n node makes the corresponding authenticated request to the remove.bg API.

  5. Response: The result from the third-party API is immediately returned back through the initial MCP n8n trigger to the requesting AI agent, allowing the AI to integrate the image processing results into its larger operational context. This entire setup demonstrates a highly functional, custom-built n8n workflow.

Installation Guide

To deploy this powerful n8n template and start your AI Agent MCP server, follow these steps:


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

  2. Configure Credentials: This n8n workflow requires API Key authentication for remove.bg.

Go to Credentials in n8n.
Create a new credential of the type HTTP Header Auth.
Set the Key Name to X-API-Key.
Paste your remove.bg API Key as the Key Value.

  1. Activate: Enable the 'Background Removal MCP Server' n8n workflow.

  2. Obtain MCP URL: Copy the generated webhook URL from the 'Background Removal MCP Server' n8n trigger node.

  3. AI Agent Setup: Configure your AI Agent (e.g., LangChain, OpenAI Assistant) to use the copied MCP URL as the endpoint for its Background Removal toolset.

Node Details

The n8n workflow is built around a central n8n trigger and several httpRequestTool n8n node components:

Background Removal MCP Server (n8n Trigger):
Function: Serves as the primary entry point for AI Agent requests using the Modular Chat Protocol (MCP). This specialized n8n trigger defines the tools available to the AI.
Key Configuration: Path is set to /background-removal-mcp.

Fetch Account Balance (n8n Node - HTTP Request Tool):
Function: Queries the remove.bg API to retrieve the current credit balance and free call count.
Key Configuration: URL https://api.remove.bg/v1.0/account, Method GET, uses the generic HTTP Header n8n credential.

Submit Image for Improvement (n8n Node - HTTP Request Tool):
Function: Allows the AI agent to submit images that failed background removal into the remove.bg Improvement Program.
Key Configuration: URL https://api.remove.bg/v1.0/improve, Method POST, configured as an available tool for the n8n workflow.

Remove Image Background (n8n Node - HTTP Request Tool):
Function: The core functionality of this n8n workflow. Executes the image background removal process.
Key Configuration: URL https://api.remove.bg/v1.0/removebg, Method POST, authenticates using the shared API key.

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*