Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/toolbox-adk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ The SDK supports multiple transport protocols to communicate with the Toolbox se

### Available Protocols

- `Protocol.MCP`: The default protocol (currently aliases to `MCP_v20251125`).
- `Protocol.MCP`: The default protocol version (currently aliases to `MCP_v20250618`).
- `Protocol.MCP_v20241105`: Use this for compatibility with older MCP servers (November 2024 version).
- `Protocol.MCP_v20250326`: March 2025 version.
- `Protocol.MCP_v20250618`: June 2025 version.
Expand Down
2 changes: 1 addition & 1 deletion packages/toolbox-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ The SDK supports multiple transport protocols to communicate with the Toolbox se

### Available Protocols

- `Protocol.MCP`: The default protocol (currently aliases to `MCP_v20251125`).
- `Protocol.MCP`: The default protocol version (currently aliases to `MCP_v20250618`).
- `Protocol.MCP_v20241105`: Use this for compatibility with older MCP servers (November 2024 version).
- `Protocol.MCP_v20250326`: March 2025 version.
- `Protocol.MCP_v20250618`: June 2025 version.
Expand Down
61 changes: 36 additions & 25 deletions packages/toolbox-core/src/toolbox_core/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,43 @@ class ToolboxClient {
if (protocol === Protocol.TOOLBOX) {
this.#transport = new ToolboxTransport(url, session || undefined);
} else if (getSupportedMcpVersions().includes(protocol)) {
if (protocol === Protocol.MCP_v20241105) {
this.#transport = new McpHttpTransportV20241105(
url,
session || undefined,
protocol,
if (protocol !== Protocol.MCP_v20251125) {
console.warn(
'A newer version of MCP: v2025-11-25 is available. Please use MCP_v20251125 to use the latest features.',
);
} else if (protocol === Protocol.MCP_v20250326) {
this.#transport = new McpHttpTransportV20250326(
url,
session || undefined,
protocol,
);
} else if (protocol === Protocol.MCP_v20250618) {
this.#transport = new McpHttpTransportV20250618(
url,
session || undefined,
protocol,
);
} else if (protocol === Protocol.MCP_v20251125) {
this.#transport = new McpHttpTransportV20251125(
url,
session || undefined,
protocol,
);
} else {
throw new Error(`Unsupported MCP protocol version: ${protocol}`);
}

switch (protocol) {
case Protocol.MCP_v20241105:
this.#transport = new McpHttpTransportV20241105(
url,
session || undefined,
protocol,
);
break;
case Protocol.MCP_v20250326:
this.#transport = new McpHttpTransportV20250326(
url,
session || undefined,
protocol,
);
break;
case Protocol.MCP_v20250618:
this.#transport = new McpHttpTransportV20250618(
url,
session || undefined,
protocol,
);
break;
case Protocol.MCP_v20251125:
this.#transport = new McpHttpTransportV20251125(
url,
session || undefined,
protocol,
);
break;
default:
throw new Error(`Unsupported MCP protocol version: ${protocol}`);
}
} else {
throw new Error(`Unsupported protocol version: ${protocol}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/toolbox-core/src/toolbox_core/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export enum Protocol {
MCP_v20250326 = '2025-03-26',
MCP_v20250618 = '2025-06-18',
MCP_v20251125 = '2025-11-25',
MCP = MCP_v20251125, // Default MCP
MCP = MCP_v20250618, // Default MCP
}

export function getSupportedMcpVersions(): Protocol[] {
Expand Down
12 changes: 6 additions & 6 deletions packages/toolbox-core/test/test.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ describe('ToolboxClient', () => {
describe('Initialization', () => {
it('should initialize with the correct base URL (default MCP)', () => {
client = new ToolboxClient(testBaseUrl);
expect(McpHttpTransportV20251125).toHaveBeenCalledWith(
expect(McpHttpTransportV20250618).toHaveBeenCalledWith(
testBaseUrl,
undefined,
Protocol.MCP_v20251125,
Protocol.MCP_v20250618,
);
});

Expand All @@ -122,10 +122,10 @@ describe('ToolboxClient', () => {
get: jest.fn(),
} as unknown as import('axios').AxiosInstance;
client = new ToolboxClient(testBaseUrl, mockSession);
expect(McpHttpTransportV20251125).toHaveBeenCalledWith(
expect(McpHttpTransportV20250618).toHaveBeenCalledWith(
testBaseUrl,
mockSession,
Protocol.MCP_v20251125,
Protocol.MCP_v20250618,
);
});

Expand All @@ -136,10 +136,10 @@ describe('ToolboxClient', () => {
undefined,
Protocol.MCP,
);
expect(McpHttpTransportV20251125).toHaveBeenCalledWith(
expect(McpHttpTransportV20250618).toHaveBeenCalledWith(
testBaseUrl,
undefined,
Protocol.MCP_v20251125,
Protocol.MCP_v20250618,
);
});

Expand Down