Skip to main content

MCP Agent Workflow

Leapter can generate an n8n workflow that creates an AI agent with access to all your project’s Blueprints as tools. The agent uses the Model Context Protocol (MCP) to call your Blueprints, so users can interact with your logic through a chat interface.

What this creates

The MCP Agent Workflow is a 4-node n8n workflow:
NodePurpose
Chat TriggerProvides a chat interface for users to interact with the agent
AI AgentThe AI agent that reasons about user messages and calls tools
MCP ClientConnects to your Leapter project via MCP, exposing all published Blueprints as tools
Simple MemoryMaintains conversation context across messages

Export the workflow

  1. Open any Blueprint in the editor.
  2. Click the Share button in the toolbar.
  3. Select n8n.
  4. In the Export to n8n dialog, select the MCP Agent Workflow tab.
  5. Click Copy to Clipboard.
The Export to n8n dialog showing the MCP Agent Workflow tab

Import into n8n

  1. Open your n8n instance.
  2. Create a new workflow.
  3. Click the three-dot menu (or use Ctrl+V / Cmd+V) and select Import from clipboard.
  4. The 4-node workflow appears on the canvas.

Post-import setup

After importing, you need to configure two things before the workflow can run.

Connect an AI model

  1. Open the AI Agent node.
  2. Connect an AI model (OpenAI, Anthropic, Google, or any supported provider).
  3. Configure the model credentials if you have not already set them up in n8n.

Configure the MCP Client

  1. Open the MCP Client node.
  2. Create a Header Auth credential:
    • Header name: X-API-Key
    • Header value: your Leapter API key
  3. Save the credential.
See API Keys to create a key if you have not already.

Run the workflow

  1. Click Test Workflow (or Chat in the bottom panel) to open the chat interface.
  2. Type a message that relates to your Blueprint’s logic.
  3. The AI agent decides which Blueprint(s) to call, executes them via MCP, and returns a natural language response.
All published Blueprints in your project are available as tools — the agent automatically discovers them through the MCP connection.

What to do next