dashscope
OfficialDashScope MCP server that delegates Alibaba Cloud Bailian embeddings, reranking, image/audio/video generation, and async task management to the official Python SDK.
Embeddings/search:
embed_textcreates vectors with optional JSON file output;semantic_searchranks documents by cosine similarity.Reranking:
rerank_documentsreranks candidates by relevance and returns scores.Images:
generate_imageplus submit/get/cancel task tools; returns temporary image URLs.Speech:
synthesize_speechreturns a temporary audio URL;transcribe_audiotranscribes public audio URLs and returns per-file transcript URLs.Video:
generate_videoplus submit/get/cancel task tools; returns a temporary video URL.Setup: requires
DASHSCOPE_API_KEYand runs as a stdio MCP server viauvx dashscope-agent-tools.
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., "@dashscope generate an image of a red panda eating bamboo at sunset"
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.
dashscope-agent-tools
DashScope / 阿里云百炼 capabilities as MCP tools for agent hosts (Claude Code, OpenCode, GitHub Copilot, Codex, and any MCP-capable harness). Every tool is a thin delegation to the official dashscope Python SDK — HTTP, signing, retries, and async-task polling all live in the SDK.
Status: published on PyPI as
dashscope-agent-tools(0.1.0). Ships a Claude Code plugin, an OpenCode MCP config, and an Agent Plugins 1.0 package for GitHub Copilot.
v1 capabilities
Capability | Tools | SDK entry |
Embeddings |
|
|
Rerank |
|
|
Image generation |
|
|
Speech synthesis (TTS) |
|
|
Speech recognition (ASR) |
|
|
Video generation |
|
|
Default models: text-embedding-v4, gte-rerank-v2, wan2.2-t2i-flash,
cosyvoice-v2 (voice longxiaochun_v2), qwen-audio-3.1-asr-flash-filetrans,
wan2.2-t2v-plus.
Image URLs are valid for 24 hours; TTS audio_url and video video_url are
temporary (see expires_at) — download them to keep the media. ASR returns a
per-file transcription_url (a JSON document); fetch it for the recognized text.
Related MCP server: MiniMax MCP JS
Credentials
The server reads DASHSCOPE_API_KEY from its environment. Get a key at the
Bailian console (API-KEY page).
Install in Claude Code
Two commands, then enter your API key in the install dialog (stored masked in secure storage, injected into the MCP server env):
claude plugin marketplace add dashscope/dashscope-agent-tools-python
claude plugin install dashscope@dashscope-agent-toolsThe plugin (plugin/) ships Skills that tell Claude when to use each tool
(image generation, semantic search, reranking, text-to-speech, transcription,
video generation) plus the MCP server config.
Install in OpenCode
OpenCode reuses the same published package via an MCP config (not a native
plugin). Merge mcp.servers.dashscope from
hosts/opencode/opencode.jsonc into your project
or global ~/.config/opencode/opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"dashscope": {
"type": "local",
"command": ["uvx", "dashscope-agent-tools"],
"environment": {
"DASHSCOPE_API_KEY": "{env:DASHSCOPE_API_KEY}",
"DASHSCOPE_ENTRYPOINT": "opencode"
},
"protocol": "legacy"
}
}
}
}export DASHSCOPE_API_KEY=... in your shell — {env:...} pulls it in (OpenCode
does not expand $NAME). protocol: "legacy" skips the 2026-07-28 probe for
our mcp 1.x server. Verify with opencode mcp list; tools appear as
dashscope_<tool>. The six host-agnostic skills in plugin/skills/ can be added
via the config skills array or copied into .opencode/skills/. See
hosts/opencode/README.md for details.
Install in GitHub Copilot (VS Code + CLI)
The plugin/ directory is also an Agent Plugins 1.0
package (root plugin.json + mcp.json + the same skills/), the portable
standard Copilot in VS Code, Copilot CLI, and the Copilot app all read. It
coexists with the Claude format — Copilot loads mcp.json (uvx dashscope-agent-tools, DASHSCOPE_ENTRYPOINT=copilot), Claude Code keeps
.claude-plugin/ + .mcp.json.
Copilot CLI (the .claude-plugin/marketplace.json catalog is discovered here too):
copilot plugin marketplace add dashscope/dashscope-agent-tools-python
copilot plugin install dashscope@dashscope-agent-tools
# or directly: copilot plugin install dashscope/dashscope-agent-tools-python:pluginVS Code: enable chat.plugins.enabled, add the marketplace to
chat.plugins.marketplaces, then install dashscope from Customizations →
Plugins; or register a local checkout via chat.pluginLocations.
Agent Plugins 1.0 has no portable credential field, so export DASHSCOPE_API_KEY
in the shell that launches Copilot — the bundled server inherits it (auth is
client-managed). See hosts/copilot/README.md.
Other MCP hosts
The package is a plain stdio MCP server — no Claude-specific code. Generic config (Claude Desktop, Cursor, Cline, OpenClaw, ...):
{
"mcpServers": {
"dashscope": {
"command": "uvx",
"args": ["dashscope-agent-tools"],
"env": { "DASHSCOPE_API_KEY": "sk-..." }
}
}
}Codex (~/.codex/config.toml):
[mcp_servers.dashscope]
command = "uvx"
args = ["dashscope-agent-tools"]Without uv, use pip install dashscope-agent-tools and set
command to dashscope-agent-tools (or python -m dashscope_agent_tools).
Development
uv venv --python 3.12 .venv
uv pip install -p .venv/bin/python -e ".[dev]"
.venv/bin/pytest tests/ -q # offline tests, mocked SDK
.venv/bin/python tests/smoke_real.py # real API smoke (needs DASHSCOPE_API_KEY)
# video render is billed and opt-in: DASHSCOPE_SMOKE_VIDEO=1 .venv/bin/python tests/smoke_real.py
.venv/bin/python tests/plugin_structure_check.py # plugin structure (no claude CLI needed)
.venv/bin/python tests/opencode_structure_check.py # OpenCode config (no opencode CLI needed)
.venv/bin/python tests/copilot_structure_check.py # Agent Plugins package (no copilot CLI needed)
.venv/bin/python tests/mcp_stdio_check.py # drive the server over MCP stdio
# prove the published uvx command form with a host's attribution, e.g.:
DAT_MCP_SERVER=uvx DAT_MCP_ARGS=dashscope-agent-tools DASHSCOPE_ENTRYPOINT=opencode \
.venv/bin/python tests/mcp_stdio_check.py
claude plugin validate ./plugin
claude --plugin-dir ./plugin # load the plugin for one sessionFor local plugin runs before PyPI publish, point plugin/.mcp.json at the
repo venv binary (.venv/bin/dashscope-agent-tools) instead of uvx.
Layout
src/dashscope_agent_tools/ # tools.py (SDK delegation), server.py (MCP), errors.py
plugin/ # dual-format: Claude (.claude-plugin/, .mcp.json)
# + Agent Plugins 1.0 (plugin.json, mcp.json); shared skills/
hosts/opencode/ # OpenCode MCP config + README (reuses plugin/skills)
hosts/copilot/ # Copilot VS Code/CLI install guide (Agent Plugins package)
.claude-plugin/marketplace.json
tests/ # offline mock tests + real-API smoke + structure checksAvailable Tools
13 toolscancel_image_taskC
Cancel a pending/running image task.
Inputs: task_id (required). Returns: result
cancel_video_taskC
Cancel a pending/running video task.
Inputs: task_id (required). Returns: result
embed_textB
Embed texts into vectors with a DashScope embedding model.
For more than a couple of texts, pass output_file to write the vectors to a JSON file instead of returning them inline (they are large).
Inputs: texts (required), model, dimension, output_file. Returns: result
generate_imageA
Generate image(s) from a text prompt and wait for the result.
Blocks until the task finishes or timeout (seconds) elapses. Returns image URLs valid for 24 hours. If the host tool call may time out, use submit_image_task + get_image_task instead.
Inputs: prompt (required), n, size, model, +1 more. Returns: result
generate_videoA
Generate a video from a text prompt (optional first-frame image_url).
Blocks until the task finishes or timeout (seconds). Returns video_url. Video rendering is slow; if the host may time out, use submit_video_task
get_video_task instead.
Inputs: prompt (required), size, model, ratio, +4 more. Returns: result
get_image_taskB
Fetch one image task's status; includes image_urls once SUCCEEDED.
Inputs: task_id (required). Returns: result
get_video_taskA
Fetch one video task's status; includes video_url once SUCCEEDED.
Inputs: task_id (required). Returns: result
rerank_documentsA
Rerank candidate documents by relevance to a query (DashScope rerank).
More accurate than embedding similarity for search-result ordering. Returns each match's original index and relevance_score.
Inputs: query (required), documents (required), model, top_n, +1 more. Returns: result
semantic_searchA
Rank documents by meaning-similarity to a query (DashScope embeddings).
Embeds the query and all documents in one API call, then ranks by cosine similarity locally. Returns the top_k matches with scores, no vectors.
Inputs: query (required), documents (required), model, top_k. Returns: result
submit_image_taskA
Submit an image-generation task without waiting; returns task_id.
Poll with get_image_task, or cancel with cancel_image_task.
Inputs: prompt (required), n, size, model. Returns: result
submit_video_taskB
Submit a video-generation task without waiting; returns task_id.
Poll with get_video_task, or cancel with cancel_video_task.
Inputs: prompt (required), size, model, ratio, +3 more. Returns: result
synthesize_speechB
Synthesize speech from text (DashScope TTS); returns a temporary audio URL.
Single synchronous request. The audio_url expires (see expires_at); download it to keep the audio.
Inputs: text (required), model, voice, format, +2 more. Returns: result
transcribe_audioA
Transcribe audio file(s) to text (DashScope ASR); async submit + wait.
file_urls must be publicly reachable audio URLs. Returns per-file results carrying transcription_url (the transcript JSON); fetch those for the text.
Inputs: file_urls (required), model, timeout. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools map to a distinct model capability (embed, rerank, image, video, TTS, ASR), and the image/video lifecycle tools are cleanly separated. The only real overlap is between semantic_search and rerank_documents (both order documents by query relevance), but the descriptions explicitly contrast them (embedding similarity vs. dedicated rerank).
Every name is snake_case verb_noun: embed_text, generate_image, submit_image_task, get_image_task, cancel_image_task, generate_video, submit_video_task, cancel_video_task, synthesize_speech, transcribe_audio. The async lifecycle trio (generate/submit/get/cancel) follows an identical pattern across image and video, making the set highly predictable.
13 tools cover five modalities with well-earned extras for async image/video control. No filler: each tool corresponds to a genuine operation (sync variant, async submit, poll, cancel, or core inference).
Image and video generation have full sync/async/poll/cancel lifecycles, and embeddings, rerank, TTS, and ASR are present. Gaps are minor: there is no list_tasks to enumerate pending image/video tasks, no cancellation path for TTS/ASR, and no text-generation (LLM completion) tool despite that being a core DashScope capability.
Maintenance
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Generate images, video and audio in Claude, Codex and any MCP-ready AI agent.
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables file system operations, web scraping, and AI-powered search through MCP tools for use by LLM agents.1-
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to generate images and videos, synthesize speech, clone and design voices, and dynamically configure API interactions.428 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible applications to manage local and cloud language models, run text generation and chat, generate embeddings, and perform web search and content fetching.790 npmAGPL 3.0
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible applications to manage and use local or cloud LLM models through comprehensive SDK tools, including model management, text generation, chat with tool support, embeddings, and web search/fetch.790 npmAGPL 3.0