Conversation
There was a problem hiding this comment.
Hello @mclenhard, 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!
Summary of Changes
This pull request introduces end-to-end (e2e) tests and evaluations using the mcp-evals package. The goal is to load an MCP client, run the server, process tool calls, and then grade the responses for correctness. The changes include adding the mcp-evals dependency to package.json, creating a new evals.ts file with evaluation functions for various tools (query, aggregate, update, serverInfo, insert, createIndex, count, listCollections), and updating the README.md file with instructions on how to run the evals.
Highlights
- E2E Testing: Adds new e2e tests to verify the functionality of the MCP client and server.
- MCP Evals Integration: Integrates the
mcp-evalspackage to grade the responses from tool calls. - New Eval Functions: Creates evaluation functions for various tools, including query, aggregate, update, and more.
- Documentation: Updates the README with instructions on running the evals.
Changelog
- README.md
- Added a new section on running evals with instructions and an example command using
npx mcp-eval.
- Added a new section on running evals with instructions and an example command using
- package.json
- Added
mcp-evalsas a dependency.
- Added
- src/evals/evals.ts
- Created a new file
evals.tscontaining evaluation functions for different tools. - Implemented evaluation functions for query, aggregate, update, serverInfo, insert, createIndex, count, and listCollections.
- Configured the evals using
EvalConfigand the OpenAI GPT-4 model. - Exported the configuration and the list of evals.
- Created a new file
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 is currently in preview and 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 to provide feedback.
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.
The tests run, the evals grade,
Ensuring code is well-made.
With each tool's call,
We check them all,
Quality's promise, unafraid.
Footnotes
-
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. ↩
There was a problem hiding this comment.
Code Review
This pull request introduces e2e tests using the mcp-evals package to evaluate the MCP client's interaction with the MongoDB server. The tests cover various MongoDB operations and grade the responses for correctness. Overall, this is a valuable addition to the project, enhancing its test coverage and reliability. However, there are a few areas that could be improved for clarity and maintainability.
Summary of Findings
- Eval Function Coverage: While several eval functions are defined, only the
queryfunction is currently used in theconfigobject. Consider expanding the coverage to include other eval functions to provide a more comprehensive test suite. - Duplicated Eval Definitions: The
queryeval is defined twice, once as a constant and again as part of theevalsarray. This redundancy should be removed to avoid confusion and potential maintenance issues. - README.md Documentation: The documentation added to the README is helpful, but could be expanded to provide more context on how the evals work and how to interpret the results.
Merge Readiness
The pull request introduces valuable e2e tests and is a step in the right direction for improving the project's reliability. However, the issues identified, particularly the limited eval function coverage and duplicated definitions, should be addressed before merging. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging.
* feat - tests + evals * [bugfix] fix readme * [feat] add other evals to export
|
@mclenhard thanks for improvement 🚀 |
Adds new e2e test that loads an MCP client, which in turn runs the server and processes the actual tool call. Afterwards, it then grades the response for correctness.
note: I'm the package author