A comprehensive MCP server that provides deep integration with Microsoft's AutoGen framework v0.9+, featuring the latest capabilities including prompts, resources, advanced workflows, and enhanced agent types. This server enables sophisticated multi-agent conversations through a standardized Model Context Protocol interface.
- Prompts: Pre-built templates for common workflows (code review, research, creative writing)
- Resources: Real-time access to agent status, chat history, and configurations
- Dynamic Content: Template-based prompts with arguments and embedded resources
- Latest MCP SDK: Version 1.12.3 with full feature support
- Assistant Agents: Enhanced with latest LLM capabilities
- Conversable Agents: Flexible conversation patterns
- Teachable Agents: Learning and memory persistence
- Retrievable Agents: Knowledge base integration
- Multimodal Agents: Image and document processing (when available)
- Code Generation: Architect β Developer β Reviewer β Executor pipeline
- Research Analysis: Researcher β Analyst β Critic β Synthesizer workflow
- Creative Writing: Multi-stage creative collaboration
- Problem Solving: Structured approach to complex problems
- Code Review: Security β Performance β Style review teams
- Custom Workflows: Build your own agent collaboration patterns
- Smart Speaker Selection: Auto, manual, random, round-robin modes
- Nested Conversations: Hierarchical agent interactions
- Swarm Intelligence: Coordinated multi-agent problem solving
- Memory Management: Persistent agent knowledge and preferences
- Quality Checks: Built-in validation and improvement loops
create_agent
- Create agents with advanced configurationscreate_workflow
- Build complete multi-agent workflowsget_agent_status
- Detailed agent metrics and health monitoring
execute_chat
- Enhanced two-agent conversationsexecute_group_chat
- Multi-agent group discussionsexecute_nested_chat
- Hierarchical conversation structuresexecute_swarm
- Swarm-based collaborative problem solving
execute_workflow
- Run predefined workflow templatesmanage_agent_memory
- Handle agent learning and persistenceconfigure_teachability
- Enable/configure agent learning capabilities
Create sophisticated multi-agent workflows with customizable parameters:
- Arguments:
task_description
,agent_count
,workflow_type
- Use case: Rapid workflow prototyping and deployment
Set up collaborative code review with specialized agents:
- Arguments:
code
,language
,focus_areas
- Use case: Comprehensive code quality assessment
Deploy research teams for in-depth topic analysis:
- Arguments:
topic
,depth
- Use case: Academic research, market analysis, technical investigation
Live list of active agents with status and capabilities
Available workflow templates and configurations
Recent conversation history and interaction logs
Current server configuration and settings
To install AutoGen Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @DynamicEndpoints/autogen_mcp --client claude
- Clone the repository:
git clone https://github.com/yourusername/autogen-mcp.git
cd autogen-mcp
- Install Node.js dependencies:
npm install
- Install Python dependencies:
pip install -r requirements.txt --user
- Build the TypeScript project:
npm run build
- Set up configuration:
cp .env.example .env
cp config.json.example config.json
# Edit .env and config.json with your settings
Create a .env
file from the template:
# Required
OPENAI_API_KEY=your-openai-api-key-here
# Optional - Path to configuration file
AUTOGEN_MCP_CONFIG=config.json
# Enhanced Features
ENABLE_PROMPTS=true
ENABLE_RESOURCES=true
ENABLE_WORKFLOWS=true
ENABLE_TEACHABILITY=true
# Performance Settings
MAX_CHAT_TURNS=10
DEFAULT_OUTPUT_FORMAT=json
Update config.json
with your preferences:
{
"llm_config": {
"config_list": [
{
"model": "gpt-4o",
"api_key": "your-openai-api-key"
}
],
"temperature": 0.7
},
"enhanced_features": {
"prompts": { "enabled": true },
"resources": { "enabled": true },
"workflows": { "enabled": true }
}
}
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"autogen": {
"command": "node",
"args": ["path/to/autogen-mcp/build/index.js"],
"env": {
"OPENAI_API_KEY": "your-key-here"
}
}
}
}
Test the server functionality:
# Run comprehensive tests
python test_server.py
# Test CLI interface
python cli_example.py create_agent "researcher" "assistant" "You are a research specialist"
python cli_example.py execute_workflow "code_generation" '{"task":"Hello world","language":"python"}'
The server provides several built-in prompts:
- autogen-workflow - Create multi-agent workflows
- code-review - Set up collaborative code review
- research-analysis - Deploy research teams
Available resources provide real-time data:
autogen://agents/list
- Current active agentsautogen://workflows/templates
- Available workflow templatesautogen://chat/history
- Recent conversation historyautogen://config/current
- Server configuration
{
"workflow_name": "code_generation",
"input_data": {
"task": "Create a REST API endpoint",
"language": "python",
"requirements": ["FastAPI", "Pydantic", "Error handling"]
},
"quality_checks": true
}
{
"workflow_name": "research",
"input_data": {
"topic": "AI Ethics in 2025",
"depth": "comprehensive"
},
"output_format": "markdown"
}
- Assistant Agents: LLM-powered conversational agents
- User Proxy Agents: Code execution and human interaction
- Conversable Agents: Flexible conversation patterns
- Teachable Agents: Learning and memory persistence (when available)
- Retrievable Agents: Knowledge base integration (when available)
- Two-Agent Chat: Direct conversation between agents
- Group Chat: Multi-agent discussions with smart speaker selection
- Nested Chat: Hierarchical conversation structures
- Swarm Intelligence: Coordinated problem solving (experimental)
- Persistent agent memory across sessions
- Conversation history tracking
- Learning from interactions (teachable agents)
- Memory cleanup and optimization
- API Key Errors: Ensure your OpenAI API key is valid and has sufficient credits
- Import Errors: Install all dependencies with
pip install -r requirements.txt --user
- Build Failures: Check Node.js version (>= 18) and run
npm install
- Chat Failures: Verify agent creation succeeded before attempting conversations
Enable detailed logging:
export LOG_LEVEL=DEBUG
python test_server.py
- Use
gpt-4o-mini
for faster, cost-effective operations - Enable caching for repeated operations
- Set appropriate timeout values for long-running workflows
- Use quality checks only when needed (increases execution time)
# Full test suite
python test_server.py
# Individual workflow tests
python -c "
import asyncio
from src.autogen_mcp.workflows import WorkflowManager
wm = WorkflowManager()
print(asyncio.run(wm.execute_workflow('code_generation', {'task': 'test'})))
"
npm run build
npm run lint
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
- β¨ Enhanced MCP support with prompts and resources
- π€ Advanced agent types (teachable, retrievable)
- π Sophisticated workflows with quality checks
- π― Smart speaker selection and nested conversations
- π Real-time resource monitoring
- π§ Memory management and persistence
- Basic AutoGen integration
- Simple agent creation and chat execution
- MCP tool interface
For issues and questions:
- Check the troubleshooting section above
- Review the test examples in
test_server.py
- Open an issue on GitHub with detailed reproduction steps
MIT License - see LICENSE file for details.
OPENAI_API_KEY=your-openai-api-key
### Server Configuration
1. Copy `config.json.example` to `config.json`:
```bash
cp config.json.example config.json
- Configure the server settings:
{
"llm_config": {
"config_list": [
{
"model": "gpt-4",
"api_key": "your-openai-api-key"
}
],
"temperature": 0
},
"code_execution_config": {
"work_dir": "workspace",
"use_docker": false
}
}
The server supports three main operations:
{
"name": "create_agent",
"arguments": {
"name": "tech_lead",
"type": "assistant",
"system_message": "You are a technical lead with expertise in software architecture and design patterns."
}
}
{
"name": "execute_chat",
"arguments": {
"initiator": "agent1",
"responder": "agent2",
"message": "Let's discuss the system architecture."
}
}
{
"name": "execute_group_chat",
"arguments": {
"agents": ["agent1", "agent2", "agent3"],
"message": "Let's review the proposed solution."
}
}
Common error scenarios include:
- Agent Creation Errors
{
"error": "Agent already exists"
}
- Execution Errors
{
"error": "Agent not found"
}
- Configuration Errors
{
"error": "AUTOGEN_MCP_CONFIG environment variable not set"
}
The server follows a modular architecture:
src/
βββ autogen_mcp/
β βββ __init__.py
β βββ agents.py # Agent management and configuration
β βββ config.py # Configuration handling and validation
β βββ server.py # MCP server implementation
β βββ workflows.py # Conversation workflow management
MIT License - See LICENSE file for details