Skip to content

Conversation

himanshusinghs
Copy link
Collaborator

@himanshusinghs himanshusinghs commented Sep 16, 2025

Proposed changes

VSCode project works(not directly) with yargs-parser@21 and our project pulls in version 22. The dependency resolution in VSCode resolves yargs-parser to version 21 and thus the usage of this dependency in the imported mcp-server-code breaks.

Ideally, we wouldn't have to do this because the imported code in VSCode, theoretically, in no way relies on yargs-parser. But because of our code setup, the yargs-parser does come in the imported path eventually:

  1. exporting types and vaues from config.js in lib entry point which imports yargs-parser. Ideally we should re-organise this to different files, one with schema and one with config helpers.
  2. imports from config.js in our trasport/base.js which sets up default connectionManager imported from connectionManager.js which further imports config.js which imports yargs-parser.
  3. imports from config.js in our config resource which imports defaultDriverOptions.

To fix this long term there are two options:

  1. Re-organise files and imports such that un-necessary code does not end up in lib entry point. This will compromise a bit on DX but is more preferable, we do the same in Compass, btw. Additionally we will have to setup VSCode integration tests.
  2. Use bundler to bundle the lib entry point with all the dependencies it might accidentally end up importing. Less preferred because the lib entry point might just grow without us noticing but this will work flawlessly.

Checklist

@himanshusinghs himanshusinghs requested a review from a team as a code owner September 16, 2025 09:22
@Copilot Copilot AI review requested due to automatic review settings September 16, 2025 09:22
Copy link
Contributor

@Copilot 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 pins the yargs-parser dependency to version 21.1.1 to maintain compatibility with VSCode, downgrading from the previously specified version 22.0.0.

  • Downgrades yargs-parser from ^22.0.0 to ^21.1.1 for VSCode compatibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@himanshusinghs himanshusinghs changed the title fix: pin yargs-parser to 21 for VSCode comaptibility fix: pin yargs-parser to 21 for VSCode compatibility Sep 16, 2025
@himanshusinghs himanshusinghs added the no-title-validation Add this label to disable the title check for this PR. label Sep 16, 2025
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 17761125119

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 82.068%

Totals Coverage Status
Change from base Build 17759877157: 0.005%
Covered Lines: 5021
Relevant Lines: 6007

💛 - Coveralls

Copy link
Collaborator

@cveticm cveticm left a comment

Choose a reason for hiding this comment

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

LGTM, could you open a ticket for tracking the investigation work for long-term solutions too?

@himanshusinghs
Copy link
Collaborator Author

Done - here we have it https://jira.mongodb.org/browse/MCP-214

@himanshusinghs himanshusinghs merged commit 6ee7b70 into main Sep 16, 2025
23 checks passed
@himanshusinghs himanshusinghs deleted the fix/vscode-build-fixes branch September 16, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-title-validation Add this label to disable the title check for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants