Actions7
Overview
This node acts as a client for the Model Context Protocol (MCP) server, enabling various operations such as reading resources, listing resources, executing tools, and retrieving prompts. It supports multiple connection types including Command Line (STDIO), Server-Sent Events (SSE), and HTTP Streamable, allowing flexible integration with MCP servers. A common use case is to read a specific resource by its URI, which is useful for workflows that need to fetch and process data from MCP-managed resources.
Use Case Examples
- Reading a resource by specifying its URI to fetch data for further processing.
- Listing available tools on the MCP server to dynamically select and execute a tool within a workflow.
- Retrieving prompt templates to customize interactions with the MCP server.
Properties
| Name | Meaning |
|---|---|
| Connection Type | Selects the transport protocol to connect to the MCP server, options include Command Line (STDIO), Server-Sent Events (SSE), and HTTP Streamable. |
| Uri Override | Overrides the default URL from credentials with a custom URL, applicable for SSE and HTTP connection types. |
| Headers Override | Additional HTTP headers to send with the request, formatted as NAME=VALUE pairs separated by newlines, merged with credential headers with override precedence, applicable for SSE and HTTP connection types. |
| Resource URI | The URI of the resource to read from the MCP server, required for the Read Resource operation. |
Output
JSON
resources- List of resources returned by the MCP server when listing resources.resourceTemplates- List of available resource templates from the MCP server.resource- The specific resource data read from the MCP server by URI.tools- List of available tools with their names, descriptions, and input schemas.result- Result of executing a specific tool with provided parameters.prompts- List of available prompt templates from the MCP server.prompt- A specific prompt template retrieved from the MCP server.
Dependencies
- @modelcontextprotocol/sdk
- n8n-workflow
Troubleshooting
- Ensure the correct connection type is selected and corresponding credentials are provided.
- Verify the URI override and headers override formats are correct when used.
- Common errors include transport connection failures, invalid JSON in tool parameters, and non-existent tool names.
- If the node fails to connect, check network access to the MCP server and validity of credentials.
- Parsing errors in tool parameters usually indicate malformed JSON; validate the JSON format before input.
Links
- Model Context Protocol Documentation - Official documentation for MCP client and server interactions.