Python SDK for interacting with the Toolbox service with LangChain
Project description
MCP Toolbox LangChain SDK
This SDK allows you to seamlessly integrate the functionalities of MCP Toolbox into your LangChain GenAI applications, enabling advanced orchestration and interaction with LLMs.
For detailed guides, authentication examples, and advanced configuration, visit the Python SDK Langchain Guide.
Table of Contents
Installation
pip install toolbox-langchain
Quickstart
Here's a minimal example to get you started using LangGraph:
from toolbox_langchain import ToolboxClient
from langchain_google_vertexai import ChatVertexAI
from langgraph.prebuilt import create_react_agent
async with ToolboxClient("http://127.0.0.1:5000") as toolbox:
tools = toolbox.load_toolset()
model = ChatVertexAI(model="gemini-3-flash-preview")
agent = create_react_agent(model, tools)
prompt = "How's the weather today?"
for s in agent.stream({"messages": [("user", prompt)]}, stream_mode="values"):
message = s["messages"][-1]
if isinstance(message, tuple):
print(message)
else:
message.pretty_print()
Usage
The toolbox-langchain package provids a dedicated integration to seamlessly load and use MCP Toolbox tools within the LangChain orchestration framework. For detailed guides and advanced configuration, please visit the following sections on our Documentation Site:
- Transport Protocols
- Loading Tools
- Use with Langchain
- Use with Langraph
- Manual Usage
- Client to Server Authentication
- Authenticating Tools
- Binding Parameter Values
- Asynchronous Usage
- OpenTelemetry
Contributing
Contributions are welcome! Please refer to the DEVELOPER.md file for guidelines on how to set up a development environment and run tests.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Support
If you encounter issues or have questions, check the existing GitHub Issues for the main Toolbox project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toolbox_langchain-1.0.0.tar.gz.
File metadata
- Download URL: toolbox_langchain-1.0.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06c0174a3e9b15a191c29bdfbf1c4b0a11dcc697786c5d47cca8091196eec1b3
|
|
| MD5 |
0bc4df699d572a04857bc519b8ea1ba0
|
|
| BLAKE2b-256 |
89b7e0cabb3e0dc849e2a6974584d8e3eabf7f596440a276956bc5d5bb31afa2
|
Provenance
The following attestation bundles were made for toolbox_langchain-1.0.0.tar.gz:
Publisher:
google-cloud-sdk-py@oss-exit-gate-prod.iam.gserviceaccount.com
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolbox_langchain-1.0.0.tar.gz -
Subject digest:
06c0174a3e9b15a191c29bdfbf1c4b0a11dcc697786c5d47cca8091196eec1b3 - Sigstore transparency entry: 1181247305
- Sigstore integration time:
-
Token Issuer:
https://accounts.google.com -
Service Account:
google-cloud-sdk-py@oss-exit-gate-prod.iam.gserviceaccount.com
-
Statement type:
File details
Details for the file toolbox_langchain-1.0.0-py3-none-any.whl.
File metadata
- Download URL: toolbox_langchain-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ac07aeff3faee92ab2601c309058fed71fab1c1ff5ec27a31403c151e276de2
|
|
| MD5 |
7a04d9ec67e1f4d8a7bbeada92d433cb
|
|
| BLAKE2b-256 |
599624f40ddec99e0c4cc97829b79e362ed82f7a48aeecf137fe67384aa43080
|
Provenance
The following attestation bundles were made for toolbox_langchain-1.0.0-py3-none-any.whl:
Publisher:
google-cloud-sdk-py@oss-exit-gate-prod.iam.gserviceaccount.com
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolbox_langchain-1.0.0-py3-none-any.whl -
Subject digest:
4ac07aeff3faee92ab2601c309058fed71fab1c1ff5ec27a31403c151e276de2 - Sigstore transparency entry: 1181247255
- Sigstore integration time:
-
Token Issuer:
https://accounts.google.com -
Service Account:
google-cloud-sdk-py@oss-exit-gate-prod.iam.gserviceaccount.com
-
Statement type: