Skip to content

feat(personal-mcp): add trigger, authoring and diagnostic tools - #52

Merged
artempartos merged 1 commit into
developfrom
feat/personal-mcp-authoring-tools
Aug 7, 2026
Merged

artempartos merged 1 commit into
developfrom
feat/personal-mcp-authoring-tools

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Why

A user built four workflows end-to-end through the personal MCP server and could not connect a single one to anything: no tool spoke to TriggerBinding or ColumnWorkflowBinding, so every trigger — a board column, a cron report, a Slack intake — had to be wired by hand in the UI. Three smaller gaps forced the same fallback: a workflow could not be renamed, a step's instructions could only be blind-overwritten because get_workflow truncates them at 500 chars, and a step run that died in ten seconds reported nothing beyond its state.

list_project_tools returning [] turned out to be a real bug rather than a missing feature. Tool.visible_for_project yields attachable platform tools or the project's custom ones; the chained .ui_visible (db_source) ANDed the platform half straight back out, so any project without custom tools got an empty list and tool_ids had to be copied between steps sight unseen.

What

Triggers (list / create / update / delete_workflow_trigger) — one surface over both binding kinds, mirroring Api::V1::Projects::Workflows::TriggersController. kind is column | slack | schedule | webhook | event; kind=webhook also provisions a WebhookEndpoint and returns its URL and secret. Model validation messages reach the caller verbatim, so the auto-run rejection names the steps still waiting on a human, and Temporalio::Error reports "saved, but scheduling failed — re-save to retry".

Workflow authoring — update_workflow (name, description, base resources), get_workflow_step (full untruncated instructions plus every wiring field), duplicate_workflow (wraps WorkflowDuplicator, returns its needs_setup summary).

Introspection — get_agent (full persona), get_skill (full content), and the list_project_tools fix, which now also carries description, tags and requires_integration so ids stop being opaque.

Board and runs — archive_board_task, list_gates, delete_gate, get_step_run (error category/message/history, skip reason, retries, plus the terminal session's context_metadata, where bmad_install_status lands).

Existing tools — create_workflow_step takes the whole wiring in one call; update_workflow_step gains bmad_enabled and allow_non_interactive; get_workflow reports base resources and flags each truncated instruction; create_board_column inserts at a taken position by shifting instead of failing.

Every param that replaces a list wholesale now says so and names the tool to read the current value with.

Deliberately not included

  • create_gate / resolve_gate — Gate supports exactly three CI gate types, created and resolved by GitHub/GitLab webhooks. A manual resolve is an override of that path, which is a product decision rather than a tool. list_gates says so in its description.
  • bmad_modules on a step — not a step column at all; it lives in terminal_sessions.session_config. Exposing it needs a migration. bmad_enabled is included.
  • Integration channel listing / test message — a live Slack API call with an outbound side effect, not a field addition.

Notes

  • create_board_column shifts the tail in descending order inside a transaction: there is a DB unique index on (board_id, position) on top of the model validation, and the association's default order(:position) means a chained .order(position: :desc) would silently stay ascending — hence .reorder.
  • duplicate_workflow authorizes duplicate? on the target project as well when it differs from the source; membership alone does not imply write access there.
  • The webhook path is wrapped in a transaction, unlike the controller it mirrors: since the auto-run rule rejects most first attempts, the controller's create-endpoint-then-create-binding order leaks a WebhookEndpoint per retry. That leak still exists in triggers_controller.rb and is worth a separate fix.
  • The agent-facing references/aixle-system-reference.md documented only column bindings and still called gates TaskWaits; §6 now covers event triggers, the all-steps-auto-run rule and the UTC/DST timezone trap. The build_workflow / author_step MCP prompts and the in-app MCP docs page were updated to match.

Verification

docker compose exec -T web make check_all — green across all eight checks (rails-test, system-test, rubocop, brakeman, eslint, typescript, fe-test, vite-build). Coverage: backend 90.76%, frontend 78.34%.

New/extended integration tests: personal_mcp_triggers_test.rb (new), personal_mcp_step_runs_test.rb (new), plus additions to personal_mcp_workflows_test.rb, personal_mcp_resources_test.rb and personal_mcp_board_test.rb. Each new tool is covered for its happy path and for cross-tenant isolation.

🤖 Generated with Claude Code

A user built four workflows entirely through the personal MCP server and
could not connect a single one to anything: no tool spoke to TriggerBinding
or ColumnWorkflowBinding, so every trigger had to be wired by hand in the
UI. Three smaller gaps forced the same fallback — a workflow could not be
renamed, a step's instructions could only be blind-overwritten because
get_workflow truncates them, and a failed step run reported nothing beyond
its state.

list_project_tools returning [] was a real bug, not a missing feature:
`visible_for_project` yields platform tools OR the project's custom ones,
and the chained `ui_visible` (db_source) ANDed the platform half back out,
so tool_ids had to be copied between steps sight unseen.

Adds: the four workflow-trigger tools over both binding kinds, update_workflow,
get_workflow_step, duplicate_workflow, get_agent, get_skill, archive_board_task,
list_gates, delete_gate, get_step_run. create_workflow_step now takes the
whole wiring in one call; create_board_column inserts with a shift instead of
failing on a taken position.

Gates get list/delete but no create/resolve: the three gate types are CI gates
that GitHub/GitLab webhooks own, and a manual resolve is an override of that
path, not a tool. Steps get bmad_enabled but not bmad_modules, which is not a
step column at all — it lives in terminal_sessions.session_config.

The agent-facing reference documented only column bindings, and the
build_workflow prompt stopped at trigger_workflow; both now cover event
triggers, the all-steps-auto-run rule, and the UTC/DST timezone trap.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit 0af5d09 into develop Aug 7, 2026
7 checks passed
alex-astafyev pushed a commit to alex-astafyev/flow that referenced this pull request Aug 19, 2026
* origin/develop:
  feat(resources): unify Agents/Wrappers/Repositories/Integrations tables (AixleHQ#51)
  feat(personal-mcp): add trigger, authoring and diagnostic tools (AixleHQ#52)
  ci: stop cancelling develop runs when merges land back to back (AixleHQ#50)
  fix(container-runtime): honor the timeout option on Docker exec
  fix(container-runtime): honor the timeout option on Docker exec (AixleHQ#48)
  ci: publish coverage badges from develop runs (AixleHQ#49)

# Conflicts:
#	.github/workflows/ci.yml
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