Actions7
Overview
This node acts as a client for the MCP (Model Context Protocol) server, allowing users to interact with various MCP resources and tools. It supports multiple connection types (Command Line, Server-Sent Events, HTTP Streamable) to communicate with the MCP server. The node can list available tools, execute specific tools with parameters, list prompts, get prompt templates, list resources, list resource templates, and read specific resources by URI. This node is useful for integrating MCP server capabilities into workflows, such as automating tool execution or retrieving resource data.
Use Case Examples
- Listing all available tools from the MCP server to display in a dashboard.
- Executing a specific tool with JSON parameters to automate a task.
- Retrieving a list of available prompts to dynamically generate user input forms.
- Reading a specific resource by its URI for data processing.
Properties
| Name | Meaning |
|---|---|
| Connection Type | Choose the transport type to connect to MCP server |
| Operation | Select the MCP client operation to perform, such as listing tools or executing a tool. |
| Resource URI | URI of the resource to read (required for Read Resource operation) |
| Tool Name | Name of the tool to execute (required for Execute Tool operation) |
| Tool Parameters | Parameters to pass to the tool in JSON format (required for Execute Tool operation) |
| Prompt Name | Name of the prompt template to get (required for Get Prompt operation) |
Output
JSON
tools- List of available tools with their name, description, and input schema in JSON Schema formatresult- Result of executing a specific toolprompts- List of available promptsprompt- Specific prompt template retrievedresources- List of available resourcesresourceTemplates- List of available resource templatesresource- Specific resource data read by URI
Dependencies
- @modelcontextprotocol/sdk
- zod
- @langchain/core/tools
Troubleshooting
- Connection errors to MCP server may occur if credentials or connection parameters are incorrect. Verify the connection type and credentials.
- If no tools are found, ensure the MCP server has tools available and the client is connected properly.
- Tool execution errors may occur if the tool name is incorrect or parameters are invalid JSON. Validate tool names and parameter formats.
- Timeouts may happen depending on the connection type and server responsiveness; adjust timeout settings if needed.
Links
- Model Context Protocol Documentation - Official documentation for MCP server and client usage.