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 interact with various MCP resources and tools. It supports multiple operations such as listing available tools, executing a specific tool, retrieving prompts, reading resources, and listing resource templates or resources.

The "List Tools" operation specifically fetches and returns the list of available tools from the MCP server. This is useful when you want to discover what tools are accessible for execution or integration within your workflow.

Practical examples:

  • Automatically fetching the list of tools to dynamically populate options in subsequent nodes.
  • Validating available tools before attempting to execute one.
  • Integrating MCP tools into automated workflows by first discovering them programmatically.

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)

Output

The output JSON contains a single field:

  • tools: An array of objects representing each available tool. Each tool object includes:
    • name: The name of the tool.
    • description: A textual description of what the tool does.
    • schema: A JSON schema describing the input parameters expected by the tool.

This structured output allows downstream nodes or processes to understand what tools exist and how to interact with them.

The node does not output binary data.

Dependencies

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

    • Command Line interface using STDIO
    • HTTP streamable protocol (recommended)
    • Server-Sent Events (SSE) (deprecated)
  • Depending on the chosen connection type, appropriate credentials must be configured in n8n:

    • For command line: credentials providing the command and environment variables.
    • For HTTP or SSE: credentials including URLs and optional headers.
  • The node uses external MCP SDK packages internally to communicate with the MCP server.

Troubleshooting

  • No tools found: If the MCP server returns no tools, the node throws an error indicating no tools were found. Verify that the MCP server is running correctly and has tools registered.

  • Connection errors: Errors during connection setup (e.g., invalid credentials, unreachable server) will result in failure to connect. Check credentials, URLs, and network connectivity.

  • Invalid or missing credentials: Ensure that the correct credential type matching the selected connection type is configured and valid.

  • Tool list fetch failure: If fetching the tool list fails, the node will throw an error. Inspect logs for detailed messages.

  • Timeouts: The node uses configurable timeouts depending on the connection type; if operations take too long, consider increasing timeout settings.

Links and References

Discussion