Qwen Code logo

Qwen Code

Community
Jaggerxtrm

Use qwen as a tool to power other CLI agentic LLMs

PublisherJaggerxtrm
Repositoryqwen-mcp-tool
LanguageTypeScript
Forks
2
Stars
3
Available tools
3
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    Qwen Code exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 3 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    3 stars and 2 forks from the linked repository.

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 @filename or @directory syntax to include file contents in your queries
  • Sandbox 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

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:

bash
claude mcp add qwen-cli -- npx -y @jaggerxtrm/qwen-mcp-tool

This single command configures everything automatically!

Via Global Install

Install via npm:

bash
npm install -g @jaggerxtrm/qwen-mcp-tool

Then add to Claude Code MCP settings (~/.config/claude/mcp_settings.json):

json
{
  "mcpServers": {
    "qwen-cli": {
      "command": "qwen-mcp-tool"
    }
  }
}

Via npx (Manual Configuration)

Manually configure to use npx without installing:

json
{
  "mcpServers": {
    "qwen-cli": {
      "command": "npx",
      "args": ["-y", "@jaggerxtrm/qwen-mcp-tool"]
    }
  }
}

From Source (Development)

  1. Clone and install dependencies:
bash
git clone <repo-url>
cd qwen-mcp-tool
npm install
  1. Build the project:
bash
npm run build
  1. Link locally:
bash
npm link

Available Tools

ask-qwen

The main tool for interacting with Qwen AI.

Parameters:

  • prompt (required): Your question or instruction
    • Use @filename to include a file's contents
    • Use @directory to 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 execution
  • approvalMode (optional): Control tool execution approval
    • plan: Analyze tool calls without executing
    • default: Prompt for approval (default behavior)
    • auto-edit: Auto-approve file edits
    • yolo: Auto-approve all tool calls
  • yolo (optional): Shortcut for approvalMode='yolo'
  • allFiles (optional): Include all files in current directory as context
  • debug (optional): Enable debug mode

Examples:

javascript
// 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.md

How It Works

  1. The MCP server listens for tool calls via stdio transport
  2. When a tool is called, the server validates the arguments using Zod schemas
  3. For ask-qwen, the prompt is passed to the Qwen CLI with appropriate flags
  4. File references (@filename) are handled by Qwen's built-in file processing
  5. Output is captured and returned to the MCP client
  6. 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:

FeatureGemini MCPQwen MCP
File references✅✅ (more advanced)
Sandbox mode✅✅
Multiple models✅✅
Approval modes❌✅
Directory traversalBasicAdvanced (git-aware)
Multimodal supportLimitedImages, PDFs, audio, video

Troubleshooting

"Qwen CLI not found"

Make sure the Qwen CLI is installed and available in your PATH:

bash
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 .qwenignore to exclude unnecessary files
  • Breaking 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.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "qwen-cli": {
      "command": "npx",
      "args": [
        "-y",
        "@jaggerxtrm/qwen-mcp-tool"
      ]
    }
  }
}

Available Tools

  • ask-qwen

    Query Qwen AI with support for file analysis (@file syntax), codebase exploration, and large context windows. Supports various models and execution modes.

  • ping

    Echo a message to test the connection

  • Help

    Display Qwen CLI help information

Use Qwen Code MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Qwen Code is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Qwen Code as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Qwen Code MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "qwen-code": {
      "command": "npx",
      "args": [
        "-y",
        "@jaggerxtrm/qwen-mcp-tool"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Qwen Code MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Qwen Code MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Qwen Code to help me with this task?
Qwen Code
Sure. I read it.
Here is what I found using Qwen Code.

Frequently asked questions

What is the Qwen Code MCP server used for?

Qwen Code is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Qwen Code MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Qwen Code with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Qwen Code MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Qwen Code connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Qwen Code MCP to TypingMind?

Qwen Code runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Qwen Code MCP provide in TypingMind?

Qwen Code exposes 3 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Qwen Code MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Qwen Code requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇