MCP Client icon

MCP Client

Use MCP client

Overview

This node acts as a client interface to an MCP (Model Context Protocol) server, enabling interaction with various resources, tools, and prompts managed by the MCP system. It supports multiple connection types for communication, including command line (STDIO), HTTP streamable protocol, and deprecated Server-Sent Events (SSE).

Common scenarios where this node is beneficial include:

  • Executing specific tools remotely on the MCP server with custom parameters.
  • Retrieving available prompts or prompt templates for use in workflows.
  • Listing and reading resources or resource templates managed by the MCP server.
  • Discovering available tools and their input schemas dynamically.

Practical examples:

  • Automating AI model tool execution by passing JSON parameters and receiving results.
  • Fetching prompt templates to dynamically generate inputs for language models.
  • Reading resource data by URI to incorporate external content into workflows.
  • Listing all available tools to present options to end users or for dynamic workflow branching.

Properties

Name Meaning
Connection Type Choose the transport type to connect to MCP server. Options:
- Command Line (STDIO)
- Server-Sent Events (SSE) (Deprecated)
- HTTP Streamable (recommended for real-time communication)

Output

The output JSON structure depends on the selected operation:

  • listResources: Outputs { resources: [...] } — an array of available resources.
  • listResourceTemplates: Outputs { resourceTemplates: [...] } — an array of resource templates.
  • readResource: Outputs { resource: {...} } — the content of a specific resource identified by URI.
  • listTools: Outputs { tools: [...] } — an array of tools with their name, description, and input schema.
  • executeTool: Outputs { result: ... } — the result returned from executing the specified tool.
  • listPrompts: Outputs { prompts: [...] } — an array of available prompt templates.
  • getPrompt: Outputs { prompt: {...} } — details of a specific prompt template.

The node does not output binary data; all outputs are JSON objects representing structured data from the MCP server.

Dependencies

  • Requires access to an MCP server endpoint configured via one of the supported connection types.
  • Needs appropriate credentials depending on the connection type chosen:
    • For Command Line (STDIO): configuration includes command and arguments to run the MCP client CLI.
    • For HTTP Streamable: requires HTTP URL endpoints and optional headers.
    • For Server-Sent Events (SSE) (deprecated): requires SSE URL and optional headers.
  • Uses environment variables prefixed with MCP_ to extend the environment for the command line transport.
  • Depends on several external libraries bundled within the node, including MCP SDK clients and validation utilities.

Troubleshooting

  • Connection errors: If the node fails to connect to the MCP server, verify that the correct connection type is selected and that credentials (command, URLs, headers) are properly configured.
  • Invalid tool parameters: When executing a tool, ensure the parameters are valid JSON objects. Errors parsing parameters will indicate malformed JSON.
  • Tool not found: Attempting to execute a non-existent tool will throw an error listing available tools. Double-check the tool name spelling.
  • Timeouts: The node uses configurable timeouts for HTTP and SSE connections. Increase timeout values if operations take longer than expected.
  • Deprecated SSE usage: SSE connection type is deprecated; prefer using HTTP Streamable for real-time communication.
  • Transport errors: Any transport-level errors will be surfaced as node operation errors with descriptive messages.

Links and References

Discussion