Qwen Max MCP server

Integrates with Qwen Max large language model via Dashscope API for text generation and analysis tasks in applications.
Back to servers
Provider
Julien Martin
Release date
Feb 05, 2025
Language
TypeScript
Stats
17 stars

This MCP server implementation lets you use Alibaba Cloud's Qwen Max language model through Claude Desktop via the Model Context Protocol (MCP). It offers a reliable Node.js-based integration with the powerful Qwen Max model.

Prerequisites

  • Node.js (v18 or higher)
  • npm
  • Claude Desktop
  • Dashscope API key

Installation

Installing via Smithery

To install Qwen Max MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @66julienmartin/mcp-server-qwen_max --client claude

Manual Installation

git clone https://github.com/66julienmartin/mcp-server-qwen-max.git
cd Qwen_Max
npm install

Model Selection

By default, this server uses the Qwen-Max model. The Qwen series offers several commercial models with different capabilities:

Qwen-Max

Provides the best inference performance, especially for complex and multi-step tasks. Context window: 32,768 tokens

  • Max input: 30,720 tokens
  • Max output: 8,192 tokens
  • Pricing: $0.0016/1K tokens (input), $0.0064/1K tokens (output)
  • Free quota: 1 million tokens

Available versions:

  • qwen-max (Stable)
  • qwen-max-latest (Latest)
  • qwen-max-2025-01-25 (Snapshot, also known as qwen-max-0125 or Qwen2.5-Max)

Qwen-Plus

Balanced combination of performance, speed, and cost, ideal for moderately complex tasks. Context window: 131,072 tokens

  • Max input: 129,024 tokens
  • Max output: 8,192 tokens
  • Pricing: $0.0004/1K tokens (input), $0.0012/1K tokens (output)
  • Free quota: 1 million tokens

Available versions:

  • qwen-plus (Stable)
  • qwen-plus-latest (Latest)
  • qwen-plus-2025-01-25 (Snapshot, also known as qwen-plus-0125)

Qwen-Turbo

Fast speed and low cost, suitable for simple tasks.

  • Context window: 1,000,000 tokens
  • Max input: 1,000,000 tokens
  • Max output: 8,192 tokens
  • Pricing: $0.00005/1K tokens (input), $0.0002/1K tokens (output)
  • Free quota: 1 million tokens

Available versions:

  • qwen-turbo (Stable)
  • qwen-turbo-latest (Latest)
  • qwen-turbo-2024-11-01 (Snapshot, also known as qwen-turbo-1101)

To modify the model, update the model name in src/index.ts:

// For Qwen-Max (default)
model: "qwen-max"

// For Qwen-Plus
model: "qwen-plus"

// For Qwen-Turbo
model: "qwen-turbo"

For more detailed information about available models, visit the Alibaba Cloud Model Documentation.

Configuration

Create a .env file in the project root:

DASHSCOPE_API_KEY=your-api-key-here

Update Claude Desktop configuration:

{
  "mcpServers": {
    "qwen_max": {
      "command": "node",
      "args": ["/path/to/Qwen_Max/build/index.js"],
      "env": {
        "DASHSCOPE_API_KEY": "your-api-key-here"
      }
    }
  }
}

Features

  • Text generation with Qwen models
  • Configurable parameters (max_tokens, temperature)
  • Error handling
  • MCP protocol support
  • Claude Desktop integration
  • Support for all Qwen commercial models (Max, Plus, Turbo)
  • Extensive token context windows

API Usage

// Example tool call
{
  "name": "qwen_max",
  "arguments": {
    "prompt": "Your prompt here",
    "max_tokens": 8192,
    "temperature": 0.7
  }
}

The Temperature Parameter

The temperature parameter controls the randomness of the model's output:

  • Lower values (0.0-0.7): More focused and deterministic outputs
  • Higher values (0.7-1.0): More creative and varied outputs

Recommended temperature settings by task:

  • Code generation: 0.0-0.3
  • Technical writing: 0.3-0.5
  • General tasks: 0.7 (default)
  • Creative writing: 0.8-1.0

Error Handling

The server provides detailed error messages for common issues:

  • API authentication errors
  • Invalid parameters
  • Rate limiting
  • Network issues
  • Token limit exceeded
  • Model availability issues

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later