Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/System Application/App/MCP/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
"name": "Upgrade Tags",
"publisher": "Microsoft",
"version": "28.1.0.0"
},
{
"id": "f7964d32-7685-400f-8297-4bc17d0aab0e",
"name": "Microsoft User Feedback",
"publisher": "Microsoft",
"version": "28.1.0.0"
}
],
"internalsVisibleTo": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace System.MCP;

using System.Azure.Identity;
using System.Environment;
using System.Feedback;
using System.Reflection;
using System.Utilities;

Expand Down Expand Up @@ -54,6 +55,10 @@ codeunit 8351 "MCP Config Implementation"
JsonFilterTxt: Label 'JSON Files (*.json)|*.json';
InvalidJsonErr: Label 'The selected file is not a valid configuration file.';
ConfigNameExistsMsg: Label 'A configuration with the name ''%1'' already exists. Please provide a different name.', Comment = '%1 = configuration name';
MCPServerFeedbackConfirmQst: Label 'We noticed you no longer have any active configurations. Could you share what made you decide to stop using the MCP server? Your feedback helps us improve the experience.';
MCPServerFeedbackQst: Label 'What could we do to improve the MCP server experience?';
NoActiveConfigsFeedbackTxt: Label 'No active configs feedback triggered', Locked = true;
GeneralFeedbackTxt: Label 'General MCP feedback triggered', Locked = true;

#region Configurations
internal procedure GetConfigurationIdByName(Name: Text[100]): Guid
Expand Down Expand Up @@ -1037,6 +1042,40 @@ codeunit 8351 "MCP Config Implementation"
end;
#endregion

#region Feedback
internal procedure TriggerNoActiveConfigsFeedback()
var
Feedback: Codeunit "Microsoft User Feedback";
begin
if not Confirm(MCPServerFeedbackConfirmQst, true) then
exit;

Feedback.WithCustomQuestion(MCPServerFeedbackQst, MCPServerFeedbackQst).WithCustomQuestionType(Enum::FeedbackQuestionType::Text);
Feedback.RequestDislikeFeedback('MCP Server', 'MCPServer', 'Model Context Protocol (MCP) Server');

Session.LogMessage('0000RTR', NoActiveConfigsFeedbackTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::All, 'Category', GetTelemetryCategory());
end;

internal procedure TriggerGeneralFeedback()
var
Feedback: Codeunit "Microsoft User Feedback";
begin
Feedback.RequestFeedback('MCP Server', 'MCPServer', 'Model Context Protocol (MCP) Server');

Session.LogMessage('0000RTS', GeneralFeedbackTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::All, 'Category', GetTelemetryCategory());
end;

internal procedure HasNoActiveConfigurations(): Boolean
var
MCPConfiguration: Record "MCP Configuration";
begin
MCPConfiguration.SetRange(Active, true);
MCPConfiguration.SetFilter(Name, '<>%1', '');
exit(MCPConfiguration.IsEmpty());
end;
#endregion Feedback

#region Telemetry
local procedure GetDimensions(MCPConfiguration: Record "MCP Configuration") Dimensions: Dictionary of [Text, Text]
begin
Dimensions.Add('Category', GetTelemetryCategory());
Expand Down Expand Up @@ -1089,4 +1128,5 @@ codeunit 8351 "MCP Config Implementation"
Session.LogMessage('0000QEB', MCPConfigurationDeletedLbl, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::All, GetDimensions(MCPConfiguration));
Session.LogAuditMessage(StrSubstNo(MCPConfigurationAuditDeletedLbl, MCPConfiguration.Name, UserSecurityId(), CompanyName()), SecurityOperationResult::Success, AuditCategory::ApplicationManagement, 3, 0);
end;
#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,24 @@ page 8350 "MCP Config List"
Scope = Repeater;

trigger OnAction()
var
MCPConfigImplementation: Codeunit "MCP Config Implementation";
begin
MCPConfigImplementation.CopyConfiguration(Rec.SystemId);
end;
}
}
area(Processing)
{
action(GiveFeedback)
{
Caption = 'Give Feedback';
ToolTip = 'Share your feedback about the MCP server experience.';
Image = Questionaire;

trigger OnAction()
begin
MCPConfigImplementation.TriggerGeneralFeedback();
end;
}
group(Advanced)
{
Caption = 'Advanced';
Expand All @@ -87,8 +96,6 @@ page 8350 "MCP Config List"
Scope = Repeater;

trigger OnAction()
var
MCPConfigImplementation: Codeunit "MCP Config Implementation";
begin
MCPConfigImplementation.ShowConnectionString(Rec.Name);
end;
Expand All @@ -108,8 +115,6 @@ page 8350 "MCP Config List"
Scope = Repeater;

trigger OnAction()
var
MCPConfigImplementation: Codeunit "MCP Config Implementation";
begin
MCPConfigImplementation.ExportConfigurationToFile(Rec.SystemId, Rec.Name);
end;
Expand All @@ -122,8 +127,6 @@ page 8350 "MCP Config List"
AccessByPermission = tabledata "MCP Configuration" = IM;

trigger OnAction()
var
MCPConfigImplementation: Codeunit "MCP Config Implementation";
begin
MCPConfigImplementation.ImportConfigurationFromFile();
CurrPage.Update(false);
Expand All @@ -134,6 +137,7 @@ page 8350 "MCP Config List"
area(Promoted)
{
actionref(Promoted_Copy; Copy) { }
actionref(Promoted_GiveFeedback; GiveFeedback) { }
group(Promoted_Advanced)
{
Caption = 'Advanced';
Expand All @@ -154,4 +158,23 @@ page 8350 "MCP Config List"
Filters = where(Active = const(true));
}
}

trigger OnOpenPage()
begin
HadActiveConfigsOnOpen := not MCPConfigImplementation.HasNoActiveConfigurations();
end;

trigger OnQueryClosePage(CloseAction: Action): Boolean
begin
if not HadActiveConfigsOnOpen then
exit;

if MCPConfigImplementation.HasNoActiveConfigurations() then
MCPConfigImplementation.TriggerNoActiveConfigsFeedback();
end;

var
MCPConfigImplementation: Codeunit "MCP Config Implementation";
HadActiveConfigsOnOpen: Boolean;

}