Integrations/AutoGen

Set up AutoGen

Microsoft’s multi-agent AI framework. Use autogen-ext[mcp] to connect Agentcy tools to your AutoGen agents for autonomous marketing analysis workflows.

SETUP
6 STEPS
  1. 01

    Sign up at app.goagentcy.com and create an API key

  2. 02

    Install AutoGen with MCP: pip install autogen-agentchat 'autogen-ext[openai,mcp]'

  3. 03

    Import StreamableHttpServerParams (camelCase ‘Http’ — NOT all-caps ‘HTTP’)

  4. 04

    Configure with the Agentcy URL and Authorization header

  5. 05

    Replace YOUR_AGENTCY_API_KEY with your actual key

  6. 06

    Call mcp_server_tools() and pass the returned tools to an AssistantAgent

CONFIG

path: pip install 'autogen-ext[mcp]'

python
# Python — AutoGen with MCP
# pip install autogen-agentchat 'autogen-ext[openai,mcp]'

import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import StreamableHttpServerParams, mcp_server_tools
#                                  ^^^ Note: "Http" (camelCase), NOT "HTTP" (all-caps)

async def main():
    server_params = StreamableHttpServerParams(
        url="https://data.goagentcy.com/mcp",
        headers={"Authorization": "Bearer YOUR_AGENTCY_API_KEY"},
    )

    tools = await mcp_server_tools(server_params)

    agent = AssistantAgent(
        name="marketing_analyst",
        model_client=OpenAIChatCompletionClient(model="gpt-4o"),
        tools=tools,
    )

    result = await agent.run(
        task="Analyze our website traffic and top search queries this month"
    )
    print(result)

asyncio.run(main())
Last verified: April 9, 2026Official docs
TIPS

IMPORTANT: The class is StreamableHttpServerParams with camelCase ‘Http’ — not ‘HTTP’ (all-caps). Older tutorials and our previous docs had this wrong, causing ImportError. AutoGen supports both mcp_server_tools() (one-shot) and McpWorkbench (persistent connection). Supports stdio, SSE, and Streamable HTTP transports. AutoGen entered maintenance mode in October 2025 after Microsoft announced the merger with Semantic Kernel into the new Microsoft Agent Framework — only critical bug fixes and security patches are being released. Existing AutoGen + MCP code continues to work; new projects may want to evaluate Microsoft Agent Framework instead.

REFERENCES
4 SOURCES

Stuck or want to verify these instructions yourself? These are the documentation sources we used. If something here doesn't match what you see in your client, the vendor may have updated their UI — and we'll get this page updated.

EXPLORE DATA SOURCES

After connecting AutoGen and configuring your data sources in the portal, ask questions about any of them in natural language:

View all data sources →

v1.0Need help?