diff --git a/internal/shared/types/app_manifest.go b/internal/shared/types/app_manifest.go index 5c875b53..faaf26d4 100644 --- a/internal/shared/types/app_manifest.go +++ b/internal/shared/types/app_manifest.go @@ -110,6 +110,7 @@ type AppSettings struct { FunctionRuntime FunctionRuntime `json:"function_runtime,omitempty" yaml:"function_runtime,flow,omitempty"` TokenRotationEnabled *bool `json:"token_rotation_enabled,omitempty" yaml:"token_rotation_enabled,omitempty"` SiwsLinks *SiwsLinks `json:"siws_links,omitempty" yaml:"siws_links,flow,omitempty"` + IsMCPEnabled *bool `json:"is_mcp_enabled,omitempty" yaml:"is_mcp_enabled,omitempty"` } type WorkflowStep struct { diff --git a/internal/shared/types/app_manifest_test.go b/internal/shared/types/app_manifest_test.go index 0d57b23b..1aa60787 100644 --- a/internal/shared/types/app_manifest_test.go +++ b/internal/shared/types/app_manifest_test.go @@ -263,6 +263,41 @@ func Test_AppManifest_AppSettings_SiwsLinks(t *testing.T) { } } +func Test_AppManifest_AppSettings_IsMCPEnabled(t *testing.T) { + truth := true + tests := map[string]struct { + settings *AppSettings + expectedMCPValue *bool + expectedJSON string + }{ + "undefined setting has no value": { + settings: &AppSettings{}, + expectedMCPValue: nil, + expectedJSON: `{}`, + }, + "defined setting has a value": { + settings: &AppSettings{IsMCPEnabled: &truth}, + expectedMCPValue: &truth, + expectedJSON: `{"is_mcp_enabled":true}`, + }, + } + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + manifest := AppManifest{ + Settings: tc.settings, + } + if tc.settings != nil { + actualJSON, err := json.Marshal(tc.settings) + require.NoError(t, err) + assert.Equal(t, tc.expectedJSON, string(actualJSON)) + assert.Equal(t, tc.expectedMCPValue, manifest.Settings.IsMCPEnabled) + } else { + assert.Nil(t, manifest.Settings) + } + }) + } +} + func Test_AppManifest_AppSettings_IncomingWebhooks(t *testing.T) { falsity := false expectedIncomingWebhooks := IncomingWebhooks{