🚀 OWL with Qwen3 MCP Integration
This project demonstrates how to use the CAMEL-AI OWL framework with Qwen3 large language model through MCP (Model Context Protocol). The example showcases improved terminal output formatting, markdown log generation, and seamless integration with MCP servers.
✨ Features
- Enhanced Terminal Output: Colorful, well-formatted console output for better readability
- Automatic Log Generation: Creates detailed markdown logs of agent conversations with timestamps
- Qwen3 Integration: Seamlessly uses Qwen3-Plus for both user and assistant agents
- MCP Server Support: Connects to MCP servers including EdgeOne Pages and Playwright
- Robust Error Handling: Graceful cleanup and exception management
📋 Prerequisites
- Python 3.10+
- OWL framework installed
- Qwen API key
- Node.js (for Playwright MCP)
🛠️ Setup
-
Clone the OWL repository:
git clone https://github.com/camel-ai/owl cd owl -
Install dependencies:
pip install -r requirements.txt -
Add your Qwen API key to the
.envfile:QWEN_API_KEY=your_api_key_here -
Configure MCP servers in
mcp_sse_config.json -
(Optional) Install Playwright MCP manually:
npm install -D @playwright/mcpNote: This step is optional as the config will auto-install Playwright MCP through npx.
🧩 MCP Servers Included
This example integrates with two powerful MCP servers:
1. EdgeOne Pages MCP (edgeone-pages-mcp)
EdgeOne Pages MCP is a specialized service that enables:
- Instant HTML Deployment: Deploy AI-generated HTML content to EdgeOne Pages with a single call
- Public Access URLs: Generate publicly accessible links for deployed content
- No Setup Required: Uses an SSE (Server-Sent Events) endpoint, so no local installation is needed
Configuration in mcp_sse_config.json:
"edgeone-pages-mcp": {
"type": "sse",
"url": "https://mcp.api-inference.modelscope.cn/sse/fcbc9ff4e9704d"
}
2. Playwright MCP (playwright)
Playwright MCP is a powerful browser automation tool that allows:
- Web Navigation: Browse websites and interact with web pages
- Screen Capture: Take screenshots and extract page content
- Element Interaction: Click, type, and interact with page elements
- Web Scraping: Extract structured data from web pages
Configuration in mcp_sse_config.json:
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
Installation Options:
- Auto-installation: The configuration above automatically installs and runs Playwright MCP through
npx. - Manual installation: If you prefer to install it permanently in your project:
Then you can update the config to use the local installation:
npm install -D @playwright/mcp"playwright": { "command": "npx", "args": [ "@playwright/mcp" ] }
🚀 Usage
Run the script with a task prompt:
python run_mcp_qwen3.py "Your task description here"
If no task is provided, a default task will be used.
📊 Output
-
Terminal Output: Colorful, formatted output showing:
- System messages
- Task specifications
- Agent conversations
- Tool calls
- Task completion status
-
Markdown Logs: Detailed conversation logs saved to
conversation_logs/directory
🔧 Customization
- Modify
mcp_sse_config.jsonto add or remove MCP servers - Adjust model parameters in the
construct_societyfunction - Change the maximum conversation rounds with the
round_limitparameter
📝 Technical Details
This implementation extends the standard OWL run_mcp.py script with:
- Colorized terminal output using Colorama
- Structured markdown log generation
- Improved error handling and graceful termination
- Enhanced formatting for tool calls and agent messages