mcpField
A
Alibaba Cloud DashScope — Qwen

Alibaba Cloud DashScope — Qwen

Local
three.wsAI & Agents255Updated today

About Alibaba Cloud DashScope — Qwen

An MCP server for Alibaba Cloud DashScope that calls the OpenAI-compatible REST API directly with the user's own key. It provides Qwen chat, embeddings and model listing. The project is community-built and not affiliated with Alibaba Cloud.

Key features

  1. 01Qwen chat completion with several models
  2. 02text-embedding-v3 text embeddings
  3. 03List models available on the account
  4. 04Direct API calls without an intermediary backend

Use cases

  1. 01Use Qwen models from Claude Code or Cursor
  2. 02Generate embeddings for semantic search or RAG
  3. 03List which DashScope models an account can use

MCP support

The server exposes three MCP tools: qwen_chat, qwen_embed and qwen_list_models.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"nirholas-alibaba-cloud": {
"command": "npx",
"args": [
"-y",
"@three-ws/alibaba-cloud-mcp"
],
"env": {
"DASHSCOPE_API_KEY": "<DASHSCOPE_API_KEY>",
"DASHSCOPE_MODEL_ID": "<DASHSCOPE_MODEL_ID>",
"DASHSCOPE_EMBED_MODEL_ID": "<DASHSCOPE_EMBED_MODEL_ID>",
"DASHSCOPE_BASE_URL": "<DASHSCOPE_BASE_URL>",
"DASHSCOPE_REGION": "<DASHSCOPE_REGION>"
}
}
}
}
Run commandnpx -y @three-ws/alibaba-cloud-mcp
Environment variables to set
DASHSCOPE_API_KEYSecretDashScope API key. Create one at https://bailian.console.alibabacloud.com/ → API Keys.
DASHSCOPE_MODEL_IDDefault chat model id. Options: qwen-max, qwen-plus (default), qwen-turbo, qwen-long.
DASHSCOPE_EMBED_MODEL_IDDefault embedding model id. Defaults to text-embedding-v3.
DASHSCOPE_BASE_URLCustom DashScope endpoint. Defaults to international (dashscope-intl.aliyuncs.com).
DASHSCOPE_REGIONSet to 'cn' to use the China endpoint (dashscope.aliyuncs.com). Ignored if DASHSCOPE_BASE_URL is set.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@three-ws/alibaba-cloud-mcp0.1.4

Tools

3

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
modelstringNoOverride the model id. Options: qwen-max, qwen-plus (default), qwen-turbo, qwen-long, qwen-max-latest.
top_pnumberNoNucleus sampling probability mass.
messagesarrayYesConversation so far, oldest first.
max_tokensintegerNoMaximum tokens to generate.
temperaturenumberNoSampling temperature. 0 is greedy/deterministic.

Details

From the project README

three.ws

@three-ws/alibaba-cloud-mcp

MCP server for Alibaba Cloud DashScope, Qwen chat, embeddings, and model discovery on your own account.

npm license node three.ws

Install · Quick start · Tools · Models · three.ws


A Model Context Protocol server that exposes Alibaba Cloud's Qwen models, and anything else in your DashScope account, to MCP clients such as Claude Desktop, Claude Code, and Cursor. It talks directly to the DashScope OpenAI-compatible REST API with your own Alibaba Cloud API key: no intermediary backend, no telemetry, no mock data.

Community-built and not affiliated with Alibaba Cloud. Registry name: io.github.nirholas/alibaba-cloud.

Install

npm install @three-ws/alibaba-cloud-mcp

Run it directly with npx (no install needed):

DASHSCOPE_API_KEY=sk-... npx @three-ws/alibaba-cloud-mcp

Quick start

With Claude Code, one command:

claude mcp add alibaba-cloud -e DASHSCOPE_API_KEY=sk-... -- npx -y @three-ws/alibaba-cloud-mcp

Or add the server to your MCP client config:

{
  "mcpServers": {
    "alibaba-cloud": {
      "command": "npx",
      "args": ["-y", "@three-ws/alibaba-cloud-mcp"],
      "env": {
        "DASHSCOPE_API_KEY": "sk-..."
      }
    }
  }
}

Requirements

  1. An Alibaba Cloud account
  2. A DashScope API key, navigate to API Keys and create one
  3. Node.js ≥ 20

Tools

ToolDescription
qwen_chatChat completion with any Qwen model (qwen-max, qwen-plus, qwen-turbo, qwen-long)
qwen_embedText embeddings via text-embedding-v3 (1024-dim default, up to 2048)
qwen_list_modelsList all models available on this DashScope account

Models

Model IDUse
qwen-maxHighest quality: complex reasoning, long documents
qwen-plusBalanced performance (default)
qwen-turboFastest and cheapest: simple tasks
qwen-longLong context (up to 1M tokens)
text-embedding-v3Embeddings, semantic search, RAG (default)

Environment variables

VariableRequiredDefaultDescription
DASHSCOPE_API_KEYyes-Your DashScope API key
DASHSCOPE_MODEL_IDnoqwen-plusDefault chat model
DASHSCOPE_EMBED_MODEL_IDnotext-embedding-v3Default embedding model
DASHSCOPE_BASE_URLnoInternational endpointCustom DashScope endpoint
DASHSCOPE_REGIONno-Set to cn for the China endpoint
DASHSCOPE_TIMEOUT_MSno60000Request timeout in ms

Inspect

npx -y @modelcontextprotocol/inspector npx @three-ws/alibaba-cloud-mcp

Programmatic use

The package entry point (@three-ws/alibaba-cloud-mcp) exports buildServer(): a fully-registered McpServer with no transport attached, so you can mount the three tools inside a host of your own instead of spawning the binary. It reads DASHSCOPE_API_KEY when called, and registration is otherwise side-effect free. The DashScope client itself is importable from @three-ws/alibaba-cloud-mcp/src/dashscope.js (loadConfig, DashScopeClient, DashScopeError) when you want the REST wrapper without MCP.

// example.mjs: run with: DASHSCOPE_API_KEY=sk-... node example.mjs
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { buildServer } from '@three-ws/alibaba-cloud-mcp';

const server = buildServer();

// What this server exposes, before connecting anything.
for (const [name, tool] of Object.entries(server._registeredTools)) {
  console.log(`${name}: ${tool.title}`);
}

// Serve it over stdio (what the bin does), or attach any other MCP transport.
await server.connect(new StdioServerTransport());
qwen_chat: Qwen Chat
qwen_embed: Qwen Text Embeddings
qwen_list_models: List DashScope Models

Built by three.ws · three.ws/blog/three-ws-alibaba-cloud-partnership

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.