feat: add IDE-support tools to MCP server#207
Merged
Conversation
…dation tools to MCP server
Adds five new tools to the workflow MCP server to help IDE AI assistants author
and validate workflow YAML configurations with accurate, schema-driven knowledge:
- get_module_schema: returns full ModuleSchema for a module type (description,
config fields with key/type/description/required/default/options, inputs,
outputs, example snippet)
- get_step_schema: returns step type info (description, config keys with types
and descriptions via stepTypeInfoFull, plugin, example snippet)
- get_template_functions: returns all available pipeline template functions with
name, signature, description, and example (uuid/uuidv4/now/lower/default/
trimPrefix/trimSuffix/json/step/trigger)
- validate_template_expressions: parses a YAML config, walks pipeline step
configs for {{ }} expressions, and emits warnings for forward references,
self-references, undefined step references, and hyphenated dot-access patterns
- get_config_examples: lists .yaml files from the example/ directory or returns
a specific example's content by name
All five tools are covered by tests in mcp/tools_test.go (63 tests total, all pass).
golangci-lint clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds five IDE-support tools to the MCP server to improve the developer experience when authoring workflow YAML configurations. The tools provide schema information, template function documentation, template validation, and access to example configurations.
Changes:
- Adds
get_module_schema,get_step_schema,get_template_functions,validate_template_expressions, andget_config_examplestools - Provides comprehensive schema information including config fields, types, descriptions, and examples
- Implements template expression validation with checks for forward references, undefined steps, and syntax issues
- Includes 30 tests covering happy paths and error cases for all new tools
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| mcp/tools.go | Implements 5 new MCP tools with schema retrieval, validation, and documentation capabilities (951 lines) |
| mcp/tools_test.go | Comprehensive test suite covering all new tools with 30 test cases (788 lines) |
| mcp/server.go | Registers the new tools in the MCP server initialization |
Comments suppressed due to low confidence (2)
mcp/tools_test.go:302
- The test checks for 8 expected functions but the actual implementation has 10 functions (missing
trimPrefixandtrimSuffixfrom the expected list). While the test will still pass since it only checks that the listed functions exist, it should verify all functions are present for complete coverage. Consider adding "trimPrefix" and "trimSuffix" to the expectedFunctions list.
expectedFunctions := []string{"uuid", "uuidv4", "now", "lower", "default", "json", "step", "trigger"}
for _, expected := range expectedFunctions {
if !funcNames[expected] {
t.Errorf("expected function %q not found in list", expected)
}
}
mcp/tools_test.go:572
- File permission mode 0640 is inconsistent with the project pattern. In server_test.go line 835, test plugins use 0640, but directories use 0750. For consistency, consider using 0600 for files requiring restrictive permissions or 0644 for readable files.
if err := os.WriteFile(dir+"/"+f, []byte("# test example\nmodules: []\n"), 0640); err != nil {
- Issues 1-3: confirmed false positives — helpers are defined in server_test.go (same package)
- Issue 4: track warnedRefs set to avoid duplicate hyphen warnings for refs already covered by forward/undefined-reference checks
- Issue 5: compile self-reference regex once per step, outside the expression loop
- Issue 6: validate pluginDir follows expected data/plugins layout before deriving exampleDir
- Issue 7: accumulate YAML marshal/unmarshal errors as warnings instead of silently skipping
- Issue 8: add path traversal protection in readExampleFile (reject .., path separators, validate resolved path within exampleDir)
- Issue 9: update hyphen warning message to say the engine auto-corrects it
- Issue 10: change template regex to (?s)\{\{.*?\}\} (non-greedy dotall) with heuristic comment
- Issue 11: remove "(default: 200)" from status field description since it is Required: true
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.
Summary
Test plan
🤖 Generated with Claude Code