Skip to content

Commit 5963112

Browse files
authored
feat!: Remove legacy Toolbox protocol support (#255)
* feat!: Remove legacy Toolbox protocol support * update docs * lint * remove unit tests * fix(toolbox-adk): ignore package/ directory in eslint * revert not needed changes * clean file * remove toolbox protocol e2e tests * rename mcp e2e test file * fix e2e tests * lint fix * fix tests * Update README.md * Update README.md * update latest mcp version warning * do not allow users to use MCP_LATEST * lint * fix test * lint * change name from MCP_LATEST_VERSION to MCP_LATEST
1 parent 7a62437 commit 5963112

File tree

11 files changed

+587
-1510
lines changed

11 files changed

+587
-1510
lines changed

packages/toolbox-adk/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,12 @@ The SDK supports multiple transport protocols to communicate with the Toolbox se
133133

134134
### Available Protocols
135135

136-
> [!WARNING]
137-
> The native Toolbox protocol (`Protocol.TOOLBOX`) is deprecated and will be removed on March 4, 2026. Please use `Protocol.MCP` or specific MCP versions.
138-
136+
We currently support different versions of the MCP protocol.
139137
- `Protocol.MCP`: The default protocol version (currently aliases to `MCP_v20250618`).
140138
- `Protocol.MCP_v20241105`: Use this for compatibility with older MCP servers (November 2024 version).
141139
- `Protocol.MCP_v20250326`: March 2025 version.
142140
- `Protocol.MCP_v20250618`: June 2025 version.
143141
- `Protocol.MCP_v20251125`: November 2025 version.
144-
- `Protocol.TOOLBOX`: **Deprecated** Legacy Toolbox protocol.
145142

146143
### Specifying a Protocol
147144

packages/toolbox-adk/test/e2e/test.e2e.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('ToolboxClient E2E Tests', () => {
3737
testBaseUrl,
3838
undefined,
3939
undefined,
40-
Protocol.TOOLBOX,
40+
Protocol.MCP,
4141
);
4242
});
4343

@@ -152,9 +152,12 @@ describe('ToolboxClient E2E Tests', () => {
152152
it('should throw an error when trying to load a non-existent toolset', async () => {
153153
await expect(
154154
commonToolboxClient.loadToolset('non-existent-toolset'),
155-
).rejects.toThrow('Request failed with status code 404');
155+
).rejects.toThrow(
156+
'MCP request failed with code -32600: toolset does not exist',
157+
);
156158
});
157159
});
160+
158161
describe('bindParams', () => {
159162
it('should successfully bind a parameter with bindParam and invoke', async () => {
160163
const newTool = getNRowsTool.bindParam('num_rows', '3');
@@ -286,13 +289,13 @@ describe('ToolboxClient E2E Tests', () => {
286289
toolContext: mockToolContext,
287290
});
288291
} catch (error) {
289-
expect((error as AxiosError).isAxiosError).toBe(true);
292+
expect(error).toBeInstanceOf(AxiosError);
290293
const axiosError = error as AxiosError;
291-
expect(axiosError.response?.status).toBe(401);
292294
expect(axiosError.response?.data).toEqual(
293295
expect.objectContaining({
294-
error:
295-
'tool invocation not authorized. Please make sure you specify correct auth headers',
296+
error: expect.objectContaining({
297+
message: expect.stringContaining('unauthorized Tool call'),
298+
}),
296299
}),
297300
);
298301
}
@@ -359,12 +362,15 @@ describe('ToolboxClient E2E Tests', () => {
359362
try {
360363
await tool.runAsync({args: {}, toolContext: mockToolContext});
361364
} catch (error) {
362-
expect((error as AxiosError).isAxiosError).toBe(true);
365+
expect(error).toBeInstanceOf(AxiosError);
363366
const axiosError = error as AxiosError;
364367
expect(axiosError.response?.data).toEqual(
365368
expect.objectContaining({
366-
error:
367-
'error parsing authenticated parameter "data": no field named row_data in claims',
369+
error: expect.objectContaining({
370+
message: expect.stringContaining(
371+
'provided parameters were invalid',
372+
),
373+
}),
368374
}),
369375
);
370376
}

packages/toolbox-core/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,12 @@ The SDK supports multiple transport protocols to communicate with the Toolbox se
131131

132132
### Available Protocols
133133

134-
> [!WARNING]
135-
> The native Toolbox protocol (`Protocol.TOOLBOX`) is deprecated and will be removed on March 4, 2026. Please use `Protocol.MCP` or specific MCP versions.
136-
134+
We currently support different versions of the MCP protocol.
137135
- `Protocol.MCP`: The default protocol version (currently aliases to `MCP_v20250618`).
138136
- `Protocol.MCP_v20241105`: Use this for compatibility with older MCP servers (November 2024 version).
139137
- `Protocol.MCP_v20250326`: March 2025 version.
140138
- `Protocol.MCP_v20250618`: June 2025 version.
141139
- `Protocol.MCP_v20251125`: November 2025 version.
142-
- `Protocol.TOOLBOX`: **Deprecated** Legacy Toolbox protocol.
143140

144141
### Specifying a Protocol
145142

packages/toolbox-core/src/toolbox_core/client.ts

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
import {ToolboxTool} from './tool.js';
1616
import {AxiosInstance} from 'axios';
1717
import {ITransport} from './transport.types.js';
18-
import {ToolboxTransport} from './toolboxTransport.js';
1918
import {
2019
createZodSchemaFromParams,
2120
ParameterSchema,
2221
ZodManifestSchema,
2322
Protocol,
2423
getSupportedMcpVersions,
24+
MCP_LATEST,
2525
} from './protocol.js';
2626
import {McpHttpTransportV20241105} from './mcp/v20241105/mcp.js';
2727
import {McpHttpTransportV20250618} from './mcp/v20250618/mcp.js';
@@ -70,60 +70,55 @@ class ToolboxClient {
7070
) {
7171
this.#clientHeaders = clientHeaders || {};
7272
warnIfHttpAndHeaders(url, this.#clientHeaders);
73-
if (protocol === Protocol.TOOLBOX) {
73+
if (!getSupportedMcpVersions().includes(protocol)) {
74+
throw new Error(`Unsupported protocol version: ${protocol}`);
75+
}
76+
77+
if (protocol !== MCP_LATEST) {
7478
console.warn(
75-
'The native Toolbox protocol is deprecated and will be removed on March 4, 2026. Please use Protocol.MCP or specific MCP versions.',
79+
`A newer version of MCP: ${MCP_LATEST} is available. Please use the latest version ${MCP_LATEST} to use the latest features.`,
7680
);
77-
this.#transport = new ToolboxTransport(url, session || undefined);
78-
} else if (getSupportedMcpVersions().includes(protocol)) {
79-
if (protocol !== Protocol.MCP_v20251125) {
80-
console.warn(
81-
'A newer version of MCP: v2025-11-25 is available. Please use MCP_v20251125 to use the latest features.',
82-
);
83-
}
81+
}
8482

85-
switch (protocol) {
86-
case Protocol.MCP_v20241105:
87-
this.#transport = new McpHttpTransportV20241105(
88-
url,
89-
session || undefined,
90-
protocol,
91-
clientName,
92-
clientVersion,
93-
);
94-
break;
95-
case Protocol.MCP_v20250326:
96-
this.#transport = new McpHttpTransportV20250326(
97-
url,
98-
session || undefined,
99-
protocol,
100-
clientName,
101-
clientVersion,
102-
);
103-
break;
104-
case Protocol.MCP_v20250618:
105-
this.#transport = new McpHttpTransportV20250618(
106-
url,
107-
session || undefined,
108-
protocol,
109-
clientName,
110-
clientVersion,
111-
);
112-
break;
113-
case Protocol.MCP_v20251125:
114-
this.#transport = new McpHttpTransportV20251125(
115-
url,
116-
session || undefined,
117-
protocol,
118-
clientName,
119-
clientVersion,
120-
);
121-
break;
122-
default:
123-
throw new Error(`Unsupported MCP protocol version: ${protocol}`);
124-
}
125-
} else {
126-
throw new Error(`Unsupported protocol version: ${protocol}`);
83+
switch (protocol) {
84+
case Protocol.MCP_v20241105:
85+
this.#transport = new McpHttpTransportV20241105(
86+
url,
87+
session || undefined,
88+
protocol,
89+
clientName,
90+
clientVersion,
91+
);
92+
break;
93+
case Protocol.MCP_v20250326:
94+
this.#transport = new McpHttpTransportV20250326(
95+
url,
96+
session || undefined,
97+
protocol,
98+
clientName,
99+
clientVersion,
100+
);
101+
break;
102+
case Protocol.MCP_v20250618:
103+
this.#transport = new McpHttpTransportV20250618(
104+
url,
105+
session || undefined,
106+
protocol,
107+
clientName,
108+
clientVersion,
109+
);
110+
break;
111+
case Protocol.MCP_v20251125:
112+
this.#transport = new McpHttpTransportV20251125(
113+
url,
114+
session || undefined,
115+
protocol,
116+
clientName,
117+
clientVersion,
118+
);
119+
break;
120+
default:
121+
throw new Error(`Unsupported MCP protocol version: ${protocol}`);
127122
}
128123
}
129124

packages/toolbox-core/src/toolbox_core/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
export {ToolboxClient} from './client.js';
1818

19-
// Export transport classes
20-
export {ToolboxTransport} from './toolboxTransport.js';
21-
2219
// Export the main factory function and the core tool type
2320
export {ToolboxTool} from './tool.js';
2421

packages/toolbox-core/src/toolbox_core/protocol.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,15 @@
1515
import {z, ZodRawShape, ZodTypeAny, ZodObject} from 'zod';
1616

1717
export enum Protocol {
18-
/**
19-
* @deprecated The native Toolbox protocol is deprecated and will be removed on March 4, 2026.
20-
* Please use Protocol.MCP or specific MCP versions.
21-
*/
22-
TOOLBOX = 'toolbox',
2318
MCP_v20241105 = '2024-11-05',
2419
MCP_v20250326 = '2025-03-26',
2520
MCP_v20250618 = '2025-06-18',
2621
MCP_v20251125 = '2025-11-25',
2722
MCP = MCP_v20250618, // Default MCP
2823
}
2924

25+
export const MCP_LATEST = Protocol.MCP_v20251125;
26+
3027
export function getSupportedMcpVersions(): Protocol[] {
3128
return [
3229
Protocol.MCP_v20241105,

packages/toolbox-core/src/toolbox_core/toolboxTransport.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)