Skip to content

Commit 7240df1

Browse files
committed
feat: add a new mcp call
Signed-off-by: Charles d'Avernas <charles.davernas@neuroglia.io>
1 parent 833d25d commit 7240df1

File tree

2 files changed

+226
-1
lines changed

2 files changed

+226
-1
lines changed

dsl-reference.md

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
+ [HTTP](#http-call)
1616
+ [OpenAPI](#openapi-call)
1717
+ [A2A](#a2a-call)
18+
+ [MCP](#mcp-call)
1819
- [Do](#do)
1920
- [Emit](#emit)
2021
- [For](#for)
@@ -496,7 +497,7 @@ The [A2A Call](#a2a-call) enables workflows to interact with AI agents described
496497
| 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`* |
497498
| agentCard | [`externalResource`](#external-resource) | `no` | The AgentCard resource that describes the agent to call.<br>*Required if `server` has not been set.* |
498499
| 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).* |
500501

501502
> [!NOTE]
502503
> The `security` and `securitySchemes` fields of the AgentCard contain authentication requirements and schemes for when communicating with the agent.
@@ -527,6 +528,56 @@ do:
527528
text: Generate the Q1 sales report.
528529
```
529530

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+
530581
#### Do
531582

532583
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.
27062757
name: greet
27072758
namespace: samples
27082759
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'
27092832
```

schema/workflow.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,108 @@ $defs:
473473
description: The parameters object to send with the A2A method.
474474
required: [ method ]
475475
unevaluatedProperties: false
476+
- title: CallMCP
477+
description: Defines the MCP call to perform.
478+
type: object
479+
unevaluatedProperties: false
480+
required: [ call, with ]
481+
allOf:
482+
- $ref: '#/$defs/taskBase'
483+
- properties:
484+
call:
485+
type: string
486+
const: mcp
487+
with:
488+
type: object
489+
title: MCPArguments
490+
description: The MCP call arguments.
491+
properties:
492+
protocolVersion:
493+
type: string
494+
default: '2025-06-18'
495+
title: McpProtocolVersion
496+
description: The version of the MCP protocol to use.
497+
method:
498+
type: string
499+
enum: [ tools/list, tools/call, prompts/list, prompts/get, resources/list, resources/read, resources/templates/list ]
500+
title: McpMethod
501+
description: The MCP method to call.
502+
parameters:
503+
oneOf:
504+
- type: object
505+
additionalProperties: true
506+
- type: string
507+
title: McpMethodParameters
508+
description: The MCP method parameters.
509+
timeout:
510+
$ref: '#/$defs/duration'
511+
title: McpCallTimeout
512+
description: The duration after which the MCP call times out.
513+
transport:
514+
type: object
515+
title: McpCallTransport
516+
description: The transport to use to perform the MCP call.
517+
properties:
518+
http:
519+
type: object
520+
title: McpHttpTransport
521+
description: The definition of the HTTP transport to use.
522+
properties:
523+
endpoint:
524+
$ref: '#/$defs/endpoint'
525+
title: McpHttpTransportEndpoint
526+
description: The MCP server endpoint to connect to.
527+
headers:
528+
type: object
529+
additionalProperties:
530+
type: string
531+
title: McpHttpTransportHeaders
532+
description: A key/value mapping of the HTTP headers to send with requests, if any.
533+
required: [ endpoint ]
534+
stdio:
535+
type: object
536+
title: McpStdioTransport
537+
description: The definition of the STDIO transport to use.
538+
properties:
539+
command:
540+
type: string
541+
title: McpStdioTransportCommand
542+
description: The command used to run the MCP server.
543+
arguments:
544+
type: array
545+
items:
546+
type: string
547+
title: McpStdioTransportArguments
548+
description: An optional list of arguments to pass to the command.
549+
environment:
550+
type: object
551+
additionalProperties:
552+
type: string
553+
title: McpStdioTransportEnvironment
554+
description: A key/value mapping, if any, of environment variables used to configure the MCP server.
555+
required: [ command ]
556+
options:
557+
type: object
558+
additionalProperties:
559+
type: string
560+
oneOf:
561+
- required: [http]
562+
- required: [stdio]
563+
client:
564+
type: object
565+
title: McpClient
566+
description: Describes the client used to perform the MCP call.
567+
properties:
568+
name:
569+
type: string
570+
title: McpClientName
571+
description: The name of the client used to connect to the MCP server.
572+
description:
573+
type: string
574+
title: McpClientVersion
575+
description: The version of the client used to connect to the MCP server.
576+
requireed: [ name, version ]
577+
required: [ method, transport ]
476578
- title: CallFunction
477579
description: Defines the function call to perform.
478580
type: object

0 commit comments

Comments
 (0)