Set MCP Output
Controlled node
Overview
The Set MCP Output node is used within MCP (Model Context Protocol) server workflows to set the response data that gets sent back to the MCP client. When an MCP server receives a request (such as a tool call), this node allows you to define the output payload that will be returned to the client application.
This node is typically placed at the end of an MCP tool execution workflow, where you connect the processed results to the value input and trigger the set event to finalize the response.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Set | Event | Triggers the node to set the output value for the MCP server response. | - |
| Value | Data | The data to be returned as the MCP server response. This can be any valid data type (text, objects, arrays, etc.). | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the MCP output has been successfully set and the response is ready to be sent to the client. |
Runtime Behavior and Defaults
When the Set event is triggered, the node takes the data provided to the Value input and sets it as the MCP server output. Internally, this node connects its value output to the workflow's global MCP response channel, making the data available to the client that initiated the request.
- Execution: This node runs only when explicitly triggered by the Set event input.
- Output Scope: The value set by this node is scoped to the current MCP server request and is returned to the client as the response payload.
- Data Types: The Value input accepts any data type, allowing you to return simple strings, complex objects, or structured data depending on your MCP tool's schema.
Example Usage
Returning Tool Call Results
A common pattern is to use this node at the end of an MCP tool call workflow:
- Connect the MCPServerToolCallEvent node's
firedevent to trigger your processing workflow. - Process the tool call parameters (e.g., query a database, perform calculations).
- Connect the processed results to the Value input of the Set MCP Output node.
- Connect the completion event (e.g., from a database query node) to the Set input.
- The Done event can be used to trigger cleanup or logging nodes if needed.
[MCPServerToolCallEvent]
↓ (fired)
[Process Data/Query Database]
↓ (done)
[Set MCP Output] ← (value: query results)
↓ (done)
[Optional: Log Completion]
In this example, when the MCP server receives a tool call, the workflow processes the request, and Set MCP Output packages the results into the response that gets sent back to the MCP client.