-
Notifications
You must be signed in to change notification settings - Fork 128
feat(search): Add a new tool to list search and vector search indexes MCP-235 #610
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
📊 Accuracy Test Results📈 Summary
📊 Baseline Comparison
📎 Download Full HTML Report - Look for the Report generated on: 10/6/2025, 1:52:38 PM |
Pull Request Test Coverage Report for Build 18338555347Warning: 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 |
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 adds a new MongoDB MCP tool called "list-search-indexes" that allows users to list search and vector search indexes for a specific collection. The tool detects Atlas Search support by catching exceptions and provides appropriate error messages for unsupported clusters.
Key changes:
- New search indexes listing tool with comprehensive test coverage
- Enhanced test infrastructure to support Atlas Local containers via Docker
- Refactored shared utilities and improved test organization
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
src/tools/mongodb/search/listSearchIndexes.ts |
Core implementation of the new list-search-indexes tool |
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts |
Integration tests for the new tool with Atlas Local support |
tests/integration/tools/mongodb/mongodbHelpers.ts |
Enhanced test helpers to support Docker containers and search clusters |
tests/accuracy/listSearchIndexes.test.ts |
Accuracy tests for the new tool |
src/tools/mongodb/tools.ts |
Registers the new tool in the MongoDB tools array |
tests/integration/transports/stdio.test.ts |
Updates tool count expectation |
tests/integration/helpers.ts |
Adds shared sleep utility function |
tests/integration/tools/atlas/clusters.test.ts |
Uses shared sleep utility |
package.json |
Adds testcontainers dependencies |
.github/workflows/code-health.yml |
Adds Docker setup for CI |
.github/workflows/code-health-fork.yml |
Adds Docker setup for fork CI |
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts
Outdated
Show resolved
Hide resolved
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts
Outdated
Show resolved
Hide resolved
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts
Outdated
Show resolved
Hide resolved
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts
Outdated
Show resolved
Hide resolved
It detects if the cluster supports search indexes the same way we do in all other tooling: by catching the exception. In some old clusters it might still return an empty list for unsupported custers, but we can't really know for sure. As we depend on mongot, we need to use the Atlas local image, which is not supported by mongodb-runner. Instead, we use testcontainers, that allows to run any docker image, which is enough for our use case. For now only run docker tests in Ubuntu * macos-latest does not support nested virtualisation yet * we don't have windows containers for atlas images
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts
Outdated
Show resolved
Hide resolved
Now, there is a new class, MongoDBClusterProcess, that knows how to start and stop a cluster based on the provided configuration. This decouples the test setup and simplifies any future approaches to consolidate running strategies into one.
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.
Looks good 🚀
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
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts:1
- This tool should be enabled for production use, not just tests. The
verifyAllowed
method should returntrue
or be removed entirely to follow the architectural guidelines.
import { describeWithMongoDB, getSingleDocFromUntrustedContent } from "../mongodbHelpers.js";
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Proposed changes
It detects if the cluster supports search indexes the same way we do in all other tooling: by catching the exception. In some old clusters it might still return an empty list for unsupported clusters, but we can't really know for sure.
Checklist