Skip to content

Conversation

@nirinchev
Copy link
Contributor

Description

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@nirinchev nirinchev requested a review from a team as a code owner December 3, 2025 13:14
Copilot AI review requested due to automatic review settings December 3, 2025 13:14
Copy link
Contributor

Copilot AI left a comment

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 updates the mongodb-mcp-server dependency to version ^1.3.0-pre.2 (from ^1.0.3-prerelease.1) and adapts the codebase to accommodate API changes in the newer version, including the use of UserConfigSchema for validation and ConnectionStateConnected class for state management.

Key Changes

  • Replaced defaultUserConfig import with UserConfigSchema and derives default config dynamically
  • Updated connection state management to use ConnectionStateConnected class constructor
  • Changed telemetry property from genuineMongoDB.dbType to genuineMongoDB.serverName

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Updated mongodb-mcp-server to ^1.3.0-pre.2 and mongodb-data-service to ^22.36.0
src/mcp/mcpConfig.ts Replaced defaultUserConfig import with schema-based approach using UserConfigSchema
src/mcp/mcpController.ts Updated to use UserConfigSchema.parse() for validation and changed return type to Partial<UserConfig>
src/mcp/mcpConnectionManager.ts Refactored to use ConnectionStateConnected constructor instead of object literal
src/telemetry/connectionTelemetry.ts Updated telemetry property from dbType to serverName to match API changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 12 to 16

export function getMCPConfigFromVSCodeSettings(
packageJsonConfiguredProperties: Record<string, unknown> = contributes
?.configuration?.properties ?? {},
retrieveMCPConfiguration: () => vscode.WorkspaceConfiguration = (): vscode.WorkspaceConfiguration =>
vscode.workspace.getConfiguration('mdb.mcp'),
): Partial<UserConfig> {
const configurableProperties = new Set(Object.keys(UserConfigSchema.shape));
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The configurableProperties Set is recreated on every call to getMCPConfigFromVSCodeSettings(). Consider moving this to module scope (alongside defaultUserConfig on line 8) to avoid repeated object creation.

Suggested change
export function getMCPConfigFromVSCodeSettings(
packageJsonConfiguredProperties: Record<string, unknown> = contributes
?.configuration?.properties ?? {},
retrieveMCPConfiguration: () => vscode.WorkspaceConfiguration = (): vscode.WorkspaceConfiguration =>
vscode.workspace.getConfiguration('mdb.mcp'),
): Partial<UserConfig> {
const configurableProperties = new Set(Object.keys(UserConfigSchema.shape));
const configurableProperties = new Set(Object.keys(UserConfigSchema.shape));
export function getMCPConfigFromVSCodeSettings(
packageJsonConfiguredProperties: Record<string, unknown> = contributes
?.configuration?.properties ?? {},
retrieveMCPConfiguration: () => vscode.WorkspaceConfiguration = (): vscode.WorkspaceConfiguration =>
vscode.workspace.getConfiguration('mdb.mcp'),
): Partial<UserConfig> {
// configurableProperties is now defined at module scope

Copilot uses AI. Check for mistakes.
@nirinchev nirinchev closed this Dec 3, 2025
@nirinchev nirinchev deleted the ni/mcp-update branch December 3, 2025 23:24
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.

2 participants