From ac9327c803b2141bf3963630ae891f10bad791f0 Mon Sep 17 00:00:00 2001 From: amin-nikanjam <73068118+amin-nikanjam@users.noreply.github.com> Date: Wed, 1 Oct 2025 15:27:46 -0400 Subject: [PATCH 1/8] Update dsl-reference.md Signed-off-by: Amin Nikanjam Signed-off-by: amin-nikanjam --- dsl-reference.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index c5f463f5..2bd9cedb 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -15,6 +15,7 @@ + [HTTP](#http-call) + [OpenAPI](#openapi-call) + [A2A](#a2a-call) + + [MCP](#mcp-call) - [Do](#do) - [Emit](#emit) - [For](#for) @@ -322,6 +323,7 @@ Serverless Workflow defines several default functions that **MUST** be supported - [HTTP](#http-call) - [OpenAPI](#openapi-call) - [A2A](#a2a-call) +- [MCP](#mcp-call) ##### AsyncAPI Call @@ -527,6 +529,71 @@ do: text: Generate the Q1 sales report. ``` +##### MCP Call + +The [MCP Call](#mcp-call) enables workflows to interact with MCP servers that are used by AI agents (https://modelcontextprotocol.io/). + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| method | `string` | `yes` | The MCP JSON-RPC method to send.
*Supported values are: `initialize`, `notifications/initialized`, `prompts/list`, `prompts/get`, `notifications/prompts/list_changed`, `resources/list`, `resources/read`, `resources/templates/list`, `notifications/resources/list_changed`, `tools/list`, `tools/call`, `notifications/tools/list_changed`, `logging/setLevel`, and `notifications/message`* | +| server | `string`\|[`endpoint`](#endpoint) | `yes` | An URI, an object (for HTTP) or a filename (for STDIO) that describes the MCP server to call.
| +| parameters | `map`
`string` | `no` | The parameters for the MCP RPC method. For the `initialize` method, runtimes must set the `protocolVersion` parameter to the used version. Runtimes must implement the MCP specification version of 2025-06-18.
*Can be an object or a runtime expression.* | + +> [!NOTE] +> On success the output 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). +> +> This call supports MCP over both HTTP and STDIO (communication over standard in and standard out) transport mechanisms. + +###### Examples + +This example shows an initialization phase as the first interaction between MCP client and server. The client sends its supported version, capabilities, and implementation information in the initialize request. The server MUST respond with its own capabilities and information including the supported version. + +```yaml +document: + dsl: '1.0.1' + namespace: test + name: mcp-example + version: '0.1.0' +do: + - GenerateReport: + call: mcp + with: + method: initialize + server: + endpoint: https://example.com/mcp + parameters: + protocolVersion: '2025-03-26' + capabilities: + roots: + listChanged: true + clientInfo: + name: 'ExampleClient' + version: '1.0.0' +``` + +The following example showcases a prompts/list request by the client to retrieve available prompts from the MCP server. + +```yaml +document: + dsl: '1.0.1' + namespace: test + name: mcp-example + version: '0.1.0' +do: + - GenerateReport: + call: mcp + with: + method: prompts/get + server: + endpoint: https://example.com/mcp + parameters: + name: "code_review" + arguments: + code: "def hello():\n print('world')" +``` + #### Do 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 +2773,4 @@ References a workflow definition. name: greet namespace: samples version: '0.1.0-rc2' -``` \ No newline at end of file +``` From a8cb0140ac3ac75005920be280f9838f4f0e889f Mon Sep 17 00:00:00 2001 From: amin-nikanjam <73068118+amin-nikanjam@users.noreply.github.com> Date: Wed, 1 Oct 2025 15:33:47 -0400 Subject: [PATCH 2/8] Update workflow.yaml Signed-off-by: Amin Nikanjam Signed-off-by: amin-nikanjam --- schema/workflow.yaml | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 1d3933bb..a82a34c1 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -473,6 +473,41 @@ $defs: description: The parameters object to send with the A2A method. required: [ method ] unevaluatedProperties: false + - title: CallMCP + description: Defines the MCP call to perform. + type: object + unevaluatedProperties: false + required: [ call, with ] + allOf: + - $ref: '#/$defs/taskBase' + - properties: + call: + type: string + const: mcp + with: + type: object + title: MCPArguments + description: The MCP call arguments. + properties: + server: + title: MCPServer + description: The MCP server endpoint (HTTP or STDIO) to send the request to. + $ref: '#/$defs/endpoint' + method: + type: string + title: WithMCPMethod + description: The MCP method to send. + enum: [ 'initialize', 'notifications/initialized', 'prompts/list', 'prompts/get', 'notifications/prompts/list_changed', 'resources/list', 'resources/read', 'resources/templates/list', 'notifications/resources/list_changed', 'tools/list', 'tools/call', 'notifications/tools/list_changed', 'logging/setLevel', 'notifications/message' ] + parameters: + oneOf: + - type: object + minProperties: 1 + additionalProperties: true + - type: string + title: WithMCPParameters + description: The parameters object to send with the MCP method. + required: [ method, server ] + unevaluatedProperties: false - title: CallFunction description: Defines the function call to perform. type: object @@ -484,7 +519,7 @@ $defs: call: type: string not: - enum: ["asyncapi", "grpc", "http", "openapi", "a2a"] + enum: ["asyncapi", "grpc", "http", "openapi", "a2a", "mcp"] description: The name of the function to call. with: type: object @@ -1823,4 +1858,4 @@ $defs: export: $ref: '#/$defs/export' title: SubscriptionIteratorExport - description: An object, if any, used to customize the content of the workflow context. \ No newline at end of file + description: An object, if any, used to customize the content of the workflow context. From 0dfef80f510c477069e5217453bb8b5edf491474 Mon Sep 17 00:00:00 2001 From: amin-nikanjam <73068118+amin-nikanjam@users.noreply.github.com> Date: Sun, 5 Oct 2025 22:08:10 -0400 Subject: [PATCH 3/8] Update dsl-reference.md Signed-off-by: Amin Signed-off-by: amin-nikanjam --- dsl-reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 2bd9cedb..032d9cfc 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -564,13 +564,13 @@ do: server: endpoint: https://example.com/mcp parameters: - protocolVersion: '2025-03-26' + protocolVersion: '2025-06-18' capabilities: roots: listChanged: true clientInfo: name: 'ExampleClient' - version: '1.0.0' + version: '0.1.0' ``` The following example showcases a prompts/list request by the client to retrieve available prompts from the MCP server. From 0badf7bdcb8a8c61401da9fc9e69ef68c8197a21 Mon Sep 17 00:00:00 2001 From: Amin Date: Sun, 5 Oct 2025 22:48:03 -0400 Subject: [PATCH 4/8] Add MCP examples Signed-off-by: Amin Signed-off-by: amin-nikanjam --- examples/call-mcp-1.yaml | 20 ++++++++++++++++++++ examples/call-mcp-2.yaml | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 examples/call-mcp-1.yaml create mode 100644 examples/call-mcp-2.yaml diff --git a/examples/call-mcp-1.yaml b/examples/call-mcp-1.yaml new file mode 100644 index 00000000..0f710bad --- /dev/null +++ b/examples/call-mcp-1.yaml @@ -0,0 +1,20 @@ +document: + dsl: '1.0.1' + namespace: test + name: mcp-example + version: '0.1.0' +do: + - GenerateReport: + call: mcp + with: + method: initialize + server: + endpoint: https://example.com/mcp + parameters: + protocolVersion: '2025-06-18' + capabilities: + roots: + listChanged: true + clientInfo: + name: 'ExampleClient' + version: '0.1.0' \ No newline at end of file diff --git a/examples/call-mcp-2.yaml b/examples/call-mcp-2.yaml new file mode 100644 index 00000000..4cddc899 --- /dev/null +++ b/examples/call-mcp-2.yaml @@ -0,0 +1,16 @@ +document: + dsl: '1.0.1' + namespace: test + name: mcp-example + version: '0.1.0' +do: + - GenerateReport: + call: mcp + with: + method: prompts/get + server: + endpoint: https://example.com/mcp + parameters: + name: "code_review" + arguments: + code: "def hello():\n print('world')" \ No newline at end of file From 1515a58065334b9aa0f57fb02c4fec9c0551ce90 Mon Sep 17 00:00:00 2001 From: amin-nikanjam <73068118+amin-nikanjam@users.noreply.github.com> Date: Mon, 6 Oct 2025 09:06:13 -0400 Subject: [PATCH 5/8] Create amin-test.yaml Signed-off-by: amin-nikanjam --- .github/workflows/amin-test.yaml | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/amin-test.yaml diff --git a/.github/workflows/amin-test.yaml b/.github/workflows/amin-test.yaml new file mode 100644 index 00000000..bf7c3556 --- /dev/null +++ b/.github/workflows/amin-test.yaml @@ -0,0 +1,45 @@ +# Copyright 2023 The Serverless Workflow Specification Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler/blob/master/README.md + +name: Verify Specification Examples + +on: workflow_dispatch + +jobs: + build: + defaults: + run: + working-directory: .ci/validation/ + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [21.x] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: .ci/validation/package-lock.json + - run: npm install + - run: npm test From 485adfaa091337a29dbb64409e48875666e77496 Mon Sep 17 00:00:00 2001 From: amin-nikanjam Date: Mon, 6 Oct 2025 09:16:31 -0400 Subject: [PATCH 6/8] Revert "Create amin-test.yaml" This reverts commit 2d7f2a92483404d8837fb9c9f7b13b016f0dcf5d. Signed-off-by: amin-nikanjam --- .github/workflows/amin-test.yaml | 45 -------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 .github/workflows/amin-test.yaml diff --git a/.github/workflows/amin-test.yaml b/.github/workflows/amin-test.yaml deleted file mode 100644 index bf7c3556..00000000 --- a/.github/workflows/amin-test.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2023 The Serverless Workflow Specification Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# To use this workflow, you will need to set up a .github/labeler.yml -# file with configuration. For more information, see: -# https://github.com/actions/labeler/blob/master/README.md - -name: Verify Specification Examples - -on: workflow_dispatch - -jobs: - build: - defaults: - run: - working-directory: .ci/validation/ - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [21.x] - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - cache-dependency-path: .ci/validation/package-lock.json - - run: npm install - - run: npm test From 00cd7c1a1d6e62c17c65de25603fa1f8c9e637a8 Mon Sep 17 00:00:00 2001 From: amin-nikanjam Date: Wed, 15 Oct 2025 14:19:14 -0400 Subject: [PATCH 7/8] Updating MCP examples to fix the bug in CI Signed-off-by: amin-nikanjam --- dsl-reference.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 032d9cfc..98567879 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -567,10 +567,7 @@ do: protocolVersion: '2025-06-18' capabilities: roots: - listChanged: true - clientInfo: - name: 'ExampleClient' - version: '0.1.0' + listChanged: true ``` The following example showcases a prompts/list request by the client to retrieve available prompts from the MCP server. From 53a676621bd088f10a83f3626d9c06c788ace88f Mon Sep 17 00:00:00 2001 From: amin-nikanjam Date: Wed, 15 Oct 2025 14:19:51 -0400 Subject: [PATCH 8/8] Update call-mcp-1.yaml Signed-off-by: amin-nikanjam --- examples/call-mcp-1.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/call-mcp-1.yaml b/examples/call-mcp-1.yaml index 0f710bad..67b65d1f 100644 --- a/examples/call-mcp-1.yaml +++ b/examples/call-mcp-1.yaml @@ -14,7 +14,4 @@ do: protocolVersion: '2025-06-18' capabilities: roots: - listChanged: true - clientInfo: - name: 'ExampleClient' - version: '0.1.0' \ No newline at end of file + listChanged: true \ No newline at end of file