-
Notifications
You must be signed in to change notification settings - Fork 164
chore: improve ability to use custom tools MCP-295 #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
There was a problem hiding this 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/toolsnamespace - Renamed
toolConstructorsparameter totoolsin 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 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
9ac244b to
2ab5eee
Compare
Pull Request Test Coverage Report for Build 19431611919Warning: 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
💛 - Coveralls |
We already had a
toolConstructorsparameter which could have already been used for this. So, instead this improves the experience bytoolConstructorsoption totools. This makes more sense in constuctor context.mongodb-mcp-server/toolsnamespace and adding documentation