Qwen MCP Tool
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Qwen MCP Tool analyze @src/auth/ for security vulnerabilities"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Qwen MCP Tool
Model Context Protocol server for Qwen CLI integration. This tool enables AI assistants like Claude to leverage Qwen's powerful code analysis and large context window capabilities through the MCP protocol.
Features
Large Context Windows: Leverage Qwen's massive token capacity for analyzing large files and entire codebases
File Analysis: Use
@filenameor@directorysyntax to include file contents in your queriesSandbox Mode: Safely execute code and run tests in isolated environments
Multiple Models: Support for various Qwen models (qwen3-coder-plus, qwen3-coder-turbo, etc.)
Flexible Approval Modes: Control tool execution with plan/default/auto-edit/yolo modes
MCP Protocol: Seamless integration with MCP-compatible AI assistants
Related MCP server: DevToolkit MCP Server
Prerequisites
Node.js v16 or higher
Qwen CLI installed and configured (qwen-code)
Installation
Quick Setup (Easiest - Recommended)
Use Claude Code's built-in MCP installer:
claude mcp add qwen-cli -- npx -y @jaggerxtrm/qwen-mcp-toolThis single command configures everything automatically!
Via Global Install
Install via npm:
npm install -g @jaggerxtrm/qwen-mcp-toolThen add to Claude Code MCP settings (~/.config/claude/mcp_settings.json):
{
"mcpServers": {
"qwen-cli": {
"command": "qwen-mcp-tool"
}
}
}Via npx (Manual Configuration)
Manually configure to use npx without installing:
{
"mcpServers": {
"qwen-cli": {
"command": "npx",
"args": ["-y", "@jaggerxtrm/qwen-mcp-tool"]
}
}
}From Source (Development)
Clone and install dependencies:
git clone <repo-url>
cd qwen-mcp-tool
npm installBuild the project:
npm run buildLink locally:
npm linkAvailable Tools
ask-qwen
The main tool for interacting with Qwen AI.
Parameters:
prompt(required): Your question or instructionUse
@filenameto include a file's contentsUse
@directoryto include all files in a directory
model(optional): Model to use (qwen3-coder-plus, qwen3-coder-turbo, etc.)sandbox(optional): Enable sandbox mode for safe code executionapprovalMode(optional): Control tool execution approvalplan: Analyze tool calls without executingdefault: Prompt for approval (default behavior)auto-edit: Auto-approve file editsyolo: Auto-approve all tool calls
yolo(optional): Shortcut for approvalMode='yolo'allFiles(optional): Include all files in current directory as contextdebug(optional): Enable debug mode
Examples:
// Analyze a specific file
{
"prompt": "@src/main.ts Explain what this code does"
}
// Analyze entire codebase
{
"prompt": "@src/ Summarize the architecture of this codebase"
}
// Use specific model with sandbox
{
"prompt": "Run the test suite and fix any failures",
"model": "qwen3-coder-plus",
"sandbox": true,
"approvalMode": "auto-edit"
}ping
Simple echo test to verify the connection.
Parameters:
prompt(optional): Message to echo (defaults to "Pong!")
Help
Display Qwen CLI help information.
Parameters: None
Configuration
The tool uses the following default models:
Primary: qwen3-coder-plus
Fallback: qwen3-coder-turbo (used if primary hits quota limits)
You can override these by specifying the model parameter in your requests.
Usage with Claude Code
Once installed as an MCP server, you can use it within Claude Code:
Ask Qwen to analyze the authentication system in @src/auth/Claude will automatically use the ask-qwen tool with the appropriate parameters.
Project Structure
qwen-mcp-tool/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── constants.ts # Configuration and constants
│ ├── tools/
│ │ ├── registry.ts # Tool registration system
│ │ ├── ask-qwen.tool.ts # Main Qwen interaction tool
│ │ ├── simple-tools.ts # Utility tools (ping, help)
│ │ └── index.ts # Tool exports
│ └── utils/
│ ├── commandExecutor.ts # Command execution utility
│ ├── qwenExecutor.ts # Qwen CLI wrapper
│ └── logger.ts # Logging utility
├── package.json
├── tsconfig.json
└── README.mdHow It Works
The MCP server listens for tool calls via stdio transport
When a tool is called, the server validates the arguments using Zod schemas
For
ask-qwen, the prompt is passed to the Qwen CLI with appropriate flagsFile references (
@filename) are handled by Qwen's built-in file processingOutput is captured and returned to the MCP client
If quota limits are hit, the server automatically falls back to the turbo model
Comparison with Gemini MCP Tool
This tool is inspired by gemini-mcp-tool but adapted for Qwen CLI:
Feature | Gemini MCP | Qwen MCP |
File references | ✅ | ✅ (more advanced) |
Sandbox mode | ✅ | ✅ |
Multiple models | ✅ | ✅ |
Approval modes | ❌ | ✅ |
Directory traversal | Basic | Advanced (git-aware) |
Multimodal support | Limited | Images, PDFs, audio, video |
Troubleshooting
"Qwen CLI not found"
Make sure the Qwen CLI is installed and available in your PATH:
npm install -g @qwen/cli
# or follow instructions at https://github.com/QwenLM/qwen-code"Command timed out"
For very large files or codebases, the analysis may take longer than the default 10-minute timeout. Consider:
Using
.qwenignoreto exclude unnecessary filesBreaking down large queries into smaller chunks
Using
approvalMode: "plan"to analyze without executing
"Invalid tool arguments"
Check that your arguments match the tool schema. Use the Help tool to see available options.
License
MIT
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Credits
Inspired by gemini-mcp-tool by jamubc. Built for use with Qwen Code.
Available Tools
3 toolsask-qwenB
Query Qwen AI with support for file analysis (@file syntax), codebase exploration, and large context windows. Supports various models and execution modes.
Inputs: prompt (required), model, sandbox, approvalMode, +3 more.
HelpB
Display Qwen CLI help information
Inputs: no named parameters.
pingA
Echo a message to test the connection
Inputs: prompt.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: ask-qwen for AI queries with file/codebase support, Help for CLI documentation, and ping for connection testing. There is no overlap in functionality, making tool selection unambiguous for an agent.
The naming is mixed: ask-qwen uses a verb-noun pattern, Help is a capitalized noun, and ping is a lowercase verb. While readable, this inconsistency in style (snake_case vs. no underscores, verb vs. noun forms) deviates from a predictable pattern.
With 3 tools, the count is reasonable for a basic AI/utility server, though it feels slightly thin for broader use cases. Each tool serves a clear purpose, but the scope could support a few more complementary tools without being overwhelming.
For a Qwen AI tool server, core functions like querying (ask-qwen) and testing (ping) are covered, but there are notable gaps such as model management, session handling, or advanced configuration tools. The Help tool provides documentation, but operational coverage is limited.
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables LLMs to search and read files in local and GitHub repositories, analyze pull request diffs, and grep code content with built-in security protections.6-
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with 28 developer tools across file, git, code analysis, HTTP, and system domains, enabling tasks like file editing, repository management, code analysis, and shell command execution.2MIT
- FlicenseAqualityDmaintenanceEnables AI agents to autonomously navigate a codebase by listing directories, reading files, searching code, and running whitelisted commands.5-
- AlicenseAqualityDmaintenanceEnables AI assistants to securely execute Python and JavaScript code in sandboxed environments, with file management and package installation.755 npmMIT