What is Qwen-Agent?
Qwen-Agent is an agent framework built around Alibaba's Qwen language models. It provides built-in tools (code interpreter, browser, RAG), supports MCP protocol, and includes a GUI for building custom agent applications — from simple chatbots to complex multi-agent workflows.
Answer-Ready: Qwen-Agent is an AI agent framework by Alibaba featuring built-in code execution, browser control, RAG retrieval, and MCP protocol support. It works with Qwen models and compatible APIs for building multi-tool agent applications.
Best for: Developers building AI agents with Qwen models or compatible APIs. Works with: Qwen-Max, Qwen-Plus, any OpenAI-compatible API. Setup time: Under 3 minutes.
Core Features
1. Built-In Tools
from qwen_agent.agents import Assistant
# Code Interpreter — execute Python in sandbox
bot = Assistant(
llm={'model': 'qwen-max'},
function_list=['code_interpreter'],
)
# RAG — retrieve from documents
bot = Assistant(
llm={'model': 'qwen-max'},
function_list=['doc_qa'],
files=['report.pdf', 'data.csv'],
)2. MCP Protocol Support
from qwen_agent.agents import Assistant
bot = Assistant(
llm={'model': 'qwen-max'},
mcp_servers={
'filesystem': {
'command': 'npx',
'args': ['-y', '@anthropic/mcp-filesystem', '/tmp']
}
},
)3. Custom Tool Development
from qwen_agent.tools.base import BaseTool, register_tool
@register_tool('weather')
class WeatherTool(BaseTool):
description = 'Get current weather for a city'
parameters = [{'name': 'city', 'type': 'string', 'required': True}]
def call(self, params, **kwargs):
city = params['city']
return f'Sunny, 25C in {city}'4. Multi-Agent Workflows
from qwen_agent.agents import GroupChat
researcher = Assistant(llm=cfg, name='Researcher', system_message='You research topics.')
writer = Assistant(llm=cfg, name='Writer', system_message='You write articles.')
group = GroupChat(agents=[researcher, writer])
for response in group.run(messages):
print(response)5. Browser Control
bot = Assistant(
llm={'model': 'qwen-max'},
function_list=['browser'],
)
# Agent can navigate, read, and interact with web pages6. GUI Application
python -m qwen_agent.gui --agent-config config.json
# Launches a Gradio-based chat interfaceFAQ
Q: Does it work with non-Qwen models? A: Yes, any OpenAI-compatible API works. Set the base_url and api_key accordingly.
Q: Is it open source? A: Yes, Apache 2.0 license. Fully open-source with active development.
Q: How does MCP support work? A: Qwen-Agent can connect to MCP servers as tool providers, similar to Claude Code or Cline.