# Qwen-Agent — Multi-Tool AI Agent Framework > Build AI agents with Alibaba Qwen models featuring tool calling, code execution, RAG, and browser control. Supports MCP protocol and custom tool development. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash pip install qwen-agent ``` ```python from qwen_agent.agents import Assistant bot = Assistant( llm={'model': 'qwen-max'}, function_list=['code_interpreter', 'image_gen'], ) messages = [{'role': 'user', 'content': 'Draw a sine wave plot'}] for response in bot.run(messages): print(response) ``` ## 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 ```python 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 ```python 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 ```python 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 ```python 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 ```python bot = Assistant( llm={'model': 'qwen-max'}, function_list=['browser'], ) # Agent can navigate, read, and interact with web pages ``` ### 6. GUI Application ```bash python -m qwen_agent.gui --agent-config config.json # Launches a Gradio-based chat interface ``` ## FAQ **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. ## Source & Thanks > Created by [Alibaba Qwen Team](https://github.com/QwenLM). Licensed under Apache 2.0. > > [QwenLM/Qwen-Agent](https://github.com/QwenLM/Qwen-Agent) — 6k+ stars ## Quick Start ```bash pip install qwen-agent ``` Create an AI agent with tool calls in three lines of code. ## What is Qwen-Agent? Qwen-Agent is Alibaba's agent framework built around the Qwen models. It provides built-in tools (code interpreter, browser, RAG), MCP protocol support, and a GUI interface. **In one sentence**: Qwen-Agent is Alibaba's AI agent framework with built-in code execution, browser control, RAG retrieval, and MCP protocol support. **For**: Developers building AI agents with Qwen models or compatible APIs. **Supports**: Qwen-Max, Qwen-Plus, and any OpenAI-compatible API. ## Core Features ### 1. Built-In Tools Code interpreter, document QA, browser control, image generation. ### 2. MCP Protocol Support Connect to any MCP server as a tool provider. ### 3. Custom Tools Register custom tools via decorators — the agent auto-discovers and calls them. ### 4. Multi-Agent Workflows GroupChat mode lets multiple agents collaborate on complex tasks. ### 5. GUI Interface Built-in Gradio UI — launch a chat app with one command. ## FAQ **Q: Does it support non-Qwen models?** A: Yes — any OpenAI-compatible API works. **Q: Is it open source?** A: Yes, under Apache 2.0. ## Source & Thanks > [QwenLM/Qwen-Agent](https://github.com/QwenLM/Qwen-Agent) — 6k+ stars, Apache 2.0 --- Source: https://tokrepo.com/en/workflows/qwen-agent-multi-tool-ai-agent-framework-cfd97f48 Author: Alibaba