|
15 | 15 | + [HTTP](#http-call) |
16 | 16 | + [OpenAPI](#openapi-call) |
17 | 17 | + [A2A](#a2a-call) |
| 18 | + + [MCP](#mcp-call) |
18 | 19 | - [Do](#do) |
19 | 20 | - [Emit](#emit) |
20 | 21 | - [For](#for) |
@@ -496,7 +497,7 @@ The [A2A Call](#a2a-call) enables workflows to interact with AI agents described |
496 | 497 | | method | `string` | `yes` | The A2A JSON-RPC method to send.<br>*Supported values are: `message/send`, `message/stream`, `tasks/get`, `tasks/list`, `tasks/cancel`, `tasks/resubscribe`, `tasks/pushNotificationConfig/set`, `tasks/pushNotificationConfig/get`, `tasks/pushNotificationConfig/list`, `tasks/pushNotificationConfig/delete`, and `agent/getAuthenticatedExtendedCard`* | |
497 | 498 | | agentCard | [`externalResource`](#external-resource) | `no` | The AgentCard resource that describes the agent to call.<br>*Required if `server` has not been set.* | |
498 | 499 | | server | `string`\|[`endpoint`](#endpoint) | `no` | An URI or an object that describes the A2A server to call.<br>*Required if `agentCard` has not been set, otherwise ignored* | |
499 | | -| parameters | `map` <br> `string` | `no` | The parameters for the A2A RPC method. For the `message/send` and `message/stream` methods, runtimes must default `message.messageId` to a uuid and `message.role` to `user`.<br>*Can be an object or a direct runtime expression.* | |
| 500 | +| parameters | `map` <br> `string` | `no` | The parameters for the A2A RPC method. For the `message/send` and `message/stream` methods, runtimes must default `message.messageId` to a uuid and `message.role` to `user`.<br>*Supports [runtime expressions](dsl.md#runtime-expressions).* | |
500 | 501 |
|
501 | 502 | > [!NOTE] |
502 | 503 | > The `security` and `securitySchemes` fields of the AgentCard contain authentication requirements and schemes for when communicating with the agent. |
|
527 | 528 | text: Generate the Q1 sales report. |
528 | 529 | ``` |
529 | 530 |
|
| 531 | +##### MCP Call |
| 532 | + |
| 533 | +The [MCP Call](#mcp-call) enables workflows to interact with [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers. |
| 534 | + |
| 535 | +###### Properties |
| 536 | + |
| 537 | +| Name | Type | Required | Description| |
| 538 | +|:-----|:----:|:--------:|:-----------| |
| 539 | +| protocolVersion | `string` | `yes` | The version of the MCP protocol to use.<br>*Defaults to `2025-06-18`.* | |
| 540 | +| method | `string` | `yes` | The MCP method to call.<br>*Supported values are:*<br>*- `tools/list`: Lists available tools*<br>*- `tools/call`: Calls a specific tool.*<br>*- `prompts/list`: Lists available prompts*<br>*- `prompts/get`: Gets a specific prompt.*<br>*- `resources/list`: Lists available resources.*<br>*- `resources/read`: Reads a specific resource.*<br>*- `resources/templates/list`: Lists available resource templates* | |
| 541 | +| parameters | `map`<br>`string` | `no` | The MCP method parameters.<br>*Supports [runtime expressions](dsl.md#runtime-expressions).* | |
| 542 | +| timeout | `string`<br>[`duration`](#duration) | `no` | The [`duration`](#duration) after which the MCP call times out. | |
| 543 | +| transport | [`transport`](#mcp-transport) | `yes` | The transport to use to perform the MCP call. | |
| 544 | +| client | [`client`](#mcp-client) | `no` | Describes the client used to perform the MCP call. | |
| 545 | + |
| 546 | +> [!IMPORTANT] |
| 547 | +> Before making any MCP requests, runtimes **must** first send an `initialize` call to establish the connection. |
| 548 | +> In most cases, client libraries handle this initialization automatically. |
| 549 | + |
| 550 | +> [!NOTE] |
| 551 | +> On success the output of the call is the JSON-RPC result. On failure, runtimes must raise an error with type [https://serverlessworkflow.io/spec/1.0.0/errors/runtime](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#standard-error-types). |
| 552 | + |
| 553 | +###### Examples |
| 554 | + |
| 555 | +```yaml |
| 556 | +document: |
| 557 | + dsl: '1.0.1' |
| 558 | + namespace: test |
| 559 | + name: a2a-example |
| 560 | + version: '0.1.0' |
| 561 | +do: |
| 562 | + - publishMessageToSlack: |
| 563 | + call: mcp |
| 564 | + with: |
| 565 | + method: tools/call |
| 566 | + parameters: |
| 567 | + name: conversations_add_message |
| 568 | + arguments: |
| 569 | + channel_id: 'C1234567890' |
| 570 | + thread_ts: '1623456789.123456' |
| 571 | + payload: 'Hello, world! :wave:' |
| 572 | + content_type: text/markdown |
| 573 | + transport: |
| 574 | + stdio: |
| 575 | + command: npx |
| 576 | + arguments: [ slack-mcp-serverr@latest, --transport, stdio ] |
| 577 | + environment: |
| 578 | + SLACK_MCP_XOXP_TOKEN: xoxp-xv6Cv3jKqNW8esm5YnsftKwIzoQHUzAP |
| 579 | +``` |
| 580 | + |
530 | 581 | #### Do |
531 | 582 |
|
532 | 583 | Serves as a fundamental building block within workflows, enabling the sequential execution of multiple subtasks. By defining a series of subtasks to perform in sequence, the Do task facilitates the efficient execution of complex operations, ensuring that each subtask is completed before the next one begins. |
@@ -2706,4 +2757,76 @@ References a workflow definition. |
2706 | 2757 | name: greet |
2707 | 2758 | namespace: samples |
2708 | 2759 | version: '0.1.0-rc2' |
| 2760 | +``` |
| 2761 | + |
| 2762 | +### MCP Transport |
| 2763 | + |
| 2764 | +Defines the transport to use for a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) call. |
| 2765 | + |
| 2766 | +#### Properties |
| 2767 | + |
| 2768 | +| Name | Type | Required | Description | |
| 2769 | +|:-----|:----:|:--------:|:------------| |
| 2770 | +| http | [`mcpHttpTransport`](#mcp-http-transport) | `no` | The definition of the HTTP transport to use.<br>*Required if `stdio` has not been set.* | |
| 2771 | +| stdio | [`mcpStdioTransport`](#mcp-stdio-transport) | `no` | The definition of the STDIO transport to use.<br>*Required if `http` has not been set.* | |
| 2772 | +| options | `map[string, string]` | `no` | A key/value mapping containing additional transport-specific configuration options, if any. | |
| 2773 | + |
| 2774 | +### MCP HTTP Transport |
| 2775 | + |
| 2776 | +Defines a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) HTTP transport. |
| 2777 | + |
| 2778 | +#### Properties |
| 2779 | + |
| 2780 | +| Name | Type | Required | Description | |
| 2781 | +|:-----|:----:|:--------:|:------------| |
| 2782 | +| endpoint | `string`<br>[`endpoint`](#endpoint) | `yes` | An URI or an object that references the MCP server endpoint to connect to.<br>*Supports [runtime expressions](dsl.md#runtime-expressions).* | |
| 2783 | +| headers | `map[string, string]` | `no` | A key/value mapping of the HTTP headers to send with requests, if any. | |
| 2784 | + |
| 2785 | +#### Examples |
| 2786 | + |
| 2787 | +```yaml |
| 2788 | +transport: |
| 2789 | + http: |
| 2790 | + endpoint: https://mcp.contoso.com |
| 2791 | + headers: |
| 2792 | + authorization: Bearer 8AE4SZgJX8tw40oJJq7VJt1plKnVnH8I |
| 2793 | +``` |
| 2794 | + |
| 2795 | +### MCP STDIO Transport |
| 2796 | + |
| 2797 | +Defines a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) STDIO transport. |
| 2798 | + |
| 2799 | +#### Properties |
| 2800 | + |
| 2801 | +| Name | Type | Required | Description | |
| 2802 | +|:-----|:----:|:--------:|:------------| |
| 2803 | +| command | `string` | `yes` | The command used to run the MCP server.<br>*Supports [runtime expressions](dsl.md#runtime-expressions).* | |
| 2804 | +| arguments | `string[]` | `no` | An optional list of arguments to pass to the command. | |
| 2805 | +| environment | `map[sttring, string]` | `no` | A key/value mapping, if any, of environment variables used to configure the MCP server. | |
| 2806 | + |
| 2807 | +#### Examples |
| 2808 | + |
| 2809 | +```yaml |
| 2810 | +transport: |
| 2811 | + stdio: |
| 2812 | + command: uvx |
| 2813 | + arguments: [ mcp-server-fetch ] |
| 2814 | +``` |
| 2815 | + |
| 2816 | +### MCP Client |
| 2817 | + |
| 2818 | +Describes the client of a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) call. |
| 2819 | + |
| 2820 | +#### Properties |
| 2821 | + |
| 2822 | +| Name | Type | Required | Description | |
| 2823 | +|:-----|:----:|:--------:|:------------| |
| 2824 | +| name | `string` | `yes` | The name of the client used to connect to the MCP server. | |
| 2825 | +| version | `string` | `yes` | The version of the client used to connect to the MCP server. | |
| 2826 | + |
| 2827 | +#### Examples |
| 2828 | + |
| 2829 | +```yaml |
| 2830 | +name: synapse |
| 2831 | +version: '1.0.0-alpha5.2' |
2709 | 2832 | ``` |
0 commit comments