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.
pip install toolbox-llamaindexHere'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())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:
- Transport Protocols
- Loading Tools
- Use with LlamaIndex
- Manual Usage
- Client to Server Authentication
- Authenticating Tools
- Binding Parameter Values
- Asynchronous Usage
- OpenTelemetry
Contributions are welcome! Please refer to the DEVELOPER.md file for guidelines on how to set up a development environment and run tests.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
If you encounter issues or have questions, check the existing GitHub Issues for the main Toolbox project.
