Skip to content

Conversation

@gagik
Copy link
Collaborator

@gagik gagik commented Nov 17, 2025

We already had a toolConstructors parameter which could have already been used for this. So, instead this improves the experience by

  1. Renaming toolConstructors option to tools. This makes more sense in constuctor context.
  2. Exporting tool-related classes through a mongodb-mcp-server/tools namespace and adding documentation

We already had a toolConstructors parameter which can be used for this. So, instead this improves the experience by exporting tool-related classes through a `mongodb-mcp-server/tools` namespace and adding documentation
@gagik gagik requested a review from a team as a code owner November 17, 2025 13:17
Copilot AI review requested due to automatic review settings November 17, 2025 13:17
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 improves the developer experience for using custom tools in the MongoDB MCP server by exposing tool-related classes through a new mongodb-mcp-server/tools export namespace. The change adds documentation and renames the parameter from toolConstructors to tools for better clarity.

Key Changes:

  • Exported tool classes and types through a new mongodb-mcp-server/tools namespace
  • Renamed toolConstructors parameter to tools in ServerOptions for better clarity
  • Added comprehensive integration tests demonstrating custom tool usage

Reviewed Changes

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

Show a summary per file
File Description
tests/integration/customTools.test.ts New integration test demonstrating custom tool registration and execution
tests/integration/build.test.ts Added verification that CommonJS and ESM exports match for the new tools module
src/transports/base.ts Updated to accept tools parameter and pass it through to server
src/tools/index.ts New entry point exporting all tool classes, types, and collections
src/server.ts Renamed toolConstructors to tools with improved documentation
src/lib.ts Added exports for StdioRunner, TransportRunnerBase, and Elicitation
package.json Added ./tools export path supporting both CommonJS and ESM

gagik and others added 4 commits November 17, 2025 14:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gagik gagik force-pushed the gagik/library-constructor-hook branch from 9ac244b to 2ab5eee Compare November 17, 2025 13:31
@gagik gagik enabled auto-merge (squash) November 17, 2025 13:53
@gagik gagik merged commit b8f8ee8 into main Nov 17, 2025
26 of 27 checks passed
@gagik gagik deleted the gagik/library-constructor-hook branch November 17, 2025 14:02
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 19431611919

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 11 of 14 (78.57%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.4%) to 80.556%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/lib.ts 0 3 0.0%
Files with Coverage Reduction New Missed Lines %
src/lib.ts 1 0.0%
Totals Coverage Status
Change from base Build 19375045765: 0.4%
Covered Lines: 6548
Relevant Lines: 8012

💛 - Coveralls

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