MCP Client Enhanced icon

MCP Client Enhanced

Enhanced MCP client with multi-tenant support, smart prompts, and enterprise features

Overview

This node, named "MCP Client Enhanced," connects to an MCP (Model Context Protocol) server using one of several transport protocols and performs various operations related to prompts, tools, resources, and templates. The "Get Prompt" operation specifically retrieves a prompt template by name from the MCP server, optionally passing parameters and tenant identification for multi-tenant environments.

Typical use cases include:

  • Fetching dynamic prompt templates for AI or language model interactions.
  • Customizing prompts with parameters to tailor responses.
  • Supporting multi-tenant MCP servers by specifying tenant IDs.
  • Integrating prompt retrieval into automated workflows that require dynamic prompt content.

For example, you might use this node to get a prompt template named "CustomerSupportResponse" with parameters specifying the customer's issue details, enabling downstream nodes to generate tailored support replies.

Properties

Name Meaning
Connection Type Choose the transport type to connect to the MCP server. Options: Command Line (STDIO), Server-Sent Events (SSE, deprecated), HTTP Streamable (recommended for real-time communication).
Prompt Name The exact name of the prompt template to retrieve from the MCP server.
Prompt Parameters JSON object containing parameters to pass to the prompt template. Leave as {} if no parameters are needed.
Tenant ID Optional string identifying the tenant in multi-tenant MCP servers. Leave empty for single-tenant servers.

Output

The output JSON contains a single field:

  • prompt: An object representing the retrieved prompt template populated with any provided parameters and tenant context.

Example output structure:

{
  "prompt": {
    /* prompt template data returned by MCP server */
  }
}

No binary data is produced by this operation.

Dependencies

  • Requires connection to an MCP server via one of these transports:

    • Command Line interface (STDIO)
    • HTTP Streamable protocol (recommended)
    • Server-Sent Events (SSE) protocol (deprecated)
  • Requires appropriate API credentials configured in n8n for the chosen connection type.

  • Environment variables may be used to configure command-line transport environment.

Troubleshooting

  • Invalid JSON in Prompt Parameters: If the Prompt Parameters input is not valid JSON, the node will throw an error indicating invalid JSON. Ensure the parameters are correctly formatted JSON objects.

  • Prompt Not Found: If the specified prompt name does not exist on the MCP server, the node may return an error or empty result. Verify the prompt name spelling and availability.

  • Connection Errors: Failure to connect to the MCP server due to incorrect credentials, network issues, or misconfiguration will cause errors. Check credentials, URLs, and network access.

  • Unsupported Operation: Using an operation other than those supported by the node will result in an error.

  • Deprecated SSE Transport: Using the SSE connection type is deprecated; prefer HTTP Streamable for better support.

Links and References

Discussion