Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c94b42a
refactor: move transport logic to a ToolboxTransport class
twishabansal Jan 5, 2026
7b027ab
rename file
twishabansal Jan 5, 2026
e40f4f3
Merge branch 'main' into transport-refactor
twishabansal Jan 5, 2026
70b0437
update license
twishabansal Jan 5, 2026
b4e3a13
basic lint
twishabansal Jan 5, 2026
eb66813
lint
twishabansal Jan 5, 2026
c6ce4ba
log errors properly
twishabansal Jan 5, 2026
00330b3
fix error handling
twishabansal Jan 5, 2026
16294fa
add test cov
twishabansal Jan 5, 2026
d9ba19d
lint
twishabansal Jan 5, 2026
0145675
add new version
twishabansal Jan 5, 2026
5210f99
add e2e tests for mcp
twishabansal Jan 5, 2026
a8e1224
update license
twishabansal Jan 5, 2026
85be9a4
basic lint
twishabansal Jan 5, 2026
d926f88
update license
twishabansal Jan 6, 2026
ed6ea0c
fix tests
twishabansal Jan 6, 2026
a9ee6d3
add tests
twishabansal Jan 6, 2026
b5fc54b
keep toolbox protocol to be default
twishabansal Jan 6, 2026
f6a40bd
add test cov
twishabansal Jan 6, 2026
1673728
add test cov
twishabansal Jan 6, 2026
6a429f9
lint
twishabansal Jan 6, 2026
dd163ee
rename e2e test file
twishabansal Jan 6, 2026
62d5ddf
lint
twishabansal Jan 6, 2026
64c542d
fix tests
twishabansal Jan 6, 2026
aadc7ae
fix license
twishabansal Jan 6, 2026
aba3d76
fix tests
twishabansal Jan 6, 2026
4e2bac3
small refactor
twishabansal Jan 6, 2026
0879fa1
Merge branch 'transport-refactor' into mcpv20241105
twishabansal Jan 6, 2026
0f2a849
lint
twishabansal Jan 6, 2026
6eb7ca6
fix e2e tests
twishabansal Jan 6, 2026
6f9d4cc
fix unit tests
twishabansal Jan 6, 2026
999c096
lint
twishabansal Jan 6, 2026
99e89dd
lint
twishabansal Jan 6, 2026
43b2474
add more tests
twishabansal Jan 6, 2026
3bc4a88
lint
twishabansal Jan 6, 2026
b8a567e
fix tests
twishabansal Jan 6, 2026
10d9117
fix error handling
twishabansal Jan 6, 2026
0f04b45
fix e2e tests
twishabansal Jan 6, 2026
021812b
add new version
twishabansal Jan 7, 2026
7032015
cc
twishabansal Jan 7, 2026
266562f
feat: add MCP v20250618
twishabansal Jan 7, 2026
b18c710
feat: make mcp the default protocol
twishabansal Jan 7, 2026
8cde1f6
allow protocol passing into toolbox-adk
twishabansal Jan 7, 2026
46772d4
run e2e test with toolbox protocol
twishabansal Jan 7, 2026
46f607b
expose protocol from adk package
twishabansal Jan 7, 2026
c371adb
Merge branch 'feat-mcp' into mcpv20241105
twishabansal Jan 9, 2026
5461480
add mcp tests to jest config
twishabansal Jan 9, 2026
9f13278
use package version
twishabansal Jan 9, 2026
e242a68
Revert "use package version"
twishabansal Jan 12, 2026
69f46fc
use dynamic versions
twishabansal Jan 12, 2026
e65f1e4
Merge branch 'mcpv20241105' into v20250326
twishabansal Jan 12, 2026
0a8fcd6
update version
twishabansal Jan 12, 2026
00bce23
Merge branch 'feat-mcp' into v20250326
twishabansal Jan 12, 2026
22382b1
fix merge issues
twishabansal Jan 12, 2026
e4ff46e
Merge branch 'v20250326' into v20250618
twishabansal Jan 12, 2026
427055d
fix version issue
twishabansal Jan 12, 2026
2e47776
Merge branch 'v20250618' into default-protocol
twishabansal Jan 12, 2026
b3a94e5
Merge branch 'feat-mcp' into default-protocol
twishabansal Jan 12, 2026
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
9 changes: 8 additions & 1 deletion packages/toolbox-adk/src/toolbox_adk/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
AuthTokenGetters,
BoundParams,
ClientHeadersConfig,
Protocol,
} from '@toolbox-sdk/core';
import {ToolboxTool, CoreTool} from './tool.js';
import type {AxiosInstance} from 'axios';
Expand Down Expand Up @@ -44,8 +45,14 @@ export class ToolboxClient {
url: string,
session?: AxiosInstance | null,
clientHeaders?: ClientHeadersConfig | null,
protocol: Protocol = Protocol.MCP,
) {
this.coreClient = new CoreToolboxClient(url, session, clientHeaders);
this.coreClient = new CoreToolboxClient(
url,
session,
clientHeaders,
protocol,
);
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/toolbox-adk/src/toolbox_adk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
// Export the main factory function and the core tool type
export {ToolboxClient} from './client.js';
export {ToolboxTool} from './tool.js';
export {Protocol} from '@toolbox-sdk/core';
14 changes: 11 additions & 3 deletions packages/toolbox-adk/test/e2e/test.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import {ToolboxClient} from '../../src/toolbox_adk/client.js';
import {ToolboxTool} from '../../src/toolbox_adk/tool.js';
import {
ToolboxClient,
ToolboxTool,
Protocol,
} from '../../src/toolbox_adk/index.js';

import {AxiosError} from 'axios';
import {CustomGlobal} from './types.js';
Expand All @@ -30,7 +33,12 @@ describe('ToolboxClient E2E Tests', () => {
const mockToolContext = {} as ToolContext;

beforeAll(async () => {
commonToolboxClient = new ToolboxClient(testBaseUrl);
commonToolboxClient = new ToolboxClient(
testBaseUrl,
undefined,
undefined,
Protocol.TOOLBOX,
);
});

beforeEach(async () => {
Expand Down
6 changes: 6 additions & 0 deletions packages/toolbox-adk/test/test.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type MockCoreClientConstructor = (
url: string,
session?: AxiosInstance | null,
clientHeaders?: ClientHeadersConfig | null,
protocol?: string | null,
) => MockCoreClient;

const mockLoadTool =
Expand Down Expand Up @@ -66,6 +67,10 @@ const MockToolboxTool = jest.fn();

jest.unstable_mockModule('@toolbox-sdk/core', () => ({
ToolboxClient: MockCoreToolboxClient,
Protocol: {
MCP: 'mcp-default',
TOOLBOX: 'toolbox',
},
}));

jest.unstable_mockModule('../src/toolbox_adk/tool.js', () => ({
Expand Down Expand Up @@ -94,6 +99,7 @@ describe('ToolboxClient', () => {
'http://test.url',
mockSession,
mockHeaders,
'mcp-default',
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/toolbox-core/src/toolbox_core/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ToolboxClient {
url: string,
session?: AxiosInstance | null,
clientHeaders?: ClientHeadersConfig | null,
protocol: Protocol = Protocol.TOOLBOX,
protocol: Protocol = Protocol.MCP,
) {
this.#clientHeaders = clientHeaders || {};
if (protocol === Protocol.TOOLBOX) {
Expand Down
8 changes: 7 additions & 1 deletion packages/toolbox-core/test/e2e/test.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import {ToolboxClient} from '../../src/toolbox_core/client';
import {ToolboxTool} from '../../src/toolbox_core/tool';
import {Protocol} from '../../src/toolbox_core/protocol';

import {AxiosError} from 'axios';
import {CustomGlobal} from './types';
Expand All @@ -27,7 +28,12 @@ describe('ToolboxClient E2E Tests', () => {
const projectId = (globalThis as CustomGlobal).__GOOGLE_CLOUD_PROJECT__;

beforeAll(async () => {
commonToolboxClient = new ToolboxClient(testBaseUrl);
commonToolboxClient = new ToolboxClient(
testBaseUrl,
undefined,
undefined,
Protocol.TOOLBOX,
);
});

beforeEach(async () => {
Expand Down
18 changes: 13 additions & 5 deletions packages/toolbox-core/test/test.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,28 @@ describe('ToolboxClient', () => {
});

describe('Initialization', () => {
it('should initialize with the correct base URL (default Toolbox)', () => {
it('should initialize with the correct base URL (default MCP)', () => {
client = new ToolboxClient(testBaseUrl);
expect(ToolboxTransport).toHaveBeenCalledWith(testBaseUrl, undefined);
expect(McpHttpTransportV20250618).toHaveBeenCalledWith(
testBaseUrl,
undefined,
Protocol.MCP_v20250618,
);
});

it('should pass provided axios session to transport (Toolbox)', () => {
it('should pass provided axios session to transport (default MCP)', () => {
const mockSession = {
get: jest.fn(),
} as unknown as import('axios').AxiosInstance;
client = new ToolboxClient(testBaseUrl, mockSession);
expect(ToolboxTransport).toHaveBeenCalledWith(testBaseUrl, mockSession);
expect(McpHttpTransportV20250618).toHaveBeenCalledWith(
testBaseUrl,
mockSession,
Protocol.MCP_v20250618,
);
});

it('should initialize with MCP transport (default) when specified', () => {
it('should initialize with MCP transport (explicit) when specified', () => {
client = new ToolboxClient(
testBaseUrl,
undefined,
Expand Down