Skip to content

Commit 2b8b39b

Browse files
authored
docs(mcp): add transport protocol info (#501)
1 parent 34a97dd commit 2b8b39b

3 files changed

Lines changed: 141 additions & 0 deletions

File tree

packages/toolbox-core/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ involving Large Language Models (LLMs).
2020
- [Installation](#installation)
2121
- [Quickstart](#quickstart)
2222
- [Usage](#usage)
23+
- [Transport Protocols](#transport-protocols)
24+
- [Supported Protocols](#supported-protocols)
25+
- [Example](#example)
2326
- [Loading Tools](#loading-tools)
2427
- [Load a toolset](#load-a-toolset)
2528
- [Load a single tool](#load-a-single-tool)
@@ -142,6 +145,50 @@ All interactions for loading and invoking tools happen through this client.
142145
> loaded will cease to function and will raise an error if you attempt to invoke
143146
> them after the client is closed.
144147
148+
## Transport Protocols
149+
150+
The SDK supports multiple transport protocols for communicating with the Toolbox server. By default, the client uses the latest supported version of the **Model Context Protocol (MCP)**.
151+
152+
You can explicitly select a protocol using the `protocol` option during client initialization. This is useful if you need to use the native Toolbox HTTP protocol or pin the client to a specific legacy version of MCP.
153+
154+
> [!NOTE]
155+
> * **Native Toolbox Transport**: This uses the service's native **REST over HTTP** API.
156+
> * **MCP Transports**: These options use the **Model Context Protocol over HTTP**.
157+
158+
### Supported Protocols
159+
160+
| Constant | Description |
161+
| :--- | :--- |
162+
| `Protocol.MCP` | **(Default)** Alias for the latest supported MCP version (currently `v2025-06-18`). |
163+
| `Protocol.TOOLBOX` | The native Toolbox HTTP protocol. |
164+
| `Protocol.MCP_v20250618` | MCP Protocol version 2025-06-18. |
165+
| `Protocol.MCP_v20250326` | MCP Protocol version 2025-03-26. |
166+
| `Protocol.MCP_v20241105` | MCP Protocol version 2024-11-05. |
167+
168+
### Example
169+
170+
If you wish to use the native Toolbox protocol:
171+
172+
```py
173+
from toolbox_core import ToolboxClient
174+
from toolbox_core.protocol import Protocol
175+
176+
async with ToolboxClient("http://127.0.0.1:5000", protocol=Protocol.TOOLBOX) as toolbox:
177+
# Use client
178+
pass
179+
```
180+
181+
If you want to pin the MCP Version 2025-03-26:
182+
183+
```py
184+
from toolbox_core import ToolboxClient
185+
from toolbox_core.protocol import Protocol
186+
187+
async with ToolboxClient("http://127.0.0.1:5000", protocol=Protocol.MCP_v20250326) as toolbox:
188+
# Use client
189+
pass
190+
```
191+
145192
## Loading Tools
146193

147194
You can load tools individually or in groups (toolsets) as defined in your

packages/toolbox-langchain/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ applications, enabling advanced orchestration and interaction with GenAI models.
1212
- [Installation](#installation)
1313
- [Quickstart](#quickstart)
1414
- [Usage](#usage)
15+
- [Transport Protocols](#transport-protocols)
16+
- [Supported Protocols](#supported-protocols)
17+
- [Example](#example)
1518
- [Loading Tools](#loading-tools)
1619
- [Load a toolset](#load-a-toolset)
1720
- [Load a single tool](#load-a-single-tool)
@@ -89,6 +92,50 @@ from toolbox_langchain import ToolboxClient
8992
async with ToolboxClient("http://127.0.0.1:5000") as toolbox:
9093
```
9194

95+
## Transport Protocols
96+
97+
The SDK supports multiple transport protocols for communicating with the Toolbox server. By default, the client uses the latest supported version of the **Model Context Protocol (MCP)**.
98+
99+
You can explicitly select a protocol using the `protocol` option during client initialization. This is useful if you need to use the native Toolbox HTTP protocol or pin the client to a specific legacy version of MCP.
100+
101+
> [!NOTE]
102+
> * **Native Toolbox Transport**: This uses the service's native **REST over HTTP** API.
103+
> * **MCP Transports**: These options use the **Model Context Protocol over HTTP**.
104+
105+
### Supported Protocols
106+
107+
| Constant | Description |
108+
| :--- | :--- |
109+
| `Protocol.MCP` | **(Default)** Alias for the latest supported MCP version (currently `v2025-06-18`). |
110+
| `Protocol.TOOLBOX` | The native Toolbox HTTP protocol. |
111+
| `Protocol.MCP_v20250618` | MCP Protocol version 2025-06-18. |
112+
| `Protocol.MCP_v20250326` | MCP Protocol version 2025-03-26. |
113+
| `Protocol.MCP_v20241105` | MCP Protocol version 2024-11-05. |
114+
115+
### Example
116+
117+
If you wish to use the native Toolbox protocol:
118+
119+
```py
120+
from toolbox_langchain import ToolboxClient
121+
from toolbox_core.protocol import Protocol
122+
123+
async with ToolboxClient("http://127.0.0.1:5000", protocol=Protocol.TOOLBOX) as toolbox:
124+
# Use client
125+
pass
126+
```
127+
128+
If you want to pin the MCP Version 2025-03-26:
129+
130+
```py
131+
from toolbox_langchain import ToolboxClient
132+
from toolbox_core.protocol import Protocol
133+
134+
async with ToolboxClient("http://127.0.0.1:5000", protocol=Protocol.MCP_v20250326) as toolbox:
135+
# Use client
136+
pass
137+
```
138+
92139
## Loading Tools
93140

94141
### Load a toolset

packages/toolbox-llamaindex/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ applications, enabling advanced orchestration and interaction with GenAI models.
1212
- [Installation](#installation)
1313
- [Quickstart](#quickstart)
1414
- [Usage](#usage)
15+
- [Transport Protocols](#transport-protocols)
16+
- [Supported Protocols](#supported-protocols)
17+
- [Example](#example)
1518
- [Loading Tools](#loading-tools)
1619
- [Load a toolset](#load-a-toolset)
1720
- [Load a single tool](#load-a-single-tool)
@@ -93,6 +96,50 @@ from toolbox_llamaindex import ToolboxClient
9396
async with ToolboxClient("http://127.0.0.1:5000") as toolbox:
9497
```
9598

99+
## Transport Protocols
100+
101+
The SDK supports multiple transport protocols for communicating with the Toolbox server. By default, the client uses the latest supported version of the **Model Context Protocol (MCP)**.
102+
103+
You can explicitly select a protocol using the `protocol` option during client initialization. This is useful if you need to use the native Toolbox HTTP protocol or pin the client to a specific legacy version of MCP.
104+
105+
> [!NOTE]
106+
> * **Native Toolbox Transport**: This uses the service's native **REST over HTTP** API.
107+
> * **MCP Transports**: These options use the **Model Context Protocol over HTTP**.
108+
109+
### Supported Protocols
110+
111+
| Constant | Description |
112+
| :--- | :--- |
113+
| `Protocol.MCP` | **(Default)** Alias for the latest supported MCP version (currently `v2025-06-18`). |
114+
| `Protocol.TOOLBOX` | The native Toolbox HTTP protocol. |
115+
| `Protocol.MCP_v20250618` | MCP Protocol version 2025-06-18. |
116+
| `Protocol.MCP_v20250326` | MCP Protocol version 2025-03-26. |
117+
| `Protocol.MCP_v20241105` | MCP Protocol version 2024-11-05. |
118+
119+
### Example
120+
121+
If you wish to use the native Toolbox protocol:
122+
123+
```py
124+
from toolbox_llamaindex import ToolboxClient
125+
from toolbox_core.protocol import Protocol
126+
127+
async with ToolboxClient("http://127.0.0.1:5000", protocol=Protocol.TOOLBOX) as toolbox:
128+
# Use client
129+
pass
130+
```
131+
132+
If you want to pin the MCP Version 2025-03-26:
133+
134+
```py
135+
from toolbox_llamaindex import ToolboxClient
136+
from toolbox_core.protocol import Protocol
137+
138+
async with ToolboxClient("http://127.0.0.1:5000", protocol=Protocol.MCP_v20250326) as toolbox:
139+
# Use client
140+
pass
141+
```
142+
96143
## Loading Tools
97144

98145
### Load a toolset

0 commit comments

Comments
 (0)