Skip to content

refactor: Restructure SDK into subpackages & implement versioned HTTP transport layers#71

Open
stenalpjolly wants to merge 1 commit into
googleapis:mainfrom
stenalpjolly:stenalpjolly_issue-29-versioned-transports
Open

refactor: Restructure SDK into subpackages & implement versioned HTTP transport layers#71
stenalpjolly wants to merge 1 commit into
googleapis:mainfrom
stenalpjolly:stenalpjolly_issue-29-versioned-transports

Conversation

@stenalpjolly

Copy link
Copy Markdown
Contributor

Summary

Restructures the Java SDK package layout into domain-specific subpackages (client, transport, auth, tool, exception) instead of a single flat root package, and refactors the HTTP transport layer to delegate version-specific initialization and requests to dedicated subclass routers.

Expectation & Implementation

  • Restructured Package Layout:
    • com.google.cloud.mcp (entrypoint classes)
    • com.google.cloud.mcp.client (client implementation classes)
    • com.google.cloud.mcp.transport (transport interfaces and HttpMcpTransport router)
    • com.google.cloud.mcp.transport.vXXXX (version-specific transport subclasses: v20241105, v20250326, v20250618, v20251125)
    • com.google.cloud.mcp.auth (credential handling and resolver classes)
    • com.google.cloud.mcp.tool (tool definition and runner classes)
    • com.google.cloud.mcp.exception (McpException)
  • Versioned Transports:
    • Refactored HttpMcpTransport to instantiate and delegate all calls to a version-specific subclass implementation depending on the selected ProtocolVersion.
    • Moved shared fields/methods into BaseMcpTransport to reduce duplication.
  • Example & Demo Applications:
    • Updated all imports and configurations inside example/ and demo-applications/cymbal-transit/ to resolve the new SDK packages successfully.

Test cases

  • Run all unit tests locally excluding E2E:
    mvn test -Dtest="*Test,!*E2ETest" -Dnet.bytebuddy.experimental=true

Acceptance criteria

  • All 129 unit tests pass successfully.
  • Code conforms to google-java-format checkstyle standards.
  • Examples and Cymbal Transit demo app compile successfully.

Breaking changes

  • Yes, this is a breaking change because classes like McpToolboxClientBuilder, ToolDefinition, CredentialsProvider were moved from com.google.cloud.mcp package to domain subpackages. Callers must update their import declarations.

@stenalpjolly stenalpjolly requested a review from a team as a code owner June 25, 2026 11:22
@stenalpjolly stenalpjolly changed the title refactor: Restructure SDK into subpackages and implement versioned HTTP transport layers refactor: Restructure SDK into subpackages & implement versioned HTTP transport layers Jun 25, 2026
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