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
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the node to connect to the MCP server and read the resource | - |
| URL | Text | The URL of the MCP server to connect to (e.g., http://localhost:3000 or https://api.example.com/mcp) | - |
| URI | Text | The URI of the resource to read from the MCP server (e.g., file:///path/to/file.txt or resource://data) | - |
| Headers | Dictionary | Optional HTTP headers to include in the request (e.g., {"Authorization": "Bearer token"}) | {} |
| Timeout | Number | Request timeout in milliseconds | 60000 |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the MCP read operation completes, regardless of success or failure |
| Result | Data | The 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
Runevent 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
Resultoutput will contain an object with anerrorproperty describing the failure - URI Validation: The node validates that the
URIinput is a non-empty string; otherwise, it throws an error
Example Usage
To read a file from an MCP server:
- Connect a Start node's
firedevent (or any trigger) to the Run input - Set the URL input to your MCP server endpoint (e.g.,
http://localhost:3000) - Set the URI input to the resource identifier (e.g.,
file:///documents/report.pdf) - Optionally provide Headers for authentication if required by the MCP server
- 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.