Add MCP server exposing workflow engine to AI assistants#187
Merged
Conversation
…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
Contributor
There was a problem hiding this comment.
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-mcpMakefile 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.Titleis deprecated (SA1019). Consider usingcases.Title(language.English).String(prefix)fromgolang.org/x/text/casesfor 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usinggithub.com/mark3labs/mcp-gov0.27.0 over stdio transportcmd/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 aswfctl validateinspect_config— returns structured summary with dependency graphgenerate_schema— produces JSON Schema for config filesget_config_skeleton— generates template YAML for given module typeslist_plugins— scans plugin directory for installed external pluginsResources (3)
workflow://docs/overview— architecture and key conceptsworkflow://docs/yaml-syntax— config file syntax guideworkflow://docs/module-reference— dynamically generated fromschema.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: addedbuild-mcptarget💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.