Skip to main content

Python SDK for interacting with the Toolbox service with LlamaIndex

Project description

MCP Toolbox Logo

MCP Toolbox LlamaIndex SDK

This SDK allows you to seamlessly integrate the functionalities of MCP Toolbox into your LlamaIndex LLM applications, enabling advanced orchestration and interaction with GenAI models.

For detailed guides, authentication examples, and advanced configuration, visit the Python SDK LlamaIndex Guide.

Table of Contents

Installation

pip install toolbox-llamaindex

Quickstart

Here's a minimal example to get you started using LlamaIndex:

import asyncio

from llama_index.llms.google_genai import GoogleGenAI
from llama_index.core.agent.workflow import AgentWorkflow

from toolbox_llamaindex import ToolboxClient

async def run_agent():
  async with ToolboxClient("http://127.0.0.1:5000") as toolbox:
    tools = toolbox.load_toolset()

    vertex_model = GoogleGenAI(
        model="gemini-3-flash-preview",
        vertexai_config={"project": "project-id", "location": "us-central1"},
    )
    agent = AgentWorkflow.from_tools_or_functions(
        tools,
        llm=vertex_model,
        system_prompt="You are a helpful assistant.",
    )
    response = await agent.run(user_msg="Get some response from the agent.")
    print(response)

asyncio.run(run_agent())

Usage

The toolbox-llamaindex package provides a dedicated integration to seamlessly load and use MCP Toolbox tools within the LlamaIndex 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_llamaindex-0.7.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

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

toolbox_llamaindex-0.7.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file toolbox_llamaindex-0.7.0.tar.gz.

File metadata

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

File hashes

Hashes for toolbox_llamaindex-0.7.0.tar.gz
Algorithm Hash digest
SHA256 df0f0d7d3efe2f8eafe0c500132025ce12732c7d9dd9601284a95b0f70b25fa3
MD5 d78bc686238e1e533d66d7f0b250b816
BLAKE2b-256 92107cd6c9ccde930d935149fb13261333f6730dc87e64f61f743a924c42255c

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolbox_llamaindex-0.7.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_llamaindex-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for toolbox_llamaindex-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33105600424111af44ab4befa524d272191b67a9c84725383e4c5d6b724943ba
MD5 73e0c5e2d535680238bf9886002ca915
BLAKE2b-256 47253bafc2fd1e6e7018622f0da42594f17d730b548b40dc7cf7760fda2253b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolbox_llamaindex-0.7.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