autogen-mcp

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.

Category
访问服务器

README

autogen-mcp

AutoGen multi-agent conversations as an MCP server for Claude Code. Two surfaces:

  1. 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).
  2. 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>.jsonl in the session's project.
  • Tiers: heavy agents get a server-side converse tool and can talk to any other agent directly. cheap agents get no such tool — the server instructs them to emit NEED_INFO(<task-or-agent>): <question> lines, which send_message surfaces as info_requests for the manager to relay. Circular conversations and deep relay chains are blocked server-side. If tier is omitted at registration, the cheap model 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 — for anthropic:* / opus participants
  • DEEPINFRA_API_KEY — for deepinfra:* / heavy / cheap participants

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_task owning the REST endpoints and a cheap sub-agent db_task owning 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-manager aliases blank ANTHROPIC_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 with ANTHROPIC_API_KEY set (your plain claude). Note the debate default pair includes opus, so from an alias shell pass explicit agents to start_conversation. The server pins its base URLs (api.anthropic.com / DeepInfra), so the aliases' ANTHROPIC_BASE_URL override 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, switch mcp.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-yolo workers — report outcomes back into the owning agent's context so it remains the source of truth.
  • Steering granularity is one round. inject_message is delivered at the next round-robin boundary, not mid-turn.
  • Cost: max_rounds is the guardrail. Two eager models can burn tokens fast — keep rounds modest and use cheap participants for experiments.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选