MCP Client Enhanced
Actions7
Overview
This node, named "MCP Client Enhanced," connects to an MCP (Model Context Protocol) server using one of several transport protocols and performs various operations related to resources, prompts, and tools managed by the MCP server. The node supports multi-tenant environments, smart prompts, and enterprise features.
For the Read Resource operation specifically, the node reads a resource identified by a URI from the MCP server and returns its content. This is useful when you want to fetch structured data or documents stored on the MCP server for further processing or integration in your workflow.
Common scenarios:
- Retrieving configuration files or templates stored as resources on the MCP server.
- Accessing real-time or static data assets referenced by URIs.
- Integrating external model context data into automation workflows.
Example:
You provide the URI of a resource, select the "Read Resource" operation, and the node fetches the resource content, which you can then use downstream in your workflow for analysis, transformation, or decision-making.
Properties
| Name | Meaning |
|---|---|
| Connection Type | Choose the transport type to connect to the MCP server: - Command Line (STDIO) - Server-Sent Events (SSE) (Deprecated) - HTTP Streamable (recommended for real-time communication) |
| Resource URI | The URI string identifying the specific resource to read from the MCP server. Required for the "Read Resource" operation. |
Output
The output JSON contains a single field:
resource: An object representing the content of the resource fetched from the MCP server by the given URI.
The structure of resource depends on the MCP server's response but typically includes all relevant data and metadata associated with the requested resource.
The node does not output binary data for this operation.
Dependencies
- Requires connection to an MCP server supporting the Model Context Protocol.
- Supports three transport types:
- Command Line interface via STDIO (requires command and environment setup).
- HTTP Streamable protocol (recommended for modern usage).
- Server-Sent Events (SSE) protocol (deprecated).
- Requires appropriate credentials configured in n8n for the selected transport type, including API URLs, commands, headers, or tokens.
- Environment variables may be used to configure the command line transport environment.
Troubleshooting
- Transport errors: If the node fails to connect, check that the correct transport type is selected and credentials are properly configured.
- Invalid URI: Ensure the Resource URI is correctly formatted and exists on the MCP server.
- Timeouts: The node uses configurable timeouts; if requests take too long, consider increasing the timeout settings in credentials.
- Credential issues: Missing or incorrect API keys, URLs, or commands will cause connection failures.
- Deprecation warning: Avoid using the SSE transport as it is deprecated; prefer HTTP Streamable instead.
- JSON parsing errors: For other operations involving JSON input, ensure valid JSON syntax.
If errors occur, the node throws descriptive error messages indicating the failure point, such as connection issues or invalid parameters.
Links and References
- Model Context Protocol (MCP) Documentation (hypothetical link for reference)
- n8n Documentation - Creating Custom Nodes
- Zod Schema Validation Library
- LangChain Tools
Note: This summary is based solely on static code analysis of the provided source code and property definitions.