Skip to content

feat: add Spring Boot auto-configuration support to core SDK#75

Open
stenalpjolly wants to merge 4 commits into
googleapis:mainfrom
stenalpjolly:stenalpjolly_issue-17-spring-initializr
Open

feat: add Spring Boot auto-configuration support to core SDK#75
stenalpjolly wants to merge 4 commits into
googleapis:mainfrom
stenalpjolly:stenalpjolly_issue-17-spring-initializr

Conversation

@stenalpjolly

@stenalpjolly stenalpjolly commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds Spring Boot auto-configuration support to the core Java SDK, enabling developers to easily bootstrap new Spring Boot applications integrated with the MCP Toolbox.

Expectation & Implementation

  • Instead of introducing a separate module or restructuring the monorepo directory tree, the auto-configuration has been embedded directly inside the mcp-toolbox-sdk-java module using <optional>true</optional> Spring dependencies.
  • Added com.google.cloud.mcp.autoconfigure.McpToolboxProperties to declare configurable properties under the prefix google.cloud.mcp.toolbox.
  • Added com.google.cloud.mcp.autoconfigure.McpToolboxAutoConfiguration to register the McpToolboxClient bean conditionally when the google.cloud.mcp.toolbox.base-url property is supplied.
  • Registered the auto-configuration class in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports.
  • Added a complete sample Spring Boot 3.x application under example-spring-boot showing how developers can configure and autowire the client bean.

Test cases

  • Created com.google.cloud.mcp.autoconfigure.McpToolboxAutoConfigurationTest validating bean loading, fallback logic, and custom bean override behavior.
  • Verified compile compatibility of the new example-spring-boot application.
  • All checks and tests passed locally under JDK 23 (compile, test, package).

Acceptance criteria

  • Auto-configuration works out-of-the-box when the library is imported into a Spring Boot 3.x project.
  • Non-Spring applications can import the library without any transitive Spring dependency pollution.

Breaking changes

None.

@stenalpjolly stenalpjolly requested a review from a team as a code owner July 7, 2026 18:47
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