Skip to content

Add MCP server exposing workflow engine to AI assistants#187

Merged
intel352 merged 5 commits intomainfrom
copilot/add-mcp-server-to-workflow
Feb 27, 2026
Merged

Add MCP server exposing workflow engine to AI assistants#187
intel352 merged 5 commits intomainfrom
copilot/add-mcp-server-to-workflow

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Introduces a Model Context Protocol (MCP) server that dynamically exposes workflow engine functionality—module types, step types, config validation, schema generation, plugin listing—so AI tools can author and validate workflow YAML with accurate, up-to-date knowledge.

New packages

  • mcp/ — Server implementation using github.com/mark3labs/mcp-go v0.27.0 over stdio transport
  • cmd/mcp/ — Entry point binary (workflow-mcp-server)

Tools (8)

  • list_module_types / list_step_types / list_trigger_types / list_workflow_types — enumerate available types from schema registry (reflects plugins dynamically)
  • validate_config — validates YAML string using same logic as wfctl validate
  • inspect_config — returns structured summary with dependency graph
  • generate_schema — produces JSON Schema for config files
  • get_config_skeleton — generates template YAML for given module types
  • list_plugins — scans plugin directory for installed external plugins

Resources (3)

  • workflow://docs/overview — architecture and key concepts
  • workflow://docs/yaml-syntax — config file syntax guide
  • workflow://docs/module-reference — dynamically generated from schema.KnownModuleTypes()

Installation

{
  "mcpServers": {
    "workflow": {
      "command": "/path/to/workflow-mcp-server",
      "args": ["-plugin-dir", "/path/to/data/plugins"]
    }
  }
}

Works with Claude Desktop, VS Code/Copilot, Cursor, or any MCP-compatible client. Full docs in docs/mcp.md.

Other changes

  • Makefile: added build-mcp target
  • 21 unit tests with race detection coverage across all tools and resources

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 27, 2026 03:35
…documentation

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
…nd documentation

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI changed the title [WIP] Add MCP server to enhance workflow functionality Add MCP server exposing workflow engine to AI assistants Feb 27, 2026
@intel352 intel352 marked this pull request as ready for review February 27, 2026 03:42
Copilot AI review requested due to automatic review settings February 27, 2026 03:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces Model Context Protocol (MCP) server functionality to expose the workflow engine to AI assistants. The MCP server enables AI tools to dynamically discover module types, validate configurations, generate schemas, and access documentation—all reflecting the current state of the engine including any loaded plugins.

Changes:

  • Added MCP server package (mcp/) implementing 8 tools and 3 documentation resources
  • Created entry point binary (cmd/mcp/) for stdio-based MCP communication
  • Added comprehensive test coverage (21 unit tests) with race detection
  • Updated build system with build-mcp Makefile target

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mcp/server.go Core MCP server implementation with tool/resource handlers
mcp/server_test.go Comprehensive unit tests for all tools and resources
mcp/docs.go Embedded documentation strings for MCP resources
cmd/mcp/main.go Entry point binary for stdio MCP server
go.mod / go.sum Added mcp-go v0.27.0 dependency and transitive deps
docs/mcp.md User-facing documentation for MCP server setup and usage
Makefile Added build-mcp target
Comments suppressed due to low confidence (3)

mcp/server_test.go:83

  • This will panic if any step type is shorter than 5 characters. Use strings.HasPrefix(str, \"step.\") instead to safely check the prefix.
		if str[:5] != "step." {

mcp/server_test.go:364

  • This JSON unmarshal operation appears to serve no purpose—it unmarshals an empty object into a throw-away variable. Consider removing these lines.
	if err := json.Unmarshal([]byte("{}"), new(any)); err != nil {
		t.Fatal(err)
	}

mcp/server.go:542

  • The comment correctly notes that strings.Title is deprecated (SA1019). Consider using cases.Title(language.English).String(prefix) from golang.org/x/text/cases for a non-deprecated alternative.
		fmt.Fprintf(&b, "## %s\n\n", strings.Title(prefix)) //nolint:staticcheck // SA1019: strings.Title is fine for docs

- Use strings.HasPrefix instead of slice to avoid potential panic
- Remove dead JSON unmarshal in test
- Replace deprecated strings.Title with cases.Title from x/text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@intel352 intel352 merged commit 8f63329 into main Feb 27, 2026
14 checks passed
@intel352 intel352 deleted the copilot/add-mcp-server-to-workflow branch February 27, 2026 03:58
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.

3 participants