Skip to main content

Python SDK for interacting with the Toolbox service with LangChain

Project description

MCP Toolbox Logo

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toolbox_langchain-1.3.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toolbox_langchain-1.3.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file toolbox_langchain-1.3.0.tar.gz.

File metadata

  • Download URL: toolbox_langchain-1.3.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for toolbox_langchain-1.3.0.tar.gz
Algorithm Hash digest
SHA256 9d0192f14f02f8c8cb9f5ea988be68a23ececec2bc6fbdc35fcf0cf904d76854
MD5 2148fea2f8122ba3fbd5634b33071f34
BLAKE2b-256 a96dc33aaeebea45a9e8bc5c14918d2ddab11559916914526a5adc21c6fe23c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolbox_langchain-1.3.0.tar.gz:

Publisher: google-cloud-sdk-py@oss-exit-gate-prod.iam.gserviceaccount.com

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.
  • Statement: Publication detail:
    • Token Issuer: https://accounts.google.com
    • Service Account: google-cloud-sdk-py@oss-exit-gate-prod.iam.gserviceaccount.com

File details

Details for the file toolbox_langchain-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for toolbox_langchain-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba873b2c7fcb3af0f4143b707fe69ea2fb548cf71ef643a0a39381245e2d3306
MD5 80f5ad810ec636884e1182f472a86657
BLAKE2b-256 beb1ce309699950ab0a2c82bfe4fcae3e20b6f0268c24ce55eea868222d85dd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolbox_langchain-1.3.0-py3-none-any.whl:

Publisher: google-cloud-sdk-py@oss-exit-gate-prod.iam.gserviceaccount.com

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.
  • Statement: Publication detail:
    • Token Issuer: https://accounts.google.com
    • Service Account: google-cloud-sdk-py@oss-exit-gate-prod.iam.gserviceaccount.com

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page