MCP Client icon

MCP Client

Use MCP client

Overview

This node acts as a client for the MCP (Model Context Protocol) server, enabling various operations such as executing tools, listing tools, prompts, resources, and reading specific resources. It supports multiple connection types (Command Line via STDIO, Server-Sent Events, and HTTP Streamable) to communicate with the MCP server. A common use case is to execute a specific tool on the MCP server by providing the tool name and parameters, and then retrieving the execution result. This is useful in automation workflows where external tools need to be invoked programmatically.

Use Case Examples

  1. Executing a tool named 'textAnalyzer' with JSON parameters to analyze text data.
  2. Listing all available tools on the MCP server to dynamically build a UI for tool selection.
  3. Fetching a specific prompt template by name for use in a conversational AI workflow.

Properties

Name Meaning
Connection Type Selects the transport protocol to connect to the MCP server. Options include Command Line (STDIO), Server-Sent Events (deprecated), and HTTP Streamable for real-time communication.
Tool Name The name of the tool to execute on the MCP server.
Tool Parameters JSON-formatted parameters to pass to the tool during execution.

Output

JSON

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

Dependencies

  • Requires credentials for MCP client API depending on the connection type selected (Command Line, SSE, or HTTP).
  • Uses MCP SDK client libraries for communication and tool execution.

Troubleshooting

  • Common issues include connection failures due to incorrect credentials or server unavailability.
  • Errors parsing tool parameters if the JSON is invalid or not an object.
  • Tool execution errors if the specified tool does not exist or if the tool fails internally.
  • Timeouts or transport errors depending on the connection type and network conditions.

Links

Discussion