Skip to content

Commit ee06fac

Browse files
committed
Merge branch 'workflow-branch' of https://github.com/Ganga4060/mcp-toolbox-sdk-python into workflow-branch
2 parents 11adf9e + 9e6e163 commit ee06fac

30 files changed

+1062
-1719
lines changed

.github/workflows/lint-toolbox-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
console.log('Failed to remove label. Another job may have already removed it!');
5858
}
5959
- name: Checkout code
60-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
60+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
6161
with:
6262
ref: ${{ github.event.pull_request.head.sha }}
6363
repository: ${{ github.event.pull_request.head.repo.full_name }}

.github/workflows/lint-toolbox-langchain.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
console.log('Failed to remove label. Another job may have already removed it!');
5858
}
5959
- name: Checkout code
60-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
60+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
6161
with:
6262
ref: ${{ github.event.pull_request.head.sha }}
6363
repository: ${{ github.event.pull_request.head.repo.full_name }}

.github/workflows/lint-toolbox-llamaindex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
console.log('Failed to remove label. Another job may have already removed it!');
5858
}
5959
- name: Checkout code
60-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
60+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
6161
with:
6262
ref: ${{ github.event.pull_request.head.sha }}
6363
repository: ${{ github.event.pull_request.head.repo.full_name }}

.github/workflows/sync-labels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
issues: 'write'
3030
pull-requests: 'write'
3131
steps:
32-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3333
- uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"packages/toolbox-langchain":"0.5.2","packages/toolbox-core":"0.5.2","packages/toolbox-llamaindex":"0.5.2"}
1+
{"packages/toolbox-langchain":"0.5.3","packages/toolbox-core":"0.5.3","packages/toolbox-llamaindex":"0.5.3"}

packages/toolbox-core/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [0.5.3](https://github.com/googleapis/mcp-toolbox-sdk-python/compare/toolbox-core-v0.5.2...toolbox-core-v0.5.3) (2025-11-18)
4+
5+
6+
### Miscellaneous Chores
7+
8+
* **ci:** Updated the toolbox server version for CI and integration tests ([#388](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/388)), ([#414](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/414)), ([#421](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/421), [#395](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/395)).
9+
* **deps:** Updated dependencies: `aiohttp` to v3.13.0 ([#389](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/389)), `google-auth` to v2.41.1 ([#383](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/383)), `isort` to v7 ([#393](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/393)), `pytest` to v9 ([#416](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/416)), and other non-major Python dependencies ([#386](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/386)), ([#387](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/387)), ([#427](https://github.com/googleapis/mcp-toolbox-sdk-python/issues/427)).
10+
311
## [0.5.2](https://github.com/googleapis/mcp-toolbox-sdk-python/compare/toolbox-core-v0.5.1...toolbox-core-v0.5.2) (2025-09-22)
412

513

packages/toolbox-core/integration.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ options:
4747
logging: CLOUD_LOGGING_ONLY
4848
substitutions:
4949
_VERSION: '3.13'
50-
_TOOLBOX_VERSION: '0.19.1'
50+
_TOOLBOX_VERSION: '0.21.0'
5151
_TOOLBOX_MANIFEST_VERSION: '34'

packages/toolbox-core/pyproject.toml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dynamic = ["version"]
44
readme = "README.md"
55
description = "Python Base SDK for interacting with the Toolbox service"
66
license = {file = "LICENSE"}
7-
requires-python = ">=3.9"
7+
requires-python = ">=3.10"
88
authors = [
99
{name = "Google LLC", email = "[email protected]"}
1010
]
@@ -22,7 +22,6 @@ classifiers = [
2222
"License :: OSI Approved :: Apache Software License",
2323
"Programming Language :: Python",
2424
"Programming Language :: Python :: 3",
25-
"Programming Language :: Python :: 3.9",
2625
"Programming Language :: Python :: 3.10",
2726
"Programming Language :: Python :: 3.11",
2827
"Programming Language :: Python :: 3.12",
@@ -44,16 +43,16 @@ Changelog = "https://github.com/googleapis/mcp-toolbox-sdk-python/blob/main/pack
4443

4544
[project.optional-dependencies]
4645
test = [
47-
"black[jupyter]==25.9.0",
48-
"isort==6.1.0",
46+
"black[jupyter]==25.11.0",
47+
"isort==7.0.0",
4948
"mypy==1.18.2",
50-
"pytest==8.4.2",
49+
"pytest==9.0.1",
5150
"pytest-aioresponses==0.3.0",
52-
"pytest-asyncio==1.2.0",
51+
"pytest-asyncio==1.3.0",
5352
"pytest-cov==7.0.0",
5453
"pytest-mock==3.15.1",
55-
"google-cloud-secret-manager==2.24.0",
56-
"google-cloud-storage==3.4.0",
54+
"google-cloud-secret-manager==2.25.0",
55+
"google-cloud-storage==3.6.0",
5756
"aioresponses==0.7.8"
5857
]
5958
[build-system]
@@ -67,6 +66,6 @@ target-version = ['py39']
6766
profile = "black"
6867

6968
[tool.mypy]
70-
python_version = "3.9"
69+
python_version = "3.10"
7170
warn_unused_configs = true
7271
disallow_incomplete_defs = true
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
aiohttp==3.13.0
2-
pydantic==2.11.10
3-
deprecated==1.2.18
1+
aiohttp==3.13.2
2+
pydantic==2.12.4
3+
deprecated==1.3.1
44
requests==2.32.5
5-
google-auth==2.41.1
5+
google-auth==2.43.0

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

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
from aiohttp import ClientSession
2020
from deprecated import deprecated
2121

22-
from .protocol import ManifestSchema, ToolSchema
22+
from .itransport import ITransport
23+
from .protocol import ToolSchema
2324
from .tool import ToolboxTool
25+
from .toolbox_transport import ToolboxTransport
2426
from .utils import identify_auth_requirements, resolve_value
2527

2628

@@ -33,9 +35,7 @@ class ToolboxClient:
3335
is not provided.
3436
"""
3537

36-
__base_url: str
37-
__session: ClientSession
38-
__manage_session: bool
38+
__transport: ITransport
3939

4040
def __init__(
4141
self,
@@ -56,15 +56,8 @@ def __init__(
5656
should typically be managed externally.
5757
client_headers: Headers to include in each request sent through this client.
5858
"""
59-
self.__base_url = url
60-
61-
# If no aiohttp.ClientSession is provided, make our own
62-
self.__manage_session = False
63-
if session is None:
64-
self.__manage_session = True
65-
session = ClientSession()
66-
self.__session = session
6759

60+
self.__transport = ToolboxTransport(url, session)
6861
self.__client_headers = client_headers if client_headers is not None else {}
6962

7063
def __parse_tool(
@@ -103,8 +96,7 @@ def __parse_tool(
10396
)
10497

10598
tool = ToolboxTool(
106-
session=self.__session,
107-
base_url=self.__base_url,
99+
transport=self.__transport,
108100
name=name,
109101
description=schema.description,
110102
# create a read-only values to prevent mutation
@@ -149,8 +141,7 @@ async def close(self):
149141
If the session was provided externally during initialization, the caller
150142
is responsible for its lifecycle.
151143
"""
152-
if self.__manage_session and not self.__session.closed:
153-
await self.__session.close()
144+
await self.__transport.close()
154145

155146
async def load_tool(
156147
self,
@@ -191,16 +182,7 @@ async def load_tool(
191182
for name, val in self.__client_headers.items()
192183
}
193184

194-
# request the definition of the tool from the server
195-
url = f"{self.__base_url}/api/tool/{name}"
196-
async with self.__session.get(url, headers=resolved_headers) as response:
197-
if not response.ok:
198-
error_text = await response.text()
199-
raise RuntimeError(
200-
f"API request failed with status {response.status} ({response.reason}). Server response: {error_text}"
201-
)
202-
json = await response.json()
203-
manifest: ManifestSchema = ManifestSchema(**json)
185+
manifest = await self.__transport.tool_get(name, resolved_headers)
204186

205187
# parse the provided definition to a tool
206188
if name not in manifest.tools:
@@ -274,16 +256,8 @@ async def load_toolset(
274256
header_name: await resolve_value(original_headers[header_name])
275257
for header_name in original_headers
276258
}
277-
# Request the definition of the toolset from the server
278-
url = f"{self.__base_url}/api/toolset/{name or ''}"
279-
async with self.__session.get(url, headers=resolved_headers) as response:
280-
if not response.ok:
281-
error_text = await response.text()
282-
raise RuntimeError(
283-
f"API request failed with status {response.status} ({response.reason}). Server response: {error_text}"
284-
)
285-
json = await response.json()
286-
manifest: ManifestSchema = ManifestSchema(**json)
259+
260+
manifest = await self.__transport.tools_list(name, resolved_headers)
287261

288262
tools: list[ToolboxTool] = []
289263
overall_used_auth_keys: set[str] = set()

0 commit comments

Comments
 (0)