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.8.0.tar.gz (19.8 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.8.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: toolbox_llamaindex-0.8.0.tar.gz
  • Upload date:
  • Size: 19.8 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.8.0.tar.gz
Algorithm Hash digest
SHA256 9b7f213d4347c6eef0983b1725b0bc89a967375fa5191f9ff9ce3666227dbe69
MD5 c63522ed4fd6a86b974197250cb158bb
BLAKE2b-256 918e3f477f610b5be9ec8e45bdd15458128d9bfbedb2cdf959316d2858feeb29

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for toolbox_llamaindex-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c97e151387cc12965d1bffac50ac2ff103b6e3c9983cdb3a602b8a42d870e00
MD5 ef3b06a3be6402de0f0b8fbf8bbd8a9b
BLAKE2b-256 37f2f9bc77597b0e6ca242903cc5d35552f67dfc125d0044b8c491886a2d4d54

See more details on using hashes here.

Provenance

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