Skip to content

feat: add workflow CRUD commands and MCP workflow tools#18

Merged
eskp merged 4 commits intomainfrom
feature/workflow-crud-mcp-tools
Mar 15, 2026
Merged

feat: add workflow CRUD commands and MCP workflow tools#18
eskp merged 4 commits intomainfrom
feature/workflow-crud-mcp-tools

Conversation

@eskp
Copy link
Copy Markdown
Contributor

@eskp eskp commented Mar 15, 2026

Summary

  • Adds kh wf create, kh wf delete, kh wf update CLI commands for programmatic workflow management
  • Adds 8 static MCP tools to kh serve --mcp: workflow_list, workflow_get, workflow_create, workflow_update, workflow_delete, workflow_execute, execution_status, execution_logs
  • Closes the gap between kh serve --mcp (action-only) and the keeperhub-mcp plugin (full workflow CRUD)

New Commands

Command Description
kh wf create --name "X" [--nodes-file f.json] Create workflow with optional node data from file or inline JSON
kh wf delete <id> [--yes] Delete with confirmation prompt
kh wf update <id> [--name] [--nodes-file] Update name, description, or nodes

MCP Static Tools

Registered via registerStaticTools() in cmd/serve/tools.go, separate from the dynamic schema-driven action tools:

Tool Method Endpoint
workflow_list GET /api/workflows
workflow_get GET /api/workflows/{id}
workflow_create POST /api/workflows/create
workflow_update PATCH /api/workflows/{id}
workflow_delete DELETE /api/workflows/{id}
workflow_execute POST /api/workflow/{id}/execute
execution_status GET /api/workflows/executions/{id}/status
execution_logs GET /api/workflows/executions/{id}/logs

Test plan

  • kh wf create --name "Test" --host http://localhost:3000 --json returns workflow ID
  • kh wf delete <id> --yes --host http://localhost:3000 deletes it
  • kh wf update <id> --name "New" --host http://localhost:3000 updates it
  • kh serve --mcp --host http://localhost:3000 exposes all 8 static tools alongside action tools
  • go build ./... passes

eskp added 4 commits March 15, 2026 17:47
The API requires nodes and edges fields. With omitempty, nil slices
were omitted from the JSON body, causing 400 errors when creating
workflows without --nodes-file.
Instead of the cryptic "giving up after 4 attempts" from the retryable
HTTP client, surface a message explaining the workflow has existing runs
that prevent deletion.
@eskp eskp merged commit 0a174d4 into main Mar 15, 2026
4 checks passed
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.

1 participant