Repository navigation
feat: add App Watch tools to MCP server (EPINIO-719) - #4
Merged
Merged
Conversation
Environments that cannot use MCP still have the Epinio CLI and an LLM; this skill maps core tools to epinio commands they can run instead.
Expose the inner-loop dev workflow as two new MCP tools so an AI agent can live-reload a running app without a full buildpack push on every change: - watch_app_startup: uploads full source, runs buildpack staging, installs the supervisor wrapper, and waits for the app to be ready. Must be called after any push_app/deploy_staged/restart_app that recreates the pod. - sync_app: streams only changed files (files mode) or a rebuilt binary (binary mode) into the running pod. The supervisor restarts the app in place. Returns an actionable error with watch_app_startup guidance when it detects the supervisor is missing (no ready pod / 503). Both tools follow the existing files-map pattern from push_app and go through the Epinio REST API (PATCH .../source, POST .../sync) — no CLI subprocess, no local filesystem polling. Supporting changes: - client: AppSourcePatch, AppSync, WatchAppStartup methods + shared uploadMultipart helper - client/types: APIResponse type - tools/push: buildTar helper for plain (non-gzip) sync archives - tests: client_test covers AppSourcePatch/AppSync; watch_test covers buildTar, binary-name defaulting, and wrapSyncError branching - docs: AGENTS.md, README, skills/epinio-cli/SKILL.md updated
dcharles525
self-requested a review
September 2, 2026 19:53
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.
What changed
Adds the App Watch inner-loop workflow to the MCP server so an agent can live-reload a running app without a full buildpack push on every change.
New core tools
watch_app_startup— uploads full source viaPATCH .../applications/:app/source, waits for staging + ready, installs the supervisor wrappersync_app— uploads changed files (filesmode) or a rebuilt binary (binarymode) viaPOST .../applications/:app/sync; supervisor restarts the app in placeClient
AppSourcePatch,AppSync, andWatchAppStartupon the Epinio REST client, plus a shareduploadMultiparthelperAPIResponsetype for the sync status envelopeAgent UX for the stale-supervisor gotcha
push_app/deploy_staged/restart_apprecreate the pod without the supervisor, sowatch_app_startupmust be re-run before furthersync_appcallssync_appwrapsno ready pod/503errors with an explicit hint to callwatch_app_startupagain (same signals the CLI uses)Docs / skill
AGENTS.md,README.md, andskills/epinio-cli/SKILL.mdupdated to describe the new tools and CLI mappingThis is not a local filesystem watcher and does not shell out to
epinio app watch. The agent supplies afilesmap (same pattern aspush_app) and owns change detection.Why
Move MCP closer to UI/CLI parity for the experimental App Watch / inner-loop sync flow already available via
epinio app watch.Closes EPINIO-719
What to test
Unit (no cluster)
gofmt -l tools/watch.go tools/watch_test.go client/client.go— expect empty outputgo test ./client/... ./tools/...— expect pass (coversAppSourcePatch/AppSyncmultipart,buildTar,wrapSyncError)CI gate (Linux / make available)
3.
make check— fmt-check, vet, lint, testAgainst a live Epinio cluster (≥ 1.14.x with App Watch APIs)
4. Run MCP locally with
EPINIO_API_URL/ credentials, then:push_appa simple Node (or Python) app so it existswatch_app_startupwith the fullfilesmap — expect staging + ready, status mentions supervisor installedsync_appwithmode: filesand only a changed source file — expect success; verify the running app reflects the change (route / logs)restart_apporpush_appsync_appagain withoutwatch_app_startup— expect an error that mentions callingwatch_app_startupagainfilesentry,mode: binary) — sync succeeds and app reloadsPossible regressions
buildTarwas added next tobuildTarGzintools/push.go;push_app/upload_and_stagestill usebuildTarGzonly — re-check those tools still package source correctlyuploadMultipartis new; existingUploadAppis unchanged, but any future callers should keep gzip vs plain-tar expectations straight (sourcepatch = tar.gz,sync= plain tar)appMutationGuardlike other mutators — elevated adoption should still block sync/startup on adopted apps when elevated is enabledType
featureChecklist
make checkpasses (fmt-check, vet, lint, test) —gofmt+go test ./...verified locally on Windows; fullmake checkneeds Linux/make(please confirm in CI)epinio/docsstill needed forwatch_app_startup/sync_appEPINIO_MCP_ELEVATED, reaches directly into Kubernetes and needs the standard-elevated RBAC)epinio/docs— still to open