Skip to main content

CAMEL-AI

Connect a CAMEL-AI agent to Leadovaro using MCPToolkit with an HTTP-based MCPClient. CAMEL-AI's toolkit discovers all Leadovaro tools and exposes them to a ChatAgent.

Prerequisites​

  • Python 3.11+
  • A Leadovaro account at app.leadovaro.com with a configured toolkit
  • A Leadovaro token and an Anthropic API key

Installation​

pip install camel-ai anthropic python-dotenv

Environment Variables​

LEADOVARO_URL=/_sites/app.leadovaro.com/hub/mcp?profile=your-toolkit
LEADOVARO_TOKEN=your-leadovaro-token
ANTHROPIC_API_KEY=your-anthropic-key
Get Your Credentials

How to generate a Leadovaro token and configure toolkit URL parameters

Connecting to Leadovaro​

Create an MCPClient with a ServerConfig, then connect the toolkit explicitly before use:

import os
import asyncio
from dotenv import load_dotenv
from camel.toolkits.mcp_toolkit import MCPToolkit
from camel.utils.mcp_client import MCPClient, ServerConfig
from camel.agents import ChatAgent
from camel.models import ModelFactory
from camel.types import ModelPlatformType

load_dotenv()

async def main():
client = MCPClient(
config=ServerConfig(
url=os.environ["LEADOVARO_URL"],
headers={"Authorization": f"Bearer {os.environ['LEADOVARO_TOKEN']}"},
)
)
toolkit = MCPToolkit(clients=[client])

await toolkit.connect()
try:
tools = toolkit.get_tools()
print(f"{len(tools)} tools loaded")

model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC,
model_type="claude-sonnet-4-6",
)
agent = ChatAgent(
system_message="You are a helpful assistant with access to Leadovaro tools.",
model=model,
tools=tools,
)

response = agent.step("What events do I have today?")
print(response.msgs[0].content)
finally:
await toolkit.disconnect()

asyncio.run(main())
note

Use await toolkit.connect() and await toolkit.disconnect() — MCPToolkit does not have a connection() async context manager method. Always disconnect in a finally block to avoid hanging connections.

Production Configuration​

For production agents, lock to a specific toolkit using the profile URL parameter:

LEADOVARO_URL=/_sites/app.leadovaro.com/hub/mcp?profile=your-production-toolkit

Reference Implementation​

camel-ai-reference-implementation-leadovaro

Complete implementation with FastAPI chat UI and deployment guide

Next Steps​