McpToolServerConfigurationService do not assume the env is development unless explicitly set - #90
Merged
Conversation
…t unless explicitly set
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the environment detection logic in the McpToolServerConfigurationService to follow SDK best practices. Instead of defaulting to development mode when NODE_ENV is unset, the service now defaults to production behavior, requiring developers to explicitly set NODE_ENV='development' to enable development features.
Key Changes:
- Changed the default value for
NODE_ENVfrom'Development'to an empty string in theisDevScenario()method - This ensures the SDK defaults to production-safe behavior (querying the remote tooling gateway) rather than development behavior (reading from local ToolingManifest.json)
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
rahuldevikar761
approved these changes
Nov 26, 2025
rbrighenti
enabled auto-merge (squash)
November 26, 2025 17:26
JesuTerraz
approved these changes
Nov 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As an SDK to be used by other applications it's better to assume less and not force users to set environment variables to achieve what should be the default behavior (production) when it can be avoided.
This pull request makes a small change to the environment detection logic in the
McpToolServerConfigurationServiceclass. The default value forNODE_ENVis now set to an empty string instead of'Development', making the development check more explicit and less assuming.I could be convinced to fallback straight to 'production' for example. Similarly, we could also to expand the conditional on the line after that to check for other similar strings like 'dev' and 'local'. But this is the minimal change that achieves the desired behavior.