Skip to content

DYN-9355: add MCP server startup preference and toggle#17155

Closed
RobertGlobant20 wants to merge 4 commits into
masterfrom
DYN-9355-EnableDisable-MCPServer
Closed

DYN-9355: add MCP server startup preference and toggle#17155
RobertGlobant20 wants to merge 4 commits into
masterfrom
DYN-9355-EnableDisable-MCPServer

Conversation

@RobertGlobant20

Copy link
Copy Markdown
Contributor

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:

  • PreferenceSettings (DynamoCore): add public bool EnableMcpServerOnStartup, defaulting to false (opt-in). Serializes to DynamoSettings.xml like the other preferences.
  • PreferencesViewModel: add the McpServerEnabledOnStartup wrapper that reads/writes the new preference, and change IsExperimentalExpanderVisible to return true so the Features > Experimental section is shown (it now hosts this toggle; it was previously hidden because the section had no content).
  • PreferencesView.xaml: add the toggle to Features > Experimental, with a label and a help tooltip explaining that the server can also be toggled live from the Extensions menu without restarting Dynamo.
  • Resources: add PreferencesViewEnableMcpServerOnStartup and PreferencesViewEnableMcpServerOnStartupTooltip strings (Resources.resx + Resources.Designer.cs + Resources.en-US.resx).

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

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>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9355

@RobertGlobant20

Copy link
Copy Markdown
Contributor Author

GIF showing the functionality in Dynamo.
DynamoMCPOnOff

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 thread test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs Fixed
<comment>Preferences | Features | Experimental</comment>
</data>
<data name="PreferencesViewEnableMcpServerOnStartup" xml:space="preserve">
<value>Start the MCP server when Dynamo launches</value>

Copy link
Copy Markdown
Contributor

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 text values also for the other Languages?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

/// 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

Copy link
Copy Markdown
Contributor

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.txt file? with both getter and setter signatures

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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.txt and confirmed the analyzer build passes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (default false) with persistence coverage.
  • Expose the preference in WPF Preferences UI via PreferencesViewModel.McpServerEnabledOnStartup + a new toggle in PreferencesView.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

Comment on lines 1098 to 1102
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +829 to +845
/// <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));
}
}
Comment on lines +440 to +453
[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);
}
@johnpierson

Copy link
Copy Markdown
Member

@cursor review

@cursor

cursor Bot commented Jun 10, 2026

Copy link
Copy Markdown

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.

@jasonstratton

Copy link
Copy Markdown
Contributor

@johnpierson

@cursor review

Wait! We have BugBot access?

@jasonstratton jasonstratton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

/// 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

Copy link
Copy Markdown
Contributor

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

var settings = new PreferenceSettings();
settings.EnableMcpServerOnStartup = true;

settings.Save(tempPath);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to cleanup this file after the test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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 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>
@sonarqubecloud

Copy link
Copy Markdown

@RobertGlobant20

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants