test(harness): implement MCP JSON-RPC test harness#2828
Conversation
Summary of ChangesHello, 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 introduces a dedicated test helper for the MCP JSON-RPC interface. The primary goal is to simplify the process of invoking and validating tool calls within the test suite, thereby improving testability and reducing boilerplate code for future MCP-related tests. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new test helper function, ExecuteMCPToolCall, in tests/mcp_execute.go. This function streamlines the process of making MCP tool calls within integration tests, handling request marshaling, HTTP communication, and response parsing. Feedback includes addressing the concatenation of multiple TextContent parts in the MCP response to ensure valid JSON output, and handling the error returned by json.Marshal during request body preparation.
34fdbff to
e88fd7a
Compare
eacda15 to
62d28eb
Compare
6070a58 to
9c40b34
Compare
55c33c7 to
8b9a9f8
Compare
d8817ea to
163bba2
Compare
8b9a9f8 to
77e10c4
Compare
163bba2 to
cdcac23
Compare
77e10c4 to
9816437
Compare
3633430 to
082e280
Compare
e0686e3 to
bc7fa2f
Compare
5fcb79a to
c5fc0aa
Compare
7fe2c51 to
37f4fdb
Compare
37f4fdb to
2035569
Compare
c5fc0aa to
f8592e5
Compare
35c785b to
55c54c6
Compare
55c54c6 to
4349247
Compare
5c22f0e to
0d44d89
Compare
49352dc to
009f45b
Compare
b934ec8 to
5364cf1
Compare
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
5364cf1 to
4b41e0d
Compare
|
🧨 Preview deployments removed. Cloudflare Pages environments for |
Overview
This PR introduces the native MCP test harness, enabling us to run integration tests using the JSON-RPC protocol over
/mcp.Changes
tests/mcp_execute.goandtests/mcp_types.goas the core harness for invoking MCP tools and asserting responses.tests/server.goto support dynamic flags like--enable-api.internal/server/server_test.goto verify the harness itself.Checklist