MCP Client icon

MCP Client

Use MCP client

Overview

This node acts as a client for the MCP (Model Context Protocol) server, allowing users to perform various operations such as executing tools, listing available tools, prompts, resources, and reading specific resources. It supports multiple connection types to communicate with the MCP server, including Command Line (STDIO), Server-Sent Events (SSE), and HTTP Streamable protocols. A common use case is to execute a specific tool on the MCP server by providing the tool name and parameters, enabling integration of external tool functionalities into an n8n workflow.

Use Case Examples

  1. Executing a tool named 'translateText' with JSON parameters specifying the text and target language.
  2. Listing all available tools on the MCP server to dynamically build a user interface.
  3. Fetching a specific prompt template by name for use in automated content generation workflows.

Properties

Name Meaning
Connection Type Selects the transport protocol to connect to the MCP server (Command Line, SSE, or HTTP Streamable). Defaults to Command Line (STDIO).
Tool Name The name of the tool to execute on the MCP server. Required for the Execute Tool operation.
Tool Parameters JSON object containing parameters to pass to the tool during execution. Required for the Execute Tool operation.

Output

JSON

  • result - The result returned from executing the specified tool.

Dependencies

  • Requires credentials for MCP client connection depending on the selected connection type (API keys or command line credentials).
  • Uses MCP SDK client libraries for communication with the MCP server.

Troubleshooting

  • Common errors include connection failures to the MCP server due to incorrect credentials or network issues.
  • Errors parsing tool parameters if the JSON is invalid or not an object.
  • Attempting to execute a tool that does not exist on the MCP server.
  • Timeouts or transport errors depending on the connection type used.

Links

Discussion