Logo de N8n Nodes MCP

N8n Nodes MCP

ComunidadePopular
nerding-io

n8n custom node for MCP

Publicado pornerding-io
Repositórion8n-nodes-mcp
IdiomaTypeScript
Forks
520
Estrelas
3K
Ferramentas disponíveis
0
Tipo de transportestdio
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    N8n Nodes MCP disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    3K estrelas e 520 forks no repositório vinculado.

Verified on MseeP

n8n-nodes-mcp-client

Important Note: The Server-Sent Events (SSE) transport is deprecated and replaced by the new HTTP Streamable transport. SSE remains available for legacy compatibility, but HTTP Streamable is now the recommended method for all new implementations.

This is an n8n community node that lets you interact with Model Context Protocol (MCP) servers in your n8n workflows.

MCP is a protocol that enables AI models to interact with external tools and data sources in a standardized way. This node allows you to connect to MCP servers, access resources, execute tools, and use prompts.

n8n is a fair-code licensed workflow automation platform.

Installation Credentials Environment Variables Operations Using as a Tool Compatibility Resources

Getting Started

Official Quickstart Video:

MCP Client Node Quickstart

Community Videos

Shoutout to all the creators of the following n8n community videos that are great resources for learning how to use this node:

If you have a great video that you'd like to share, please let me know and I'll add it to the list!

Interested a deeper dive into MCP?

Check out my YouTube Series MCP Explained for more information about the Model Context Protocol.

Security Assessment

MseeP.ai Security Assessment Badge

Installation

Follow the installation guide in the n8n community nodes documentation.

Also pay attention to Environment Variables for using tools in AI Agents. It's mandatory to set the N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE environment variable to true if you want to use the MCP Client node as a tool in AI Agents.

Credentials

The MCP Client node supports three types of credentials to connect to an MCP server:

Command-line Based Transport (STDIO)

MCP Client STDIO Credentials

  • Command: The command to start the MCP server
  • Arguments: Optional arguments to pass to the server command
  • Environment Variables: Variables to pass to the server in NAME=VALUE format

HTTP Streamable Transport (Recommended)

  • HTTP Streamable URL: The HTTP endpoint that supports streaming responses (e.g., http://localhost:3001/stream)
  • Additional Headers: Optional headers to send with requests (format: name:value, one per line)

HTTP Streamable is the recommended and modern method for all new integrations, providing better efficiency and flexibility compared to SSE.

Example: Using a Local MCP Server with HTTP Streamable

This example shows how to connect to a locally running MCP server using HTTP Streamable:

  1. Start a local MCP server that supports HTTP Streamable:

    bash
    npx @modelcontextprotocol/server-example-streamable
  2. Configure MCP Client credentials:

    • In the node settings, select Connection Type: HTTP Streamable
    • Create new credentials of type MCP Client (HTTP Streamable) API
    • Set HTTP Streamable URL: http://localhost:3001/stream
    • Add any required headers for authentication
  3. Create a workflow using the MCP Client node:

    • Add an MCP Client node
    • Set the Connection Type to HTTP Streamable
    • Select your HTTP Streamable credentials
    • Execute the workflow to see the results

Server-Sent Events (SSE) Transport (Deprecated, still available for legacy use)

  • SSE URL: The URL of the SSE endpoint (default: http://localhost:3001/sse)
  • Messages Post Endpoint: Optional custom endpoint for posting messages if different from the SSE URL
  • Additional Headers: Optional headers to send with requests (format: name:value, one per line)

Deprecated: SSE is deprecated and will not receive further updates, but remains available for legacy compatibility. For new projects, use HTTP Streamable.

Example: Using a Local MCP Server with SSE (legacy)

This example shows how to connect to a locally running MCP server using Server-Sent Events (SSE):

  1. Start a local MCP server that supports SSE:

    bash
    npx @modelcontextprotocol/server-example-sse
  2. Configure MCP Client credentials:

    • In the node settings, select Connection Type: Server-Sent Events (SSE)
    • Create new credentials of type MCP Client (SSE) API
    • Set SSE URL: http://localhost:3001/sse
    • Add any required headers for authentication
  3. Create a workflow using the MCP Client node:

    • Add an MCP Client node
    • Set the Connection Type to Server-Sent Events (SSE)
    • Select your SSE credentials
    • Execute the workflow to see the results

Note: For new projects, HTTP Streamable is strongly recommended.

Environment Variables

The MCP Client node supports passing environment variables to MCP servers using the command-line based transport in two ways:

1. Using the Credentials UI

You can add environment variables directly in the credentials configuration:

Environment Variables in Credentials

This method is useful for individual setups and testing. The values are stored securely as credentials in n8n.

2. Using Docker Environment Variables

For Docker deployments, you can pass environment variables directly to your MCP servers by prefixing them with MCP_:

yaml
version: '3'

services:
  n8n:
    image: n8nio/n8n
    environment:
      - MCP_BRAVE_API_KEY=your-api-key-here
      - MCP_OPENAI_API_KEY=your-openai-key-here
      - MCP_CUSTOM_SETTING=some-value
    # other configuration...

These environment variables will be automatically passed to your MCP servers when they are executed.

Example: Using Brave Search MCP Server

This example shows how to set up and use the Brave Search MCP server:

  1. Install the Brave Search MCP server:

    bash
    npm install -g @modelcontextprotocol/server-brave-search
  2. Configure MCP Client credentials:

    • Command: npx
    • Arguments: -y @modelcontextprotocol/server-brave-search
    • Environment Variables: BRAVE_API_KEY=your-api-key Add a variables (space comma or newline separated)
  3. Create a workflow that uses the MCP Client node:

    • Add an MCP Client node
    • Select the "List Tools" operation to see available search tools
    • Add another MCP Client node
    • Select the "Execute Tool" operation
    • Choose the "brave_search" tool
    • Set Parameters to: {"query": "latest AI news"}

Brave Search Example

The node will execute the search and return the results in the output.

Example: Multi-Server Setup with AI Agent

This example demonstrates how to set up multiple MCP servers in a production environment and use them with an AI agent:

  1. Configure your docker-compose.yml file:
yaml
version: '3'

services:
  n8n:
    image: n8nio/n8n
    environment:
      # MCP server environment variables
      - MCP_BRAVE_API_KEY=your-brave-api-key
      - MCP_OPENAI_API_KEY=your-openai-key
      - MCP_SERPER_API_KEY=your-serper-key
      - MCP_WEATHER_API_KEY=your-weather-api-key

      # Enable community nodes as tools
      - N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
    ports:
      - "5678:5678"
    volumes:
      - ~/.n8n:/home/node/.n8n
  1. Create multiple MCP Client credentials in n8n:

    Brave Search Credentials:

    • Command: npx
    • Arguments: -y @modelcontextprotocol/server-brave-search

    OpenAI Tools Credentials:

    • Command: npx
    • Arguments: -y @modelcontextprotocol/server-openai

    Web Search Credentials:

    • Command: npx
    • Arguments: -y @modelcontextprotocol/server-serper

    Weather API Credentials:

    • Command: npx
    • Arguments: -y @modelcontextprotocol/server-weather
  2. Create an AI Agent workflow:

    • Add an AI Agent node
    • Enable MCP Client as a tool
    • Configure different MCP Client nodes with different credentials
    • Create a prompt that uses multiple data sources

Multi-Server Setup

Example AI Agent prompt:

I need you to help me plan a trip. First, search for popular destinations in {destination_country}.
Then, check the current weather in the top 3 cities.
Finally, find some recent news about travel restrictions for these places.

With this setup, the AI agent can use multiple MCP tools across different servers, all using environment variables configured in your Docker deployment.

Operations

The MCP Client node supports the following operations:

MCP Client Operations

  • Execute Tool - Execute a specific tool with parameters
  • Get Prompt - Get a specific prompt template
  • List Prompts - Get a list of available prompts
  • List Resources - Get a list of available resources from the MCP server
  • List Tools - Get a list of available tools
  • Read Resource - Read a specific resource by URI

Example: List Tools Operation

List Tools Example

The List Tools operation returns all available tools from the MCP server, including their names, descriptions, and parameter schemas.

Example: Execute Tool Operation

Execute Tool Example

The Execute Tool operation allows you to execute a specific tool with parameters. Make sure to select the tool you want to execute from the dropdown menu.

Using as a Tool

This node can be used as a tool in n8n AI Agents. To enable community nodes as tools, you need to set the N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE environment variable to true.

Setting the Environment Variable

If you're using a bash/zsh shell:

bash
export N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
n8n start

If you're using Docker: Add to your docker-compose.yml file:

yaml
environment:
  - N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true

If you're using the desktop app: Create a .env file in the n8n directory:

N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true

If you want to set it permanently on Mac/Linux: Add to your ~/.zshrc or ~/.bash_profile:

bash
export N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true

Example of an AI Agent workflow results:

AI Agent Example

After setting this environment variable and restarting n8n, your MCP Client node will be available as a tool in AI Agent nodes.

Compatibility

  • Requires n8n version 1.0.0 or later
  • Compatible with MCP Protocol version 1.0.0 or later
  • Supports both STDIO and SSE transports for connecting to MCP servers
  • SSE transport requires a server that implements the MCP Server-Sent Events specification

Resources

Use o MCP de N8n Nodes MCP com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar N8n Nodes MCP, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione N8n Nodes MCP como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de N8n Nodes MCP.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "n8n-nodes-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de N8n Nodes MCP, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de N8n Nodes MCP.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar N8n Nodes MCP para me ajudar nesta tarefa?
N8n Nodes MCP
Claro. Já li.
Veja o que encontrei usando N8n Nodes MCP.

Perguntas frequentes

Para que serve o servidor MCP N8n Nodes MCP?

N8n Nodes MCP é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP N8n Nodes MCP com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar N8n Nodes MCP com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP N8n Nodes MCP com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com N8n Nodes MCP conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP N8n Nodes MCP ao TypingMind?

N8n Nodes MCP funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP N8n Nodes MCP oferece no TypingMind?

N8n Nodes MCP disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP N8n Nodes MCP?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se N8n Nodes MCP exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇