-
-
Notifications
You must be signed in to change notification settings - Fork 262
Feat/mcp Add optional semantic_search tool + non-destructive update_repository for MCP server #203
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
base: main
Are you sure you want to change the base?
Feat/mcp Add optional semantic_search tool + non-destructive update_repository for MCP server #203
Conversation
Summary of ChangesHello @luxannaxul, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the MCP server's capabilities by integrating an optional semantic search tool for more intuitive code exploration and introducing a non-destructive repository update mechanism. These changes provide greater flexibility in managing and querying the codebase's knowledge graph, allowing for both semantic-based queries and efficient incremental updates without requiring a full re-indexing of the repository. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces two valuable improvements to the MCP server tools. The optional registration of the semantic_search tool based on dependency availability is a clean solution, and the new non-destructive update_repository tool is a great feature for incremental updates. The code is well-structured, and the added warnings for destructive operations are a thoughtful touch. I've left a couple of minor comments regarding a typo and a docstring inconsistency. Overall, this is a solid contribution.
typo Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
overlooked consistency of naming Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Hey, thanks for the contribution! The feature itself is really useful - having a non-destructive A few things to address before we can merge: 1. Coding Standards - String Centralization The project follows a strict "no hardcoded strings" policy. Tool names, descriptions, and log messages need to live in their respective modules:
This ensures the new tools will also show up in the auto-generated README (we have a dynamic generator that pulls from these sources). 2. Input Schema Structure The existing tools use 3. No Docstrings Per our coding standards, we don't use docstrings - code should be self-documenting. Please remove all the docstrings from the new methods ( 4. Tool Descriptions Tone The warning about Could we tone this down to something like: 5. Minor Grammar A few spots have "except you" which should be "unless you" (e.g., "except you know exact names" → "unless you know exact names"). Would you mind making these adjustments? Happy to help if you have questions about where things should go. The feature is solid, just needs to align with how the rest of the codebase is structured. |
vitali87
left a comment
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.
See my comment above for details on what needs to be addressed.
Hi maintainers,
This PR improves the MCP server tool set in codebase_rag/mcp/tools.py in two areas:
Optional semantic_search tool registration
Adds a semantic search MCP tool that is only registered when semantic dependencies are installed (checked via has_semantic_dependencies()). This avoids exposing semantic_search in environments where it would otherwise return empty results. When unavailable, the server logs a clear message pointing to uv sync --extra semantic.
Non-destructive repository updates
Introduces a new MCP tool, update_repository, which runs GraphUpdater without clearing the database first. This complements the existing index_repository tool (which still performs a full wipe + reindex) and makes incremental updates available via MCP as well.
Thanks for reviewing!