MCP Client icon

MCP Client

Use MCP client

Overview

This node acts as a client interface to an MCP (Model Context Protocol) server, allowing users to perform various operations such as executing tools, listing available resources, prompts, and tools, or reading specific resources. It supports two connection types: Command Line (STDIO) and Server-Sent Events (SSE), enabling flexible integration depending on the environment.

A common use case is automating interactions with AI or model-based tools exposed by the MCP server. For example, you can execute a named tool with specific JSON parameters to get processed results, list all available tools to dynamically build workflows, or fetch prompt templates for generating text.

Practical examples:

  • Executing a text summarization tool by providing the tool name and input parameters.
  • Listing all available AI models or tools to present options in a UI.
  • Reading a resource by its URI to retrieve metadata or content from the MCP server.

Properties

Name Meaning
Connection Type Choose the transport type to connect to the MCP server. Options: "Command Line (STDIO)", "Server-Sent Events (SSE)"
Tool Name The exact name of the tool to execute on the MCP server.
Tool Parameters JSON object containing parameters to pass to the tool during execution.

Output

The node outputs JSON data structured according to the operation performed:

  • Execute Tool: Outputs { "result": <tool execution result> } where the result is the response from the executed tool, which can be any JSON-serializable data.
  • List Resources: Outputs { "resources": [...] } — an array of available resources from the MCP server.
  • Read Resource: Outputs { "resource": <resource data> } — the content or metadata of the specified resource.
  • List Tools: Outputs { "tools": [...] } — an array of tools with their names, descriptions, and input schema keys.
  • List Prompts: Outputs { "prompts": [...] } — an array of available prompt templates.
  • Get Prompt: Outputs { "prompt": <prompt template> } — the content of a specific prompt template.

The node does not output binary data; all outputs are JSON objects representing the requested information or results.

Dependencies

  • Requires access to an MCP server supporting either STDIO command line or SSE transport.
  • Needs appropriate credentials for the chosen connection type (an API key or authentication token).
  • Environment variables starting with MCP_ can be used to configure the command line environment when using the STDIO connection.
  • Uses external libraries bundled with the node for MCP client communication and schema validation.

Troubleshooting

  • Connection issues: If the node fails to connect to the MCP server, verify that the connection type and credentials are correctly configured. Check network accessibility and that the MCP server is running.
  • Invalid tool parameters: The "Tool Parameters" must be valid JSON objects. Errors parsing this input will cause execution failure. Ensure the JSON syntax is correct and matches the expected schema of the tool.
  • Tool not found: If the specified tool name does not exist on the MCP server, the node will throw an error listing available tools. Double-check the tool name spelling and availability.
  • Operation not supported: Using an unsupported operation value will cause an error. Confirm the operation parameter is one of the supported options.
  • Empty tool list: If no tools are returned from the MCP server, it may indicate a server-side issue or misconfiguration.

Links and References

Discussion