Skip to content

feat: Add actual MCP Toolbox server verification test and examples#69

Draft
stenalpjolly wants to merge 7 commits into
googleapis:mainfrom
stenalpjolly:stenalpjolly_issue-19-examples
Draft

feat: Add actual MCP Toolbox server verification test and examples#69
stenalpjolly wants to merge 7 commits into
googleapis:mainfrom
stenalpjolly:stenalpjolly_issue-19-examples

Conversation

@stenalpjolly

@stenalpjolly stenalpjolly commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds local integration verification testing using the actual MCP Toolbox server binary and a local SQLite database. It introduces multiple standalone examples configured from system properties (avoiding mock fallbacks in runtime code) and validates their compilation and execution dynamically in tests. Additionally, the examples have been restructured into independent folders for easier copy-pasting by users.

Expectation & Implementation

  • Restructured example/src/main/java/cloudcode/ into independent standalone folders (simple, bulk, validation) so that users can easily copy and paste targeted, minimal example code.
  • Simplified ExampleUsage.java from a beginner's perspective, removing unnecessary printouts and deep indentations to make the code highly concise and readable.
  • Added ParameterBindingUsage.java and BulkToolsetUsage.java to demonstrate advanced workflows like stateful parameter binding and the Bulk Toolset Loading API.
  • Added ToolboxActualServerVerifyTest.java under the test suite. It initializes a local SQLite DB (verification.db), configures verify_tools.yaml in flat format, launches the native toolbox server, mocks the Google Credentials environment dynamically, compiles the Java examples on the fly, and runs them to verify all SDK client methods.
  • Ignored generated SQLite db and toolbox binaries from git version control in .gitignore.
  • Updated example/README.md to document the verification workflow and how to execute it locally.

Test cases

  • Run local verify:
    mvn test -Dtest="*Test,!*E2ETest" -Dnet.bytebuddy.experimental=true

Acceptance criteria

  • Standard SDK build compiles and checkstyle check reports 0 violations.
  • ToolboxActualServerVerifyTest executes successfully for both examples, showing correct retrieval of data and price checks from the real toolbox server.

Breaking changes

None.

@stenalpjolly stenalpjolly requested a review from a team as a code owner June 23, 2026 12:03
@stenalpjolly stenalpjolly marked this pull request as draft June 23, 2026 12:04
@stenalpjolly stenalpjolly force-pushed the stenalpjolly_issue-19-examples branch from b987796 to 71e6557 Compare June 23, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant