Skip to content

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

Closed
stenalpjolly wants to merge 1 commit into
googleapis:mainfrom
stenalpjolly:stenalpjolly_versioned-transports-refactor
Closed

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

Conversation

@stenalpjolly

Copy link
Copy Markdown
Contributor

Summary

This PR restructures the Java SDK package layout into domain-specific subpackages and refactors the HTTP transport layer to delegate version-specific initialization and requests to dedicated subclass routers.

Expectation & Implementation

  • Package Restructuring: Restructures the flat package structure under com.google.cloud.mcp into subpackages: client, transport, auth, tool, and exception.
  • Versioned Transport Architecture: Refactors HttpMcpTransport to check the preferred protocol version during construction and instantiate the corresponding versioned subclass router:
    • HttpMcpTransportV20241105
    • HttpMcpTransportV20250326
    • HttpMcpTransportV20250618
    • HttpMcpTransportV20251125
  • Subclass transports inherit from BaseMcpTransport which houses shared connection handshake initialization.

Test cases

  • Modified HttpMcpTransportTest to cover the routing behavior and version negotiation.
  • Verified test coverage for all versioned transport subclasses.
  • Added McpCoverageTest to ensure 100% test coverage.

Acceptance criteria

  • All compilation, unit tests, and coverage checks pass.
  • Formatting conforms to google-java-format.

Breaking changes

  • Yes. Classes have been moved into subpackages. Existing consumers calling classes like HttpMcpTransport or McpToolboxClient directly will need to update their import statements to reflect the new package layout:
    • Import changes:
      • com.google.cloud.mcp.HttpMcpTransport -> com.google.cloud.mcp.transport.HttpMcpTransport
      • com.google.cloud.mcp.McpToolboxClient -> com.google.cloud.mcp.client.McpToolboxClient

… transport layers

Restructures the Java SDK package layout into domain-specific subpackages:
- client
- transport
- auth
- tool
- exception

Refactors HTTP transport to delegate version-specific initialization and requests to dedicated subclass routers:
- HttpMcpTransportV20241105
- HttpMcpTransportV20250326
- HttpMcpTransportV20250618
- HttpMcpTransportV20251125

This establishes the directory layout and class structure for managing versioned transports.

TAG=agy
CONV=2e1a2106-f882-4b08-92df-a27ba37c6fae
@stenalpjolly stenalpjolly requested a review from a team as a code owner June 26, 2026 17:45
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