DYN-9355: add MCP server startup preference and toggle#17155
DYN-9355: add MCP server startup preference and toggle#17155RobertGlobant20 wants to merge 4 commits into
Conversation
Add a user setting to control whether the Dynamo MCP server starts automatically on launch. The DynamoMCP view extension reads this preference (by name) to gate its auto-start, and can still be toggled live from its Extensions menu. - PreferenceSettings: add EnableMcpServerOnStartup (default off). - PreferencesViewModel: add the McpServerEnabledOnStartup wrapper and make the Experimental section visible, since it now hosts this toggle. - PreferencesView: add the toggle to Features > Experimental, with a label and a help tooltip. - Resources: add the label and tooltip strings (resx + designer + en-US). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9355
Add EnableMcpServerOnStartup to DynamoSettings-NewSettings.xml so TestImportCopySettings' "all properties differ from defaults" invariant holds after the new preference was introduced. Add two unit tests covering the preference: default-off behavior and persistence across a save/load round-trip. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| <comment>Preferences | Features | Experimental</comment> | ||
| </data> | ||
| <data name="PreferencesViewEnableMcpServerOnStartup" xml:space="preserve"> | ||
| <value>Start the MCP server when Dynamo launches</value> |
There was a problem hiding this comment.
Do we need to add the text values also for the other Languages?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Thanks for clarifying — no action needed, we ship default + en-US only and the localization team picks up the new strings.
| /// automatically when Dynamo launches. When false, the server stays off until the | ||
| /// user enables it from the MCP extension's Extensions-menu toggle (DYN-9355). | ||
| /// </summary> | ||
| public bool EnableMcpServerOnStartup |
There was a problem hiding this comment.
Do we need to add the new property into the PublicAPI.Shipped.txt file? with both getter and setter signatures
There was a problem hiding this comment.
Yes, but I believe they should go into PublicAPI.Unshipped.txt
There was a problem hiding this comment.
Addressed in 6ab83bb — added both the getter and setter to PublicAPI.Unshipped.txt and confirmed the analyzer build passes.
There was a problem hiding this comment.
Pull request overview
Adds an opt-in Dynamo preference to control whether the Dynamo MCP server auto-starts on launch, and exposes that preference in the Preferences UI (Features > Experimental) via a new toggle and localized strings. This wires the UI to a new PreferenceSettings property and updates test fixtures to keep settings import/copy tests consistent.
Changes:
- Add
PreferenceSettings.EnableMcpServerOnStartup(defaultfalse) with persistence coverage. - Expose the preference in WPF Preferences UI via
PreferencesViewModel.McpServerEnabledOnStartup+ a new toggle inPreferencesView.xaml, and make the Experimental expander visible. - Add localized strings for the toggle label + tooltip; update test settings XML and add unit tests.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/settings/DynamoSettings-NewSettings.xml | Adds the new preference element to keep the “new settings differs from defaults” fixture valid. |
| test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs | Adds unit tests for default value and save/load persistence of the new preference. |
| src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml | Adds the toggle UI under Features > Experimental. |
| src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs | Adds a view-model wrapper property and makes the Experimental section visible. |
| src/DynamoCoreWpf/Properties/Resources.resx | Adds localized label/tooltip resources for the new toggle. |
| src/DynamoCoreWpf/Properties/Resources.en-US.resx | Adds en-US localized label/tooltip resources for the new toggle. |
| src/DynamoCoreWpf/Properties/Resources.Designer.cs | Adds generated strongly-typed accessors for the new resources. |
| src/DynamoCore/Configuration/PreferenceSettings.cs | Adds the new persisted preference property (public API) and default initialization. |
Files not reviewed (1)
- src/DynamoCoreWpf/Properties/Resources.Designer.cs: Language not supported
| <Grid> | ||
| <Grid.RowDefinitions> | ||
| <RowDefinition Height="Auto"/> | ||
| <RowDefinition Height="*"/> | ||
| </Grid.RowDefinitions> |
There was a problem hiding this comment.
Not addressed yet — leaving as-is for now; the single content row doesn't appear to stretch in testing, but we can change the * row to Auto if any empty space shows up.
| /// <summary> | ||
| /// This defines whether the Dynamo MCP (Model Context Protocol) server starts | ||
| /// automatically when Dynamo launches. When false, the server stays off until the | ||
| /// user enables it from the MCP extension's Extensions-menu toggle (DYN-9355). | ||
| /// </summary> | ||
| public bool EnableMcpServerOnStartup | ||
| { | ||
| get | ||
| { | ||
| return isMcpServerEnabledOnStartup; | ||
| } | ||
| set | ||
| { | ||
| isMcpServerEnabledOnStartup = value; | ||
| RaisePropertyChanged(nameof(EnableMcpServerOnStartup)); | ||
| } | ||
| } |
| [Test] | ||
| [Category("UnitTests")] | ||
| public void WhenMcpServerOnStartupIsEnabledThenItPersistsAcrossSaveAndLoad() | ||
| { | ||
| string tempPath = Path.Combine(Path.GetTempPath(), "mcpServerStartupPreference.xml"); | ||
|
|
||
| var settings = new PreferenceSettings(); | ||
| settings.EnableMcpServerOnStartup = true; | ||
|
|
||
| settings.Save(tempPath); | ||
| var loadedSettings = PreferenceSettings.Load(tempPath); | ||
|
|
||
| Assert.IsTrue(loadedSettings.EnableMcpServerOnStartup); | ||
| } |
|
@cursor review |
|
Skipping Bugbot: Bugbot could not find a matching SCM installation for this repository. Please reinstall the GitHub/GitLab installation and/or remove the installation from non-Bugbot accounts. Visit the Bugbot dashboard to update your settings. |
Wait! We have BugBot access? |
jasonstratton
left a comment
There was a problem hiding this comment.
Public API & test cleanup. Otherwise, looks good.
| <comment>Preferences | Features | Experimental</comment> | ||
| </data> | ||
| <data name="PreferencesViewEnableMcpServerOnStartup" xml:space="preserve"> | ||
| <value>Start the MCP server when Dynamo launches</value> |
There was a problem hiding this comment.
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.
| /// automatically when Dynamo launches. When false, the server stays off until the | ||
| /// user enables it from the MCP extension's Extensions-menu toggle (DYN-9355). | ||
| /// </summary> | ||
| public bool EnableMcpServerOnStartup |
There was a problem hiding this comment.
Yes, but I believe they should go into PublicAPI.Unshipped.txt
| var settings = new PreferenceSettings(); | ||
| settings.EnableMcpServerOnStartup = true; | ||
|
|
||
| settings.Save(tempPath); |
There was a problem hiding this comment.
Need to cleanup this file after the test
There was a problem hiding this comment.
Addressed in 6ab83bb — the test now writes to a unique file under the per-test TempFolder, which UnitTestBase auto-cleans on teardown.
- Add EnableMcpServerOnStartup get/set to PublicAPI.Unshipped.txt to satisfy the public API analyzer (jasonstratton, Copilot, edwin). - Write the persistence test to a unique file under the per-test TempFolder (auto-cleaned by UnitTestBase) instead of a fixed temp filename, fixing the cleanup concern and the Path.Combine warning (jasonstratton, Copilot, github-code-quality). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
This PR is being closed due that the scope for this task was updated and the description/acceptance criteria for DYN-9355 was updated, then the UI implemented in this fix is not needed anymore. |




Purpose
DYN-9355: Add a Dynamo preference that controls whether the Dynamo MCP server starts automatically on launch. The MCP server is provided by the DynamoMCP view extension, which currently starts it unconditionally. This PR adds the user-facing setting (and the backing preference) that the extension reads to decide whether to auto-start; the extension itself also exposes a live on/off toggle in its Extensions menu (separate companion PR in the DynamoMCP repo).
Key changes:
Companion change: the DynamoMCP extension (separate repo/PR, same DYN-9355 branch) reads EnableMcpServerOnStartup by name via reflection, so it does not take a hard compile-time dependency on this property and continues to work against Dynamo builds that predate it.
Declarations
Check these if you believe they are true
Release Notes
DYN-9355: Add a Dynamo preference that controls whether the Dynamo MCP server starts automatically on launch.
Reviewers
@johnpierson @jasonstratton @edwin-vasquez-ucaldas
FYIs
@jnealb