Skip to main content
Microsoft AutoGen (AgentChat, v0.4+) connects to SAN through the autogen-ext MCP tools. Wrap SAN’s endpoint in an McpWorkbench and attach it to an AssistantAgent.

Prerequisites

  • Python 3.10+
  • A SAN API key
    Create one in the API Quickstart if you don’t have one yet.

Quick Start

1

Install AutoGen with the MCP extra

pip install "autogen-agentchat" "autogen-ext[mcp,openai]"
2

Describe SAN's MCP server

Pass your key in the headers dict.
from autogen_ext.tools.mcp import StreamableHttpServerParams

server_params = StreamableHttpServerParams(
    url="https://gateway.sanfoundation.com/mcp",
    headers={"x-api-key": "sk_..."},
)
3

Run an agent with SAN's tools

Open an McpWorkbench and hand it to your AssistantAgent.
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import McpWorkbench, StreamableHttpServerParams

async def main() -> None:
    server_params = StreamableHttpServerParams(
        url="https://gateway.sanfoundation.com/mcp",
        headers={"x-api-key": "sk_..."},
    )
    model_client = OpenAIChatCompletionClient(model="gpt-4o")

    async with McpWorkbench(server_params) as workbench:
        agent = AssistantAgent(
            name="san_assistant",
            model_client=model_client,
            workbench=workbench,
        )
        result = await agent.run(task="Which SAN agents are available?")
        print(result)

asyncio.run(main())