qwen-cli-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| QWEN_MCP_BIN | No | Path to the qwen binary. | qwen |
| QWEN_MCP_WRAP | No | Command prefix, e.g. a sandbox wrapper around qwen. | |
| QWEN_MCP_MODEL | No | Default model for every call. | |
| QWEN_MCP_STATE | No | Session → cwd map. | ~/.local/state/qwen-mcp/sessions.json |
| QWEN_MCP_MAX_LINE | No | Longest single message line from qwen before it is dropped. | 8000000 |
| QWEN_MCP_MAX_FRAME | No | Longest single JSON-RPC frame from the client. | 8000000 |
| QWEN_MCP_TRANSPORT | No | Default transport: 'stream' or 'print'. | stream |
| QWEN_MCP_MAX_OUTPUT | No | Cap on the answer. Unset means no truncation. | |
| QWEN_MCP_TIMEOUT_MS | No | Server-wide default wall clock; unset means no deadline. timeout_ms overrides it per call. | |
| QWEN_MCP_MAX_CAPTURE | No | Read-buffer guard against a runaway stream. | 16000000 |
| QWEN_MCP_MAX_SESSIONS | No | Remembered sessions before the oldest is dropped. | 200 |
| QWEN_MCP_STDERR_LIMIT | No | stderr tail included in the response. | 1500 |
| QWEN_MCP_APPROVAL_MODE | No | Default approval mode for every call. See the warning above. | yolo |
| QWEN_MCP_KILL_GRACE_MS | No | SIGTERM → SIGKILL grace period. | 5000 |
| QWEN_MCP_MAX_CONCURRENT | No | Concurrent qwen processes. | 100 |
| QWEN_MCP_MAX_TIMEOUT_MS | No | Ceiling on what timeout_ms may ask for. | 86400000 |
| QWEN_MCP_INIT_TIMEOUT_MS | No | Initialize-handshake timeout (stream only). | 15000 |
| QWEN_MCP_MODELS_TIMEOUT_MS | No | Whole-run budget for the qwen_models probe. | 60000 |
| QWEN_MCP_INTERRUPT_GRACE_MS | No | How long 'interrupt' gets before signals (stream only). | 5000 |
| QWEN_MCP_STDERR_KEEP_EVENTS | No | '1' forwards stderr verbatim, protocol lines included. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| qwenA | Start a NEW task in the local Qwen Code agent — a separate CLI coding agent with its own file/shell tools and its own context window. Blocks until qwen settles, then returns only its final result plus stats, prefixed [session: ]; continue that session later with qwen_reply.
Good for: a second opinion from a different model, work kept out of this context, or parallel investigation.
Caution: with approval_mode 'yolo' (the server default) qwen edits files and runs shell commands as your user inside |
| qwen_replyA | Send a new turn to an existing qwen session that is not executing right now — including one that timed out or was cancelled: the session survives in qwen's own store, so resume it here instead of restarting with |
| qwen_modelsA | List the models this qwen installation can actually reach right now — id, label, capabilities, context window — read live from the CLI over its control protocol. Use it to pick a |
| qwen_sendA | Deliver a message into a qwen turn that is executing right now. Works only on runs started with transport 'stream' — 'print' runs cannot be reached, and a session that already finished takes qwen_reply, not qwen_send. Returns immediately; qwen's reaction appears in the answer of the qwen/qwen_reply call still waiting on that turn. |
| qwen_runningA | List qwen turns executing at this moment — the ones qwen_send can reach — with session id, working directory, elapsed time, and messages already sent in. Only stream-transport runs appear; 'print' runs are unreachable mid-run. For past sessions use qwen_sessions. |
| qwen_sessionsA | List all qwen sessions started through this server, newest first, with their working directory — running or finished, including runs that timed out. Use it to recover an id for qwen_reply. For turns still executing (qwen_send targets), use qwen_running. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 6 tools
Each tool has a clearly distinct role: starting a new session, resuming an idle one, messaging a running turn, listing models, listing currently running sessions, and listing historical sessions. The boundaries between qwen_reply and qwen_send (idle vs. executing) and between qwen_running and qwen_sessions (current vs. all) are explicitly explained, leaving no ambiguity for an agent.
All tools share the snake_case prefix `qwen_`, with descriptive suffixes (`qwen_reply`, `qwen_models`, `qwen_running`). While the suffixes mix verbs and nouns, the pattern is uniform and predictable, making it easy to infer purpose from the name alone.
With 6 tools, the server is well-scoped for managing a CLI coding agent. Each tool addresses a distinct need (creation, interaction, inspection, enumeration) without redundancy, fitting comfortably within the ideal 3–15 range.
The tool surface covers the full lifecycle: start, resume, interrupt (via send), list running, list models, and list historical sessions. A terminate/kill tool for running sessions is absent, but this is a minor gap given that sessions can be resumed after timeout and the descriptions encourage using `qwen_reply` for stalled sessions.