Skip to main content

MCP Read Resource

Controlled node

Overview

The MCP Read Resource node connects to a Model Context Protocol (MCP) server and retrieves a specific resource by its URI. This node enables workflows to access external resources exposed by MCP servers, such as files, API endpoints, or other data sources, and returns the resource content for use in subsequent nodes.

MCP Integration

This node is part of Intellectible's Model Context Protocol (MCP) integration, allowing workflows to interact with external tools and resources that expose MCP-compatible endpoints. The node creates a temporary client connection to the specified MCP server, reads the requested resource, and automatically closes the connection upon completion.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the node to connect to the MCP server and read the resource-
URLTextThe URL of the MCP server to connect to (e.g., http://localhost:3000 or https://api.example.com/mcp)-
URITextThe URI of the resource to read from the MCP server (e.g., file:///path/to/file.txt or resource://data)-
HeadersDictionaryOptional HTTP headers to include in the request (e.g., {"Authorization": "Bearer token"}){}
TimeoutNumberRequest timeout in milliseconds60000

Outputs

OutputTypeDescription
DoneEventFires when the MCP read operation completes, regardless of success or failure
ResultDataThe resource content returned by the MCP server. If an error occurs, returns an object with an error property containing the error message

Runtime Behavior and Defaults

  • Controlled Execution: This node only executes when triggered by the Run event input
  • Connection Lifecycle: The node automatically creates and closes the MCP client connection for each execution
  • Timeout Handling: Defaults to 60 seconds (60000ms). If the MCP server does not respond within this time, the operation will fail
  • Error Handling: If the MCP server returns an error or the connection fails, the Result output will contain an object with an error property describing the failure
  • URI Validation: The node validates that the URI input is a non-empty string; otherwise, it throws an error

Example Usage

To read a file from an MCP server:

  1. Connect a Start node's fired event (or any trigger) to the Run input
  2. Set the URL input to your MCP server endpoint (e.g., http://localhost:3000)
  3. Set the URI input to the resource identifier (e.g., file:///documents/report.pdf)
  4. Optionally provide Headers for authentication if required by the MCP server
  5. Connect the Result output to a Show node or processing node to handle the resource content

The node will output the resource data to the Result socket when the Done event fires, allowing you to chain subsequent operations that process the retrieved resource.