LlamaIndex Integration
How to integrate LlamaIndex with Aluvia's MCP server for enhanced AI agent capabilities.
Setup Guide
1
Get your Aluvia Token
- Go to the Aluvia Dashboard
- Navigate to the Credentials page
- Copy your Aluvia Token (it looks like:
2dceb1aa0***************************)
💡Tip
Your Aluvia Token is required for authentication and should be kept secure.
2
Install LlamaIndex MCP Toolkit
pip install llama-index-tools-mcp
3
Configure your MCP server
import asyncio
from llama_index.tools.mcp import BasicMCPClient
async def main():
# Initialize MCP client for Aluvia
# Replace <ALUVIA_TOKEN> with your actual token from the Credentials page
http_client = BasicMCPClient(
"https://mcp.aluvia.io",
headers={"Authorization": "Bearer <ALUVIA_TOKEN>"}
)
# List available MCP tools
tools = await http_client.list_tools()
print("Available tools:", tools)
# Example: List your connectivity credentials (via tool name)
result = await http_client.call_tool(
"list_proxy_credentials",
{}
)
print("Connectivity credentials:", result)
# Example: Test a credential (via tool name)
test_result = await http_client.call_tool(
"test_proxy_credential",
{
"username": "username123",
"url": "https://ipconfig.io/json"
}
)
print("Connectivity test result:", test_result)
# Example: Get usage statistics
usage_stats = await http_client.call_tool(
"get_usage_stats",
{}
)
print("Usage statistics:", usage_stats)
asyncio.run(main())
4
Test it works
- Run your LlamaIndex script using Aluvia’s MCP tools
- You should see your connectivity credentials listed
- Verify that connectivity tests and usage statistics return correctly