feat(genkit-tools/mcp): Add docs search in MCP#4452
Conversation
Summary of ChangesHello @ssbushi, 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 improves the developer experience for Genkit users by providing more robust and intuitive documentation access within the MCP CLI. The introduction of dedicated tools for listing, searching, and reading documentation files streamlines information retrieval. Concurrently, the updated usage guides offer clearer, step-by-step instructions for setting up new Genkit projects in both Go and JavaScript, reducing friction for new users and ensuring consistent project initialization. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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.
Code Review
This pull request significantly enhances the documentation tools for the Genkit MCP server by replacing the generic lookup_genkit_docs tool with more specific list_genkit_docs, search_genkit_docs, and read_genkit_docs tools. The addition of a keyword-based search is a great improvement for usability. The usage guides for Go and Node.js have also been updated with valuable project setup and scaffolding information.
The implementation is solid, but I've identified a few minor areas for improvement in genkit-tools/cli/src/mcp/docs.ts related to code redundancy, and an inconsistency in the installation instructions in genkit-tools/cli/context/GENKIT.js.md. These suggestions aim to improve code clarity and consistency. Overall, this is a valuable contribution.
| If the Genkit CLI is not already installed: | ||
|
|
||
| ```bash | ||
| curl -sL cli.genkit.dev | bash |
There was a problem hiding this comment.
For Node.js projects, it's more idiomatic to install the Genkit CLI via npm. This is also consistent with the instructions in genkit-tools/cli/src/mcp/prompts/init.ts for Node.js setup. Using a package manager for CLI tools is generally preferred over curl | bash for better version management and security.
| curl -sL cli.genkit.dev | bash | |
| npm install -g genkit-cli |
| }, | ||
| async ({ language }) => { | ||
| await record(new McpRunToolEvent('list_genkit_docs')); | ||
| const lang = language || 'js'; |
There was a problem hiding this comment.
The language parameter has a .default('js') in its Zod schema. This means Zod ensures language will always be a string and never falsy within the tool's execution context. Therefore, this fallback to 'js' is redundant and can be removed.
| const lang = language || 'js'; | |
| const lang = language; |
| await record(new McpRunToolEvent('lookup_genkit_docs')); | ||
| async ({ query, language }) => { | ||
| await record(new McpRunToolEvent('search_genkit_docs')); | ||
| const lang = language || 'js'; |
There was a problem hiding this comment.
The language parameter has a .default('js') in its Zod schema. This means Zod ensures language will always be a string and never falsy within the tool's execution context. Therefore, this fallback to 'js' is redundant and can be removed.
| const lang = language || 'js'; | |
| const lang = language; |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Enhanced MCP docs tools, with keyword search.
Updated usage guides with Project setup/scaffolding info.
Checklist (if applicable):