Skip to main content

AutoGen

Connect a Microsoft AutoGen agent to Leadovaro using mcp_server_tools with Streamable HTTP transport and the native Anthropic model client.

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 "autogen-agentchat" "autogen-ext[mcp,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​

Use mcp_server_tools to discover and load all Leadovaro tools, then pass them to an AssistantAgent:

import os
import asyncio
from dotenv import load_dotenv
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_agentchat.conditions import TextMentionTermination
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.tools.mcp import mcp_server_tools, StreamableHttpServerParams
from autogen_ext.models.anthropic import AnthropicChatCompletionClient

load_dotenv()

async def main():
server_params = StreamableHttpServerParams(
url=os.environ["LEADOVARO_URL"],
headers={"Authorization": f"Bearer {os.environ['LEADOVARO_TOKEN']}"},
)
tools = await mcp_server_tools(server_params)
print(f"{len(tools)} tools loaded")

model_client = AnthropicChatCompletionClient(model="claude-sonnet-4-6")

agent = AssistantAgent(
name="leadovaro_assistant",
model_client=model_client,
tools=tools,
system_message="You are a helpful assistant with access to Leadovaro tools.",
)

response = await agent.run(task="What events do I have today?")
print(response.messages[-1].content)

asyncio.run(main())
note

Use mcp_server_tools(server_params) — not StreamableHttpMcpToolAdapter. The adapter requires a tool argument that is not available during initialization.

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​

autogen-reference-implementation-leadovaro

Complete implementation with FastAPI chat UI and deployment guide

Next Steps​