Actions7
Overview
This node acts as a client for the MCP (Model Context Protocol) server, enabling various operations such as reading resources, listing resources, resource templates, tools, and prompts, as well as executing tools and retrieving prompt templates. It supports multiple connection types including Command Line (STDIO), Server-Sent Events (SSE), and HTTP Streamable for real-time communication. A common use case is to integrate MCP server capabilities into an n8n workflow to dynamically fetch or manipulate resources and tools based on the MCP protocol.
Use Case Examples
- Reading a specific resource by providing its URI to fetch its content.
- Listing all available tools on the MCP server to decide which tool to execute next.
- Executing a specific tool with JSON parameters and retrieving the result.
- Fetching a prompt template by name to use in subsequent workflow steps.
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. |
| Resource URI | The URI of the resource to read from the MCP server, required when performing the Read Resource operation. |
Output
JSON
resources- List of resources returned from the MCP server when listing resources.resourceTemplates- List of resource templates available on the MCP server.resource- The content of a specific resource read by its URI.tools- List of available tools with their name, description, and input schema.result- Result of executing a specific tool with given parameters.prompts- List of available prompt templates from the MCP server.prompt- A specific prompt template retrieved by name.
Dependencies
- MCP server connection credentials for the selected transport type (Command Line, SSE, or HTTP Streamable).
- @modelcontextprotocol SDK packages for client and transport implementations.
Troubleshooting
- Ensure the correct connection type is selected and corresponding credentials are provided; missing or incorrect credentials will cause connection failures.
- If using HTTP or SSE transport, verify the URLs and headers in credentials are correctly configured.
- Tool execution errors may occur if the tool name does not exist or parameters are invalid JSON; validate tool names and parameter formats.
- Timeouts can happen if the MCP server is unresponsive; adjust the timeout settings in credentials if needed.
- Deprecated SSE transport is discouraged; prefer HTTP Streamable for real-time communication.
Links
- Model Context Protocol Documentation - Official documentation for MCP server and client usage.
- MCP SDK GitHub Repository - Source code and usage examples for the MCP client SDK.