Skip to content
Back to search

n8n-nodes-mcp

n8n custom node for MCP

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/nerding-io--n8n-nodes-mcp/badge.svg)](/listings/nerding-io--n8n-nodes-mcp)

HTML

<a href="/listings/nerding-io--n8n-nodes-mcp"><img src="/api/listings/nerding-io--n8n-nodes-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.

Also pay attention to Environment Variables for [using tools in AI Agents](#using-as-a-tool). 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.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 324 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![Verified on MseeP](https://mseep.ai/badge.svg)](https://mseep.ai/app/bd76f121-1c8f-4f5d-9c65-1eac5d81b6af)
  2. # n8n-nodes-mcp-client
  3. > **Important Note:**
  4. > 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.
  5. This is an n8n community node that lets you interact with Model Context Protocol (MCP) servers in your n8n workflows.
  6. 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.
  7. [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
  8. [Installation](#installation)
  9. [Credentials](#credentials)
  10. [Environment Variables](#environment-variables)
  11. [Operations](#operations)
  12. [Using as a Tool](#using-as-a-tool)
  13. [Compatibility](#compatibility)
  14. [Resources](#resources)
  15. ## Getting Started
  16. Official Quickstart Video:
  17. [![MCP Client Node Quickstart](/assets/mcp-n8n.png)](https://youtu.be/1t8DQL-jUJk)
  18. ### Community Videos
  19. Shoutout to all the creators of the following n8n community videos that are great resources for learning how to use this node:
  20. - [Is MCP the Future of N8N AI Agents? (Fully Tested!)](https://youtu.be/sb5hCcFYPIE)
  21. - [Connect N8N AI Agents to EVERYTHING using MCP?](https://youtu.be/tTDRgkD-120)
  22. - [Build an AI Agent That Can Use Any Tool (MCP in n8n Tutorial)](https://www.youtube.com/watch?v=SVZe2rdhYmA)
  23. - [The NEW N8N MCP is an Absolute Game-Changer (Brave Search MCP)](https://youtu.be/RxXS_FpJyGM)
  24. - [MCP & n8n Automation: The Ultimate Guide for MCP AI Agents (2025)](https://www.youtube.com/watch?v=mbQsnrxHPwE)
  25. - [REVOLUÇÃO na criação de AGENTES no N8N com o MCP Server!!!](https://www.youtube.com/watch?v=zgH85dJcs5c) (Portuguese)
  26. If you have a great video that you'd like to share, please let me know and I'll add it to the list!
  27. #### Interested a deeper dive into MCP?
  28. Check out my YouTube Series [MCP Explained](https://www.youtube.com/playlist?list=PLjOCx_PNfJ4S_oOSqrMi6t9_x1GllvQZO) for more information about the Model Context Protocol.
  29. ### Security Assessment
  30. [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/nerding-io-n8n-nodes-mcp-badge.png)](https://mseep.ai/app/nerding-io-n8n-nodes-mcp)
  31. ## Installation
  32. Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
  33. Also pay attention to Environment Variables for [using tools in AI Agents](#using-as-a-tool). 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.
  34. ## Credentials
  35. The MCP Client node supports three types of credentials to connect to an MCP server:
  36. ### Command-line Based Transport (STDIO)
  37. ![MCP Client STDIO Credentials](./assets/credentials.png)
  38. - **Command**: The command to start the MCP server
  39. - **Arguments**: Optional arguments to pass to the server command
  40. - **Environment Variables**: Variables to pass to the server in NAME=VALUE format
  41. ### HTTP Streamable Transport (Recommended)
  42. - **HTTP Streamable URL**: The HTTP endpoint that supports streaming responses (e.g., http://localhost:3001/stream)
  43. - **Additional Headers**: Optional headers to send with requests (format: name:value, one per line)
  44. HTTP Streamable is the recommended and modern method for all new integrations, providing better efficiency and flexibility compared to SSE.
  45. #### Example: Using a Local MCP Server with HTTP Streamable
  46. This example shows how to connect to a locally running MCP server using HTTP Streamable:
  47. 1. Start a local MCP server that supports HTTP Streamable:
  48. ```bash
  49. npx @modelcontextprotocol/server-example-streamable
  50. ```
  51. 2. Configure MCP Client credentials:
  52. - In the node settings, select **Connection Type**: `HTTP Streamable`
  53. - Create new credentials of type **MCP Client (HTTP Streamable) API**
  54. - Set **HTTP Streamable URL**: `http://localhost:3001/stream`
  55. - Add any required headers for authentication
  56. 3. Create a workflow using the MCP Client node:
  57. - Add an MCP Client node
  58. - Set the Connection Type to `HTTP Streamable`
  59. - Select your HTTP Streamable credentials
  60. - Execute the workflow to see the results
  61. ### Server-Sent Events (SSE) Transport (Deprecated, still available for legacy use)
  62. - **SSE URL**: The URL of the SSE endpoint (default: http://localhost:3001/sse)
  63. - **Messages Post Endpoint**: Optional custom endpoint for posting messages if different from the SSE URL
  64. - **Additional Headers**: Optional headers to send with requests (format: name:value, one per line)
  65. > **Deprecated:** SSE is deprecated and will not receive further updates, but remains available for legacy compatibility. For new projects, use HTTP Streamable.
  66. #### Example: Using a Local MCP Server with SSE (legacy)
  67. This example shows how to connect to a locally running MCP server using Server-Sent Events (SSE):
  68. 1. Start a local MCP server that supports SSE:
  69. ```bash
  70. npx @modelcontextprotocol/server-example-sse
  71. ```
  72. 2. Configure MCP Client credentials:
  73. - In the node settings, select **Connection Type**: `Server-Sent Events (SSE)`
  74. - Create new credentials of type **MCP Client (SSE) API**
  75. - Set **SSE URL**: `http://localhost:3001/sse`
  76. - Add any required headers for authentication
  77. 3. Create a workflow using the MCP Client node:
  78. - Add an MCP Client node
  79. - Set the Connection Type to `Server-Sent Events (SSE)`
  80. - Select your SSE credentials
  81. - Execute the workflow to see the results
  82. > **Note:** For new projects, HTTP Streamable is strongly recommended.
  83. ## Environment Variables
  84. The MCP Client node supports passing environment variables to MCP servers using the command-line based transport in two ways:
  85. ### 1. Using the Credentials UI
  86. You can add environment variables directly in the credentials configuration:
  87. ![Environment Variables in Credentials](./assets/credentials-envs.png)
  88. This method is useful for individual setups and testing. The values are stored securely as credentials in n8n.
  89. ### 2. Using Docker Environment Variables
  90. For Docker deployments, you can pass environment variables directly to your MCP servers by prefixing them with `MCP_`:
  91. ```yaml
  92. version: '3'
  93. services:
  94. n8n:
  95. image: n8nio/n8n
  96. environment:
  97. - MCP_BRAVE_API_KEY=your-api-key-here
  98. - MCP_OPENAI_API_KEY=your-openai-key-here
  99. - MCP_CUSTOM_SETTING=some-value
  100. # other configuration...
  101. ```
  102. These environment variables will be automatically passed to your MCP servers when they are executed.
  103. ### Example: Using Brave Search MCP Server
  104. This example shows how to set up and use the Brave Search MCP server:
  105. 1. Install the Brave Search MCP server:
  106. ```bash
  107. npm install -g @modelcontextprotocol/server-brave-search
  108. ```
  109. 2. Configure MCP Client credentials:
  110. - **Command**: `npx`
  111. - **Arguments**: `-y @modelcontextprotocol/server-brave-search`
  112. - **Environment Variables**: `BRAVE_API_KEY=your-api-key` Add a variables (space comma or newline separated)
  113. 3. Create a workflow that uses the MCP Client node:
  114. - Add an MCP Client node
  115. - Select the "List Tools" operation to see available search tools
  116. - Add another MCP Client node
  117. - Select the "Execute Tool" operation
  118. - Choose the "brave_search" tool
  119. - Set Parameters to: `{"query": "latest AI news"}`
  120. ![Brave Search Example](./assets/brave-search-example.png)
  121. The node will execute the search and return the results in the output.
  122. ### Example: Multi-Server Setup with AI Agent
  123. This example demonstrates how to set up multiple MCP servers in a production environment and use them with an AI agent:
  124. 1. Configure your docker-compose.yml file:
  125. ```yaml
  126. version: '3'
  127. services:
  128. n8n:
  129. image: n8nio/n8n
  130. environment:
  131. # MCP server environment variables
  132. - MCP_BRAVE_API_KEY=your-brave-api-key
  133. - MCP_OPENAI_API_KEY=your-openai-key
  134. - MCP_SERPER_API_KEY=your-serper-key
  135. - MCP_WEATHER_API_KEY=your-weather-api-key
  136. # Enable community nodes as tools
  137. - N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
  138. ports:
  139. - "5678:5678"
  140. volumes:
  141. - ~/.n8n:/home/node/.n8n
  142. ```
  143. 2. Create multiple MCP Client credentials in n8n:
  144. **Brave Search Credentials**:
  145. - Command: `npx`
  146. - Arguments: `-y @modelcontextprotocol/server-brave-search`
  147. **OpenAI Tools Credentials**:
  148. - Command: `npx`
  149. - Arguments: `-y @modelcontextprotocol/server-openai`
  150. **Web Search Credentials**:
  151. - Command: `npx`
  152. - Arguments: `-y @modelcontextprotocol/server-serper`
  153. **Weather API Credentials**:
  154. - Command: `npx`
  155. - Arguments: `-y @modelcontextprotocol/server-weather`
  156. 3. Create an AI Agent workflow:
  157. - Add an AI Agent node
  158. - Enable MCP Client as a tool
  159. - Configure different MCP Client nodes with different credentials
  160. - Create a prompt that uses multiple data sources
  161. ![Multi-Server Setup](./assets/multi-server-example.png)
  162. Example AI Agent prompt:
  163. ```
  164. I need you to help me plan a trip. First, search for popular destinations in {destination_country}.
  165. Then, check the current weather in the top 3 cities.
  166. Finally, find some recent news about travel restrictions for these places.
  167. ```
  168. With this setup, the AI agent can use multiple MCP tools across different servers, all using environment variables configured in your Docker deployment.
  169. ## Operations
  170. The MCP Client node supports the following operations:
  171. ![MCP Client Operations](./assets/operations.png)
  172. - **Execute Tool** - Execute a specific tool with parameters
  173. - **Get Prompt** - Get a specific prompt template
  174. - **List Prompts** - Get a list of available prompts
  175. - **List Resources** - Get a list of available resources from the MCP server
  176. - **List Tools** - Get a list of available tools
  177. - **Read Resource** - Read a specific resource by URI
  178. ### Example: List Tools Operation
  179. ![List Tools Example](./assets/list-tools.png)
  180. The List Tools operation returns all available tools from the MCP server, including their names, descriptions, and parameter schemas.
  181. ### Example: Execute Tool Operation
  182. ![Execute Tool Example](./assets/execute-tool.png)
  183. 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.
  184. ## Using as a Tool
  185. 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`.
  186. ### Setting the Environment Variable
  187. **If you're using a bash/zsh shell:**
  188. ```bash
  189. export N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
  190. n8n start
  191. ```
  192. **If you're using Docker:**
  193. Add to your docker-compose.yml file:
  194. ```yaml
  195. environment:
  196. - N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
  197. ```
  198. **If you're using the desktop app:**
  199. Create a `.env` file in the n8n directory:
  200. ```
  201. N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
  202. ```
  203. **If you want to set it permanently on Mac/Linux:**
  204. Add to your `~/.zshrc` or `~/.bash_profile`:
  205. ```bash
  206. export N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
  207. ```
  208. Example of an AI Agent workflow results:
  209. ![AI Agent Example](./assets/execute-tool-result.png)
  210. After setting this environment variable and restarting n8n, your MCP Client node will be available as a tool in AI Agent nodes.
  211. ## Compatibility
  212. - Requires n8n version 1.0.0 or later
  213. - Compatible with MCP Protocol version 1.0.0 or later
  214. - Supports both STDIO and SSE transports for connecting to MCP servers
  215. - SSE transport requires a server that implements the MCP Server-Sent Events specification
  216. ## Resources
  217. * [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
  218. * [Model Context Protocol Documentation](https://modelcontextprotocol.io/docs/)
  219. * [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
  220. * [MCP Transports Overview](https://modelcontextprotocol.io/docs/concepts/transports)
  221. * [Using SSE in MCP](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/client/sse.ts)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.