Conversation
travist
requested changes
May 22, 2026
travist
approved these changes
May 29, 2026
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.
Description
Ticket https://formio.atlassian.net/browse/FIO-11561
This PR enables the MCP server to utilize form revisions. It adds only two new tools:
form_revisions_listandform_revision_get. For the rest of the form revision functionality, the existingform_*tools have been modified to support it.The main highlights are:
form_revisions_list,form_revision_getform_createenables form revisions by default (original)form_updateincludes a note on what changed for every form mutation (note is ignored if the deployment/form doesn't enable revisions)form_createandform_update) that they will be executing form mutations without history (the user is prompted once for all sessions per deployment/base url)form_updateis executing against an existing form that does not have revisions enabled, the user is prompted to either enable revisions or knowingly proceed without mutation history (if the user declines enabling revisions, they are prompted once per form per session)form_updateOpinionated Decisions
Draft Publish and Revision Revert Flows
In the Formio developer portal, both the draft publish and revision revert flows use
PUT form/:formIdand update only a subset of properties on the form. I opted to emulate that behavior for the MCP server. We could opt to make every property draft-updatable and revertible, but I assume (perhaps wrongly) that there were reasons that these choices were made for the portal. For instance, perhaps it would be undesirable to revert a form’s submission access or form settings when the only intention is to return to a prior form component schema.This of course does not limit what can be updated through the standard form update (not using a draft).
Draft Publish Flow
A draft form is simply a revision (a document in the Mongo
formrevisionscollection). In the current PR, the draft save and publish flows only allow updating the following subset of fields from the draft revision. This list was compiled from:['components', 'settings', 'tags', 'properties']. I believe it should also take'display'from the draft (since'display'is one of the revertible properties––see below). I think there’s a bug in the portal here. When the draft is saved, only these fields are updated, the rest of the form remains untouched.['controller', 'esign']to the list of properties that can be updated in a draft flow in the MCP server.So, the full set of properties used by the MCP server:
ai/packages/mcp-server/src/revisions/flows.ts
Lines 5 to 13 in c76d1e2
Revision Revert Flow
Similarly, the reversion flow takes only a subset of fields from a past revision document and leaves the rest of the document properties as they are on the latest/live form. This is the list of properties taken from the revision when reverting to a prior revision in the portal.
ai/packages/mcp-server/src/revisions/flows.ts
Line 15 in c76d1e2