autogen-mcp
Enables Claude Code to orchestrate AutoGen multi-agent conversations, supporting persistent sub-agents with tiered permissions and ad-hoc group debates for task decomposition and collaborative problem-solving.
README
autogen-mcp
AutoGen multi-agent conversations as an MCP server for Claude Code. Two surfaces:
- Swarm hierarchy — persistent sub-agents, each owning one task's context, with tiered conversation permissions (heavy agents converse freely; cheap agents route requests through the manager).
- Group debates — ad-hoc autonomous round-robin conversations between fresh agents.
Transcripts and per-agent logs are stored per project: in
.autogen-swarm/ inside whatever directory the Claude Code session runs in
(override with the AUTOGEN_MCP_DATA_DIR env var; falls back to this
project's directory if the cwd isn't writable).
The hierarchy model
- The manager is your
claude-manager(heavy / GLM-5.2) Claude Code session — it drives the MCP tools and follows~/agent-swarm/manager_prompt.md. - Sub-agents are persistent AutoGen agents in this server. Each is
registered with a
role(the task it owns) and keeps its conversation memory for the whole server session; every exchange is appended to.autogen-swarm/agents/<name>.jsonlin the session's project. - Tiers:
heavyagents get a server-sideconversetool and can talk to any other agent directly.cheapagents get no such tool — the server instructs them to emitNEED_INFO(<task-or-agent>): <question>lines, whichsend_messagesurfaces asinfo_requestsfor the manager to relay. Circular conversations and deep relay chains are blocked server-side. Iftieris omitted at registration, thecheapmodel alias defaults to the cheap tier and everything else to heavy.
Setup
cd ~/Documents/projects/claude_code+autogen
uv sync
Required environment variables (in the shell that launches Claude Code):
ANTHROPIC_API_KEY— foranthropic:*/opusparticipantsDEEPINFRA_API_KEY— fordeepinfra:*/heavy/cheapparticipants
Registration
The project-scoped .mcp.json is already in place — any claude session
started in this directory picks up the autogen-chat server automatically
(you'll be asked to approve it once).
It is also registered user-scope (global) in all three Claude Code profiles, so it's available from any directory. User-scope config lives in the profile's config dir, so each profile needs its own registration:
MCPDIR=~/Documents/projects/claude_code+autogen
# default profile
claude mcp add --scope user autogen-chat -- \
uv run --project "$MCPDIR" python "$MCPDIR/server.py"
# manager / worker profiles (separate CLAUDE_CONFIG_DIR)
CLAUDE_CONFIG_DIR=~/.claude-manager claude mcp add --scope user autogen-chat -- \
uv run --project "$MCPDIR" python "$MCPDIR/server.py"
CLAUDE_CONFIG_DIR=~/.claude-worker claude mcp add --scope user autogen-chat -- \
uv run --project "$MCPDIR" python "$MCPDIR/server.py"
Note: --project (not --directory) matters — it selects this project's
Python environment while preserving the working directory Claude Code
launches the server with, which is what makes per-project log storage work.
Usage from Claude Code
Just ask in natural language.
Swarm workflow (the manager session does this per its prompt):
Register a cheap sub-agent
api_taskowning the REST endpoints and a cheap sub-agentdb_taskowning the schema. Brief each with its scope and acceptance test, then relay any NEED_INFO requests between them.
Group debate:
Start a conversation between opus and heavy about whether we should migrate this repo to a monorepo. 8 rounds. Check on it and summarize when done.
Claude Code will call the tools:
Swarm hierarchy (persistent sub-agents):
| Tool | Purpose |
|---|---|
register_agent |
Create a persistent sub-agent owning one task (name, model, role, optional system/tier) |
send_message |
Converse with a sub-agent; result includes info_requests (NEED_INFO lines to relay) |
agent_log |
Read an agent's exchange history (since for incremental reads) |
list_agents |
Roster with tiers, roles, exchange counts |
remove_agent |
Retire an agent (log file survives) |
Group debates (ad-hoc conversations):
| Tool | Purpose |
|---|---|
start_conversation |
Kick off a background group chat, returns an ID |
get_transcript |
Poll new turns (since_turn for incremental reads) |
inject_message |
Queue a steering message, delivered at the next round boundary |
stop_conversation |
Cancel a running chat |
list_conversations |
Show all chats in this session |
MCP resources: conversation://<id> and agent://<name> expose full
transcripts as readable text.
Model specs
Participants take "model" as <provider>:<model> or a shorthand alias:
| Alias | Resolves to |
|---|---|
opus |
anthropic:claude-opus-4-8 |
heavy |
deepinfra:zai-org/GLM-5.2 |
cheap |
deepinfra:deepseek-ai/DeepSeek-V4-Flash |
Any DeepInfra model works via deepinfra:<org>/<model> (uses their
OpenAI-compatible endpoint at api.deepinfra.com/v1/openai).
Notes and caveats
- Which shell you launch from decides which providers work. The
claude-cheap/claude-heavy/claude-manageraliases blankANTHROPIC_API_KEY, so from those sessions only DeepInfra participants (heavy,cheap,deepinfra:*) work — which is all the swarm hierarchy needs.opus/anthropic:*participants require a shell withANTHROPIC_API_KEYset (your plainclaude). Note the debate default pair includesopus, so from an alias shell pass explicit agents tostart_conversation. The server pins its base URLs (api.anthropic.com/ DeepInfra), so the aliases'ANTHROPIC_BASE_URLoverride can't misroute requests either way. The server is registered user-scope in all three profiles, so any session in any directory gets the tools — and its swarm data lands in that session's own.autogen-swarm/. - Conversations and agent memory die with the session. stdio servers
live as long as the Claude Code session that spawned them. Transcripts
(
.autogen-swarm/transcripts/*.jsonl) and agent logs (.autogen-swarm/agents/*.jsonl) survive on disk in the session's project, but in-flight chats and sub-agent conversation memory don't — after a restart, re-register agents and re-brief them (e.g. paste the relevant log back as the first message). If you want a long-lived daemon, switchmcp.run()to the streamable-HTTP transport and register the URL instead. - Sub-agents are chat-only. They think and produce code as text; they
don't touch files. Execution stays with the manager or headless
claude-cheap-yoloworkers — report outcomes back into the owning agent's context so it remains the source of truth. - Steering granularity is one round.
inject_messageis delivered at the next round-robin boundary, not mid-turn. - Cost:
max_roundsis the guardrail. Two eager models can burn tokens fast — keep rounds modest and usecheapparticipants for experiments.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.