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 using either a command line (STDIO) or Server-Sent Events (SSE) transport. It allows users to perform various operations such as listing available tools, resources, prompts, and resource templates on the MCP server. Specifically, the 'List Tools' operation fetches and returns a list of all available tools registered on the MCP server. This node is useful for AI agents or workflows that need to discover and interact with external AI tools and resources dynamically. For example, it can be used to retrieve the set of tools an AI agent can invoke to perform tasks like data retrieval, processing, or executing specialized functions.
Properties
| Name | Meaning |
|---|---|
| Connection Type | Selects the transport method to connect to the MCP server. Options are 'Command Line (STDIO)' which uses a local command execution interface, or 'Server-Sent Events (SSE)' which uses an HTTP-based event stream connection. |
Output
JSON
tools- An array of tool objects available on the MCP server. Each tool object includes properties such as name, description, input schema (in JSON schema format), and metadata describing the tool type.
Dependencies
- Requires credentials for MCP server access, either an API key credential for command line transport or SSE API credentials for SSE transport.
- Depends on the '@modelcontextprotocol/sdk' client libraries for communication with the MCP server.
- Uses 'zod' for schema validation and 'zod-to-json-schema' to convert input schemas to JSON schema format.
Troubleshooting
- Connection errors may occur if the MCP server credentials are missing, invalid, or if the server is unreachable. Verify credentials and network connectivity.
- If the node fails to list tools, check the MCP server logs and ensure the server supports the requested operation.
- Parsing errors may happen if the MCP server returns unexpected data formats. The node attempts to parse JSON content but will fallback to raw data if parsing fails.
- When using SSE transport, custom headers or endpoints may not be fully supported, which could cause connection issues.
- Errors during tool execution or resource reading include detailed messages and data to help diagnose issues such as missing parameters or server-side failures.