Skip to content

Fix #620: New MCP server module proposal#621

Open
ricardozanini wants to merge 1 commit into
mainfrom
issues/620
Open

Fix #620: New MCP server module proposal#621
ricardozanini wants to merge 1 commit into
mainfrom
issues/620

Conversation

@ricardozanini

Copy link
Copy Markdown
Member

Description

Fixes #620

@quarkiverse/quarkiverse-flow-triage please review and add your considerations.

Changes

  • Added an ADR for the new MCP server module

@ricardozanini
ricardozanini requested a review from a team as a code owner June 9, 2026 18:22
@ricardozanini

Copy link
Copy Markdown
Member Author

@mcruzdev @fjtirado @domhanak @gmunozfe can you please review it?

@baldimir baldimir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't read through the implementation details (classes etc.) however I like it. I agree, we should definitely have MCP and the architecture looks fine based on what I read.


The Model Context Protocol (MCP) is an open-source standard protocol (governed by the Linux Foundation's Agentic AI Foundation since December 2025) that enables AI applications to connect to external data sources, tools, and workflows through a standardized interface. MCP uses JSON-RPC 2.0 and defines three core primitives: tools (executable functions), resources (data sources), and prompts (reusable templates).

Quarkus Flow is a workflow engine based on the CNCF Serverless Workflow specification. Currently, there is no standard way for AI systems to discover, execute, and monitor Quarkus Flow workflows. Adding MCP support would enable:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Quarkus Flow is a workflow engine based on the CNCF Serverless Workflow specification. Currently, there is no standard way for AI systems to discover, execute, and monitor Quarkus Flow workflows. Adding MCP support would enable:
Quarkus Flow is a workflow engine based on the Serverless Workflow specification, a CNCF project. Currently, there is no standard way for AI systems to discover, execute, and monitor Quarkus Flow workflows. Adding MCP support would enable:

Comment thread adr/2026-06-09-mcp-integration-design.md

3. **Prompts**: Assist with workflow operations and generation
- `construct_workflow_input` - Help construct valid input for a workflow
- `analyze_workflow_schema` - Help understand workflow input requirements

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this could be split into:

  • analyze_workflow_input_schema - Help understand workflow input requirements
  • analyze_workflow_schema - Help understand workflow steps

/**
* List all workflow definitions, optionally filtered by namespace.
*/
public Stream<WorkflowDefinition> listWorkflows(String namespace) {

@domhanak domhanak Jun 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking about cases where there are lots of workflows, we could consider introducing alternative with paging


return TextResourceContents.create(
"workflow://definitions",
toJson(defs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could result in huge context depending on List<WorkflowDefinitionInfo> defs, not sure how this is handled later, still 1300 lines to go 😄

* Find workflow by namespace, name, and optional version.
* If version is null, returns the latest version using WorkflowVersionComparator.
*/
public Optional<WorkflowDefinition> findWorkflow(String namespace, String name, String version) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider some caching mechanism here.

);
} catch (WorkflowNotFoundException e) {
throw new McpException(-32602, e.getMessage());
} catch (Exception e) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be later expanded with more specific exceptions to improve the error handling experience.

```java
@Tool(description = "Execute a dynamically generated workflow from YAML definition")
public WorkflowExecutionResult executeYamlWorkflow(
@ToolArg(description = "Workflow definition in YAML format (CNCF Serverless Workflow spec)") String yamlDefinition,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the YAML has infinite loop or some malicious code etc.? Can this be handled somehow?

1. **User**: "Create a workflow that fetches user data from API A, transforms it, and sends to API B"
2. **AI**: Reads `workflow://spec/schema` and `workflow://spec/examples`
3. **AI**: Generates YAML workflow definition
4. **AI**: Calls `validate_yaml_workflow` to check syntax

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imho there should always be something like **User**: Reviews the generated workflow definition in these scenarios

@domhanak domhanak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reached Phase 5 - Left some comments. Will try to finish tomorrow.

@mcruzdev mcruzdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks really a great feature @ricardozanini!

Considering we have currently some features in DevUI which we can call via MCP in dev mode (methods annotated with @JsonRpcDescription on ManagementLifecycleRPCService and WorkflowRPCService), I think we need to put into the roadmap the reuse of quarkus-flow-api on those classes.

See https://quarkus.io/guides/dev-mcp#mcp-tools-against-the-runtime-classpath.

- Uses shared `WorkflowExecutionService` and `WorkflowDefinitionService`

2. **Resources**: Query workflow metadata and specifications
- `workflow://definitions` - List all registered workflow definitions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the use of workflow so generic, why not flow://?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create ADR for MCP Integration Design

4 participants