For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integrating with n8n AI Agent

Use n8n's AI Agent and MCP Client Tool nodes to let an agent work with your BugBug project. For example, the agent can run a named smoke test and return a short report with its status and failure evidence.

BugBug MCP requires a Pro or higher BugBug plan. This guide requires an n8n version whose MCP Client Tool supports Streamable HTTP. BugBug MCP does not provide a legacy SSE endpoint.

Before you start

You need:

  • An n8n instance with the AI Agent and MCP Client Tool nodes.

  • A BugBug project and a project API token. In BugBug, open Integrations → API and copy the project token. Treat it as a secret.

  • A named test or suite you want the agent to run.

Use a project API token dedicated to this workflow when possible. It limits the agent to that project and makes revoking the workflow's access straightforward.

Configure the MCP Client Tool

  1. Add an AI Agent node to your workflow and connect a chat model to its Chat Model input.

  2. Add an MCP Client Tool node and connect it to the AI Agent's Tool input, not its main workflow input.

  3. In the MCP Client Tool, choose HTTP Streamable or Streamable HTTP as the transport and enter this endpoint:

    https://mcp.bugbug.io/mcp
  4. Create a Bearer Auth credential in n8n. Paste the BugBug project API token as the token value; n8n adds the Bearer prefix to requests.

  5. Select only the tools needed for this first workflow. For a run-and-report flow, start with:

    • bugbug_list_projects

    • bugbug_list_tests

    • bugbug_run_test

    • bugbug_watch_run_progress

    • bugbug_get_test_run

  6. Save the credential and let n8n load the selected MCP tools.

Give the agent a narrow instruction

Add this to the AI Agent's system message, replacing the placeholders:

This keeps the initial workflow limited to reading project data and running an explicitly named test. Add tools that create, update, delete, import, or change visual-regression baselines only when the workflow has a clear human-approval step.

Test the workflow

Trigger the workflow with a request such as:

Run the Checkout smoke test and summarize the result. Do not make any changes.

On the first run, verify that the agent:

  1. Finds the intended test instead of selecting a similarly named test.

  2. Starts one run only after the request names that test.

  3. Waits for completion rather than reporting a still-running status as a result.

  4. Returns useful failure evidence, not only “failed.”

Troubleshooting

Problem
What to check

n8n cannot load BugBug tools

Confirm the endpoint is exactly https://mcp.bugbug.io/mcp and the node supports Streamable HTTP. A node that shows only an SSE endpoint cannot connect to BugBug MCP.

The server returns 401 or Invalid bearer token

Create a new project API token in BugBug and save it as an n8n Bearer Auth credential. Paste the token itself, without Bearer .

The agent does not call BugBug

Confirm that the MCP Client Tool is connected to the AI Agent's Tool input and that the system message tells the agent when to use it.

The response says a run is still in progress

Ensure bugbug_watch_run_progress is selected and instruct the agent to wait for the final status.

The agent chooses the wrong test

Require the exact test name in the trigger payload or have the agent ask when there is more than one match.

Next steps

Last updated

Was this helpful?