-
Notifications
You must be signed in to change notification settings - Fork 675
DYN-9355: add MCP server startup preference and toggle #17155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
83a2831
0073fa4
50310b8
6ab83bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -740,6 +740,14 @@ Don't worry, you'll have the option to save your work.</value> | |
| <value>Experimental</value> | ||
| <comment>Preferences | Features | Experimental</comment> | ||
| </data> | ||
| <data name="PreferencesViewEnableMcpServerOnStartup" xml:space="preserve"> | ||
| <value>Start the MCP server when Dynamo launches</value> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to add the text values also for the other Languages?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @edwin-vasquez-ucaldas , we provide the default (in English) and en-US and the localization team will discover that there are new strings and provide translations for us.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for clarifying — no action needed, we ship default + en-US only and the localization team picks up the new strings. |
||
| <comment>Preferences | Features | Experimental</comment> | ||
| </data> | ||
| <data name="PreferencesViewEnableMcpServerOnStartupTooltip" xml:space="preserve"> | ||
| <value>When enabled, the Dynamo MCP server starts automatically with Dynamo. When disabled, you can still turn it on at any time from the Extensions menu without restarting Dynamo.</value> | ||
| <comment>Preferences | Features | Experimental</comment> | ||
| </data> | ||
| <data name="DynamoViewSettingMenu" xml:space="preserve"> | ||
| <value>_Settings</value> | ||
| <comment>Setting menu</comment> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -427,6 +427,32 @@ public void TestImportCopySettings() | |
| Assert.IsTrue(checkEquality.SamePropertyValues.Count == checkEquality.Properties.Count); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category("UnitTests")] | ||
| public void WhenSettingsAreNewThenMcpServerOnStartupDefaultsToFalse() | ||
| { | ||
| // The MCP server must stay off unless the user opts in (DYN-9355). | ||
| var settings = new PreferenceSettings(); | ||
|
|
||
| Assert.IsFalse(settings.EnableMcpServerOnStartup); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category("UnitTests")] | ||
| public void WhenMcpServerOnStartupIsEnabledThenItPersistsAcrossSaveAndLoad() | ||
| { | ||
| // Use a unique file under the per-test TempFolder, which UnitTestBase cleans up on teardown. | ||
| string tempPath = GetNewFileNameOnTempPath("xml"); | ||
|
|
||
| var settings = new PreferenceSettings(); | ||
| settings.EnableMcpServerOnStartup = true; | ||
|
|
||
| settings.Save(tempPath); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to cleanup this file after the test
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in 6ab83bb — the test now writes to a unique file under the per-test |
||
| var loadedSettings = PreferenceSettings.Load(tempPath); | ||
|
|
||
| Assert.IsTrue(loadedSettings.EnableMcpServerOnStartup); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category("UnitTests")] | ||
| public void TestTaintedFile() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add the new property into the
PublicAPI.Shipped.txtfile? with both getter and setter signaturesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I believe they should go into PublicAPI.Unshipped.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 6ab83bb — added both the getter and setter to
PublicAPI.Unshipped.txtand confirmed the analyzer build passes.