Smart MCP Client
Connects to and interacts with an MCP server, discovering capabilities for AI Agents.
Actions8
Overview
This node connects to an MCP (Model Context Protocol) server to perform various operations related to AI tools, resources, and prompts. It supports discovering available capabilities, executing specific tools with parameters, reading resources, and listing or retrieving prompts and resource templates. It is useful for integrating AI agent capabilities dynamically, executing AI tools, and accessing AI-related resources within an n8n workflow.
Properties
| Name | Meaning |
|---|---|
| Connection Type | Selects the transport method to connect to the MCP server, either via command line (STDIO) or Server-Sent Events (SSE). This affects how the node communicates with the MCP server. |
| Tool Name | The name of the tool to execute on the MCP server. This can be a real tool or a pseudo tool like a resource or prompt identifier. Required for the 'Execute Tool' operation. |
| Tool Parameters | JSON-formatted parameters to pass to the tool during execution. Must be a JSON object specifying the input arguments for the tool. Required for the 'Execute Tool' operation. |
Output
JSON
tools- Array of discovered tools with their name, description, JSON schema, and metadata (for 'discoverCapabilities' operation).rawResult- Raw result object returned when the tool execution result is not a standard object.*- Output JSON structure varies depending on the operation and tool executed, typically containing the tool execution result, resource contents, prompt templates, or lists of resources/tools/prompts.
Dependencies
- Requires credentials for MCP server connection, either an API key credential for command line transport or SSE API credential for SSE transport.
Troubleshooting
- Common issues include failure to connect to the MCP server due to incorrect credentials or transport configuration.
- Errors parsing tool parameters if the JSON is malformed or not an object.
- Missing required parameters such as 'uri' for resource or resource template tools.
- Errors returned from the MCP server during tool execution or resource reading, often including detailed error messages in the node's error description.
- To resolve, verify credentials, ensure correct JSON formatting for parameters, and confirm required parameters are provided.