Skip to content

feat(genkit-tools/mcp): Add docs search in MCP#4452

Open
ssbushi wants to merge 6 commits intomainfrom
sb/mcpDocsImprovements
Open

feat(genkit-tools/mcp): Add docs search in MCP#4452
ssbushi wants to merge 6 commits intomainfrom
sb/mcpDocsImprovements

Conversation

@ssbushi
Copy link
Contributor

@ssbushi ssbushi commented Feb 5, 2026

Enhanced MCP docs tools, with keyword search.
Updated usage guides with Project setup/scaffolding info.

Checklist (if applicable):

@github-actions github-actions bot added docs Improvements or additions to documentation js tooling labels Feb 5, 2026
@ssbushi ssbushi changed the title Sb/mcp docs improvements feat(genkit-tools/mcp): Add docs search in MCP Feb 5, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Enhanced Documentation Tools: The single lookup_genkit_docs tool has been replaced by three specialized tools: list_genkit_docs for indexing available documentation, search_genkit_docs for keyword-based searching, and read_genkit_docs for retrieving the full content of specific files.
  • Improved Project Setup Guides: Comprehensive 'Project Setup' sections have been added to both the Go and JavaScript Genkit usage guides, detailing initialization, dependency management, CLI installation, and basic configuration steps.
  • Schema Description Clarity: Input schema descriptions across various MCP tools (flows, runtime, trace, usage, utils) have been updated to explicitly include type information (e.g., type: string) for better clarity and tool usage.

🧠 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
  • genkit-tools/cli/context/GENKIT.go.md
    • Added a 'Project Setup' section detailing go mod init, go get commands for dependencies, Genkit CLI installation, and a basic main.go configuration example.
  • genkit-tools/cli/context/GENKIT.js.md
    • Added a 'Project Setup' section covering npm init, npm install for dependencies, Genkit CLI installation, and a basic src/index.ts configuration example, with notes on existing projects and module types (ESM/CJS).
  • genkit-tools/cli/src/mcp/README.md
    • Updated the tool table to reflect the deprecation of lookup_genkit_docs and the introduction of list_genkit_docs, search_genkit_docs, and read_genkit_docs.
  • genkit-tools/cli/src/mcp/docs.ts
    • Refactored documentation access logic into three new tools: list_genkit_docs, search_genkit_docs, and read_genkit_docs.
    • Implemented keyword search with scoring and result ranking for search_genkit_docs.
    • Added detailed output formatting for listed and searched documents, including file paths, titles, descriptions, and headers.
    • Enhanced error handling for read_genkit_docs when no file paths are provided or documents are not found.
  • genkit-tools/cli/src/mcp/flows.ts
    • Modified the input schema description for the run_flow tool to include type: string.
  • genkit-tools/cli/src/mcp/prompts/init.ts
    • Updated the GENERAL_GUIDELINES constant to reference the new documentation tools for clarity.
  • genkit-tools/cli/src/mcp/runtime.ts
    • Modified the command and args schema descriptions for the run_command tool to include their respective types.
  • genkit-tools/cli/src/mcp/trace.ts
    • Modified the description for the get_trace tool and its traceId schema description to include type: string.
  • genkit-tools/cli/src/mcp/usage.ts
    • Modified the description for the get_usage_guide tool and its language schema description to include type: string.
  • genkit-tools/cli/src/mcp/utils.ts
    • Modified the projectRoot schema description for getCommonSchema to include type: string.
  • skills/developing-genkit-tooling/SKILL.md
    • Updated tool naming examples to reflect the new documentation tools.
Activity
  • No specific activity (comments, reviews) was provided in the context for this pull request.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
curl -sL cli.genkit.dev | bash
npm install -g genkit-cli

},
async ({ language }) => {
await record(new McpRunToolEvent('list_genkit_docs'));
const lang = language || 'js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
const lang = language || 'js';
const lang = language;

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ssbushi ssbushi marked this pull request as ready for review February 5, 2026 15:29
@ssbushi ssbushi requested a review from pavelgj February 5, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation js tooling

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant