Skip to content

Conversation

himanshusinghs
Copy link
Collaborator

Proposed changes

Addresses both MCP-233 and MCP-237.
Apparently we always had a way to not register given certain conditions (ToolBase.verifyAllowed), I just added a test to verify the behaviour.

Checklist

@himanshusinghs himanshusinghs requested a review from a team as a code owner October 7, 2025 15:28
@Copilot Copilot AI review requested due to automatic review settings October 7, 2025 15:28
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 enhances the MongoDB MCP Server by adding support for the Voyage AI API key configuration and ensuring tools that depend on external services are properly validated before registration. The changes address two tickets: allowing Voyage AI API key configuration and preventing unusable tools from being registered.

  • Adds voyageApiKey configuration parameter with environment variable support
  • Implements tool validation mechanism to prevent registration of tools without required dependencies
  • Adds comprehensive tests to verify tools are properly filtered based on their availability

Reviewed Changes

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

File Description
src/common/config.ts Adds voyageApiKey configuration option with default empty value
src/server.ts Adds optional toolConstructors parameter to enable dependency injection for testing
tests/integration/tools/mongodb/mongodbTool.test.ts Adds test coverage for tool validation and refactors existing tests to use dependency injection
README.md Documents the new voyageApiKey configuration parameter

telemetry: Telemetry;
elicitation: Elicitation;
connectionErrorHandler: ConnectionErrorHandler;
toolConstructors?: (new (params: ToolConstructorParams) => ToolBase)[];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is only to make it easy to test tool registration behaviour.

@coveralls
Copy link
Collaborator

coveralls commented Oct 7, 2025

Pull Request Test Coverage Report for Build 18317866080

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 82.526%

Totals Coverage Status
Change from base Build 18314620938: 0.02%
Covered Lines: 5307
Relevant Lines: 6319

💛 - Coveralls

@himanshusinghs himanshusinghs merged commit 543301c into main Oct 8, 2025
18 checks passed
@himanshusinghs himanshusinghs deleted the chore/MCP-223-voyage-api-key branch October 8, 2025 10: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.

3 participants