Back to MCP directory
publicPublicdnsLocal runtime

AutoGen

AutoGen MCP服务器是一个集成微软AutoGen框架的多代理对话服务,提供标准化的AI代理管理与协作接口。

article

README

🚀 自动生成MCP服务器

一个集成微软AutoGen框架的MCP服务器,通过标准化接口实现多代理对话。该服务器允许您创建和管理能够通过自然语言交互协作解决问题的人工智能代理,为多代理协作提供了便捷且高效的解决方案。

🚀 快速开始

要使用本服务器,您需要完成安装和配置两个步骤。安装可以选择通过Smithery自动安装,也可以手动安装;配置则需要设置环境变量和服务器配置。完成这些操作后,您就可以使用服务器提供的各种操作来创建和管理代理,实现多代理之间的对话。

✨ 主要特性

  • 创建并管理可自定义配置的AutoGen代理,满足不同场景需求。
  • 执行代理之间的一对一 conversation,实现精准交互。
  • 协调多个代理的群组聊天,促进多方协作。
  • 可配置的LLM设置和代码执行环境,灵活适配不同任务。
  • 支持助理型和用户代理型代理,丰富代理类型。
  • 内置错误处理和响应验证,保障系统稳定运行。

📦 安装指南

通过Smithery安装

要自动通过Smithery为Claude Desktop安装AutoGen Server,可执行以下命令:

npx -y @smithery/cli install @DynamicEndpoints/autogen_mcp --client claude

手动安装

  1. 克隆仓库:
git clone https://github.com/yourusername/autogen-mcp.git
cd autogen-mcp
  1. 安装依赖项:
pip install -e .

📚 详细文档

配置

环境变量

  1. 复制.env.example.env
cp .env.example .env
  1. 配置环境变量:
# 配置文件路径
AUTOGEN_MCP_CONFIG=config.json

# OpenAI API密钥(可选,也可在config.json中设置)
OPENAI_API_KEY=your-openai-api-key

服务器配置

  1. 复制config.json.exampleconfig.json
cp config.json.example config.json
  1. 配置服务器设置:
{
  "llm_config": {
    "config_list": [
      {
        "model": "gpt-4",
        "api_key": "your-openai-api-key"
      }
    ],
    "temperature": 0
  },
  "code_execution_config": {
    "work_dir": "workspace",
    "use_docker": false
  }
}

可用操作

服务器支持三种主要操作:

1. 创建代理

{
  "name": "create_agent",
  "arguments": {
    "name": "tech_lead",
    "type": "assistant",
    "system_message": "你是一个具有软件架构和设计模式专业知识的技术负责人。"
  }
}

2. 一对一聊天

{
  "name": "execute_chat",
  "arguments": {
    "initiator": "agent1",
    "responder": "agent2",
    "message": "让我们讨论系统架构。"
  }
}

3. 群组聊天

{
  "name": "execute_group_chat",
  "arguments": {
    "agents": ["agent1", "agent2", "agent3"],
    "message": "让我们审查提出的解决方案。"
  }
}

错误处理

常见错误场景包括:

1. 代理创建错误

{
  "error": "代理已存在"
}

2. 执行错误

{
  "error": "代理未找到"
}

3. 配置错误

{
  "error": "AUTOGEN_MCP_CONFIG环境变量未设置"
}

架构

  • AutoGen:主模块,协调所有操作。
  • agents.py:处理代理的创建和管理。
  • chat.py:实现一对一和群组聊天功能。
  • config.py:管理配置文件和环境变量。

📄 许可证

[此处插入许可证信息]

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client