> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leapter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use your blueprints in an n8n AI agent

> Download the MCP workflow from the Admin UI: an n8n AI agent that has the application's blueprints as tools and calls them over MCP with your evaluation key.

The **MCP workflow** is an n8n AI agent with a chat. Its tools are the callable blueprints of one application: the agent connects to the application's MCP address with your evaluation key, and a chat model decides which blueprint to call. Use it when people should ask questions in a chat and get answers that come from your blueprints.

## Before you start

* The application is deployed and has an evaluation key ([Deploy a release and call it](https://docs.leapter.com/rc/user-guide/deploy-and-call.md), [Create and revoke an evaluation key](https://docs.leapter.com/rc/user-guide/evaluation-keys.md)).
* You can sign in to the Admin UI, and you hold `content:read` in the environment, for example as an auditor. Without it, the **n8n** card says "You need the content:read right".
* An n8n instance that can reach the runtime cluster. The steps were run with n8n 2.44.5; other versions may name the menu items differently.
* An account with a chat model provider that n8n supports, such as OpenAI or Anthropic, and its credentials.

## Steps

**1. Download the workflow**

Open the Admin UI (the cluster address followed by `/runtime-management/ui/`), click **Sign in with Leapter** and sign in with the account you use for the Lab. The Admin UI may open on another environment: click the environment's name at the bottom of the sidebar and choose yours in the list that opens. Then click the application's name on the **Status** page, and scroll down to the **n8n** card. Under **MCP**, click **MCP workflow**. Your browser saves a file such as `pizza-pricing-calculator-180269-playground-mcp.json`.

![The Admin UI application page, scrolled to the n8n card. Under MCP, the row One agent workflow for the whole application has the button MCP workflow with a green ring. Under Blueprints, Pizza Pricing has the buttons HTTP workflow and Code workflow.](https://mintcdn.com/leapter/3NthIZmfsFFgUhyn/rc/user-guide/images/admin-n8n-mcp-workflow.png?fit=max\&auto=format\&n=3NthIZmfsFFgUhyn\&q=85\&s=89085ecc0e92a3a37b920cbff287647c)

The MCP workflow button: one workflow for the whole application.

**2. Import it into n8n**

Sign in to n8n and create a new workflow: click **+** at the top of the left sidebar, then **New workflow**. Open the workflow menu (**…** next to the workflow name), choose **Import**, then **From file**, and select the downloaded file.

The workflow is renamed to "MCP Agent" followed by the name the project has in the Lab, for example "MCP Agent - Pizza Pricing Calculator". You should see four nodes. **When chat message received** leads to **AI Agent**. Below **AI Agent** hang **Simple Memory** (its memory) and **MCP Client** (its tools). **AI Agent** and **MCP Client** show a red warning sign: the agent has no chat model yet, and the MCP Client has no key yet.

**3. Add your key to the MCP Client**

Double-click the node **MCP Client**. **Endpoint** already holds the application's MCP address, **Server Transport** is **HTTP Streamable** and **Authentication** is **Header Auth**.

Under **Credential for Header Auth**, click **Connect to Header Auth**. In the dialog **Header Auth account**, fill in:

| Field | Value |
| :- | :- |
| Name | `X-API-Key` |
| Value | your evaluation key |

Click **Save**. n8n says "Credential successfully created inside your personal space", and **Credential for Header Auth** shows **Header Auth account**.

If your n8n already has a Header Auth credential, n8n fills it in instead of showing **Connect to Header Auth**. Unless that credential holds an evaluation key of this application, open the list under **Credential for Header Auth**, choose **Create new credential** and fill in the dialog as above.

**4. Check the connection**

In the open node **MCP Client**, click **Execute step**. The dialog **Test MCP Client** opens. Click the **Tool name** list: it shows one tool per callable blueprint of the application, here `pizza_pricing`. n8n read this list from the runtime cluster with your key.

![The n8n dialog Test MCP Client, with the text Provide the data that would normally come from the AI Agent node. The Tool name list is open and shows one entry, pizza\_pricing, with a green ring.](https://mintcdn.com/leapter/3NthIZmfsFFgUhyn/rc/user-guide/images/n8n-mcp-test-tools.png?fit=max\&auto=format\&n=3NthIZmfsFFgUhyn\&q=85\&s=b5a92c6046aa7dd04fdf143c813d2ca3)

The Tool name list shows the blueprint pizza\_pricing as a tool.

Close the dialog with **×** without choosing a tool, and close the node with **×** at its top right. On the canvas, **MCP Client** has no warning sign any more. **AI Agent** keeps its warning until it has a chat model.

**5. Connect a chat model**

On the canvas, click **+** under **Chat Model** on the node **AI Agent**. n8n opens the list **Language Models**. Choose the node of your provider, for example **Anthropic Chat Model** or **OpenAI Chat Model**, and create its credential with your provider's key. n8n's page for each node describes its credential, for example [OpenAI Chat Model](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/).

![The imported MCP workflow in n8n. When chat message received leads to AI Agent, which has a red warning sign. Under AI Agent, the connector Chat Model with a red star and a plus button has a green ring; Memory leads to Simple Memory and Tool leads to MCP Client.](https://mintcdn.com/leapter/3NthIZmfsFFgUhyn/rc/user-guide/images/n8n-mcp-workflow.png?fit=max\&auto=format\&n=3NthIZmfsFFgUhyn\&q=85\&s=2719773f828c74b7cae65d541567d40c)

The AI Agent still needs a chat model: Chat Model has a red star until one is connected.

**6. Chat with the agent**

Click **Open chat** below the canvas. Ask a question that a blueprint answers, for example "What does a large pizza with thin crust, mushroom and olive cost on a Friday?".

## Result

The agent has the application's blueprints as tools and can call `pizza_pricing` through the MCP Client to answer in the chat. The chat model decides which tool to call and how to word the answer. Each tool call is a run of the release, recorded like any other call ([Find a run and read usage](https://docs.leapter.com/rc/user-guide/runs-and-usage.md)).

The MCP address names no release. The agent always reaches the release the environment serves at the time of the call, so after a deploy or a roll back you do not need to download the workflow again.

## Troubleshooting

**The dialog Test MCP Client says "Could not connect to your MCP server. Authentication failed."** The value of the credential is not an evaluation key of this application, or the key is revoked. Open the credential with the pencil next to **Credential for Header Auth**, enter the right key in **Value** and click **Save**.

**After you choose `pizza_pricing` under Tool name, the dialog Test MCP Client says "Cannot read properties of undefined (reading 'inputType')".** n8n 2.44.5 shows this after a tool is chosen in that dialog. The check only needs the list: close the dialog with **×**.

**After Sign in with Leapter, you are in the Lab and not in the Admin UI, or the Lab says "This sign-in cannot go on." and "authorization not found".** Open the Admin UI's address again and click **Sign in with Leapter** once more. The **Status** page opens.

## What to do next

* [Connect an MCP client to a release](https://docs.leapter.com/rc/user-guide/connect-mcp.md): the same MCP address in Claude Code, Claude Desktop or Cursor.
* [Create and revoke an evaluation key](https://docs.leapter.com/rc/user-guide/evaluation-keys.md): give the n8n instance its own key.
* [Find a run and read usage](https://docs.leapter.com/rc/user-guide/runs-and-usage.md): see the runs the agent made.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.