Skip to content

McpToolServerConfigurationService do not assume the env is development unless explicitly set - #90

Merged
rbrighenti merged 1 commit into
mainfrom
users/rbrighenti/tooling-do-not-assume-dev-env
Nov 26, 2025
Merged

McpToolServerConfigurationService do not assume the env is development unless explicitly set#90
rbrighenti merged 1 commit into
mainfrom
users/rbrighenti/tooling-do-not-assume-dev-env

Conversation

@rbrighenti

Copy link
Copy Markdown
Contributor

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 McpToolServerConfigurationService class. The default value for NODE_ENV is 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.

@rbrighenti
rbrighenti requested a review from a team as a code owner November 26, 2025 17:10
Copilot AI review requested due to automatic review settings November 26, 2025 17:10

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

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_ENV from 'Development' to an empty string in the isDevScenario() 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.

@rbrighenti
rbrighenti enabled auto-merge (squash) November 26, 2025 17:26
@rbrighenti
rbrighenti merged commit d448449 into main Nov 26, 2025
13 checks passed
@pontemonti
pontemonti deleted the users/rbrighenti/tooling-do-not-assume-dev-env branch December 5, 2025 17:09
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.

4 participants