Qodercli Mcp

io.github.cantbeblank96由 GitHub 帳號 cantbeblank96 發布v0.4.3更新於 Oct 28, 2026

MCP server mode for Qoder CLI — delegate coding tasks to local Qoder agents from any MCP client.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

包裝本機 Qoder CLI,讓任何 MCP 用戶端把編碼任務交給 Qoder 代理,並可列出工作階段與可用模型。

可以做什麼
  • 把提示詞交給本機 qodercli 代理執行,可指定工作目錄、模型、推理強度、系統提示、逾時與輸出格式
  • 透過工作階段 ID 續接先前的委派任務,或列出本機工作階段以找出可續接的項目
  • 在執行時列出 qodercli 目前支援的模型
  • 透過沙箱層級、權限模式或核准策略控制代理可執行的操作範圍
  • 回傳結構化結果,例如工作階段 ID、耗時、額度用量與回合數
適用情境
適合已在使用 Qoder CLI、並希望讓其他 MCP 用戶端(例如 IDE 或桌面助理)把編碼、程式碼審查或程式庫分析任務當成子代理交給 Qoder 的人,也支援多輪追問。
執行需求
以 stdio 在本機執行,可透過 npx 或原始碼啟動。需要 Node.js 18 以上,以及已安裝並已登入的 qodercli。選用環境變數:QODERCLI_PATH、QODERCLI_DEFAULT_PERMISSION_MODE、HTTP_PROXY、HTTPS_PROXY。僅支援桌面用戶端。
安裝前請注意
委派的提示詞可能變更檔案:workspace-write 允許在工作目錄內編輯,danger-full-access 或 bypass_permissions 會開放 shell 權限。預設為唯讀,但把 QODERCLI_DEFAULT_PERMISSION_MODE 設為 bypass_permissions 會讓完整存取成為預設。代理變數會傳給 qodercli 子程序。這是非官方第三方包裝,與 Qoder 無關聯。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Qodercli Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

qodercli-mcp

English | 简体中文

[npm version] [npm weekly downloads] [npm total downloads] [License: MIT] [GitHub stars]

The missing MCP server mode for Qoder CLI — delegate coding tasks to local Qoder agents from any MCP client (Qoder IDE, Claude Code, Cursor…).

A minimal MCP server that wraps the local qodercli (Qoder CLI) as MCP tools, letting any MCP client (Qoder IDE, Claude Code, Cursor, …) call Qoder like a sub-agent.

[demo]

30s demo: MCP client ⇄ qodercli-mcp ⇄ qodercli — initialize → tools/list → list-models (real output, not sped up)

Quick start

Zero-config via npx — add this to your MCP client config (~/.qoder/mcp.json, claude_desktop_config.json, …):

json
{ "mcpServers": { "qodercli-mcp": { "command": "npx", "args": ["-y", "qodercli-mcp"] } } }

Three tools are exposed:

ToolPurpose
ask-qoderDelegate a task to qodercli
list-sessionsDiscover resumable sessions
list-modelsRuntime model discovery

Highlights: verified permission semantics (see below — e.g. dont_ask is read-only), codex-style sandbox/approval_policy, structured output (session_id/duration_ms/total_credits).

Full configuration options are in Install.

Why

Some CLI agents ship an official MCP server mode (e.g. codex mcp-server), but qodercli currently only acts as an MCP client. This project fills that gap with a thin wrapper: it spawns qodercli -p <prompt> under the hood and streams the result back over MCP stdio.

Features

  • ask-qoder tool — delegate a prompt to qodercli
  • Structured output (session_id, is_error, duration_ms, total_credits, num_turns) via -o json parsing
  • list-sessions tool to discover resumable sessions
  • list-models tool for runtime model discovery (no stale model lists)
  • reasoning_effort parameter (--reasoning-effort)
  • Server instructions in the MCP initialize result guide clients on usage
  • Codex-style sandbox levels (read-only / workspace-write / danger-full-access)
  • System prompt injection (system_prompt / append_system_prompt)
  • Working directory, model, permission mode, output format control
  • Session resume (resume_session_id) for multi-turn delegation
  • Timeout protection with SIGKILL fallback
  • Proxy quota support (HTTP_PROXY / HTTPS_PROXY injection)
  • Zero build step — plain ESM JavaScript, Node.js >= 18

Prerequisites

  1. Node.js >= 18
  2. qodercli installed and signed in (qodercli login)

Install

Option A — npx (recommended): no clone needed, the MCP client downloads the package on first use.

json
"command": "npx", "args": ["-y", "qodercli-mcp"]

Option B — from source (for development):

bash
git clone https://github.com/cantbeblank96/qodercli-mcp.gitcd qodercli-mcpnpm install

MCP client configuration

Qoder IDE

Add to ~/.qoder/mcp.json. Prefer the absolute path of node and set QODERCLI_PATH explicitly (nvm-managed binaries are often missing from the PATH seen by MCP child processes):

Proxy Support: To use your Qoder CLI proxy quota, add HTTP_PROXY and/or HTTPS_PROXY to the server's environment. When these are set at the MCP server level, they will be passed to all qodercli subprocesses.

json
{  "mcpServers": {    "qodercli-mcp": {      "command": "npx",      "args": ["-y", "qodercli-mcp"],      "env": {        "QODERCLI_PATH": "/absolute/path/to/qodercli",        "PATH": "/usr/local/bin:/usr/bin:/bin"      }    },    "qodercli-mcp-with-proxy": {      "command": "npx",      "args": ["-y", "qodercli-mcp"],      "env": {        "QODERCLI_PATH": "/absolute/path/to/qodercli",        "HTTP_PROXY": "http://127.0.0.1:39900",        "HTTPS_PROXY": "http://127.0.0.1:39900",        "PATH": "/usr/local/bin:/usr/bin:/bin"      }    }  }}

Developers running a local checkout instead of the published package (Option B) should replace command/args with the absolute node path and /path/to/qodercli-mcp/src/index.js (nvm-managed node is often missing from the PATH seen by MCP child processes).

Claude Code / Claude Desktop

json
{  "mcpServers": {    "qodercli-mcp": {      "command": "node",      "args": ["/absolute/path/to/qodercli-mcp/src/index.js"],      "env": {        "QODERCLI_PATH": "/absolute/path/to/qodercli"      }    }  }}

Tool: ask-qoder

ParameterTypeDescription
promptstring (required)The task or question for qodercli
cwdstringWorking directory
modelstringModel for this session; call list-models to discover available names
reasoning_effortstringReasoning effort level (--reasoning-effort), e.g. low/medium/high; depends on the model
permission_modeenumdont_ask (default, read-only) | accept_edits (auto-approve file edits) | bypass_permissions (full access incl. shell) | auto | default; mutually exclusive with approval_policy, prefer sandbox
approval_policyenumcodex-style: untrusted→read-only | on-request→auto | never→full access
sandboxenumread-only | workspace-write | danger-full-access (codex-style; controls the effective permission mode)
system_promptstringReplace the default system prompt
append_system_promptstringAppend instructions to the default system prompt
resume_session_idstringResume a previous session
output_formatstringPassed to -o (default json). Note: non-json formats degrade structured output (session_id etc. become unavailable)
extra_argsstring[]Raw CLI args appended before the prompt; reserved flags (permission mode, system prompt, model, -o, -r, -w...) are rejected
timeout_msnumberTimeout in ms, default 600000

Structured output

ask-qoder declares an MCP outputSchema and returns, in addition to the human-readable text, a structuredContent object:

json
{  "session_id": "77826b5c-...",   // pass back as resume_session_id  "content": "OK",  "is_error": false,  "exit_code": 0,  "duration_ms": 1280,  "total_credits": 0.53,  "num_turns": 1,  "timed_out": false,  "truncated": false}

Sandbox mapping

sandboxEffective permission modeEffect on qodercli
(omitted)dont_askRead-only: permission-requiring tools are silently denied
read-onlydont_askPlus --disallowed-tools write_file,replace,run_shell_command as defense in depth
workspace-writeaccept_editsAgent can create/modify files in cwd
danger-full-accessbypass_permissionsFull access including shell

Explicit permission_mode or approval_policy always wins over sandbox.

Permission modes (verified semantics)

ModeBehavior
dont_askRead-only: silently denies every tool call that requires permission. Headless-safe default
accept_editsAuto-approves file edits; shell still governed by policy
bypass_permissionsAuto-approves everything including shell
autoqodercli's own automatic policy
defaultInteractive confirmation — not headless-friendly, avoid in MCP calls

Tool: list-sessions

Lists local qodercli sessions (index, summary, session id) so a client can pick a resume_session_id. Takes no arguments.

Tool: list-models

Lists models currently supported by qodercli (via --list-models), so a client can pick a valid model value at runtime instead of relying on stale knowledge. Returns both a text list and a structured models array. Takes no arguments.

Usage Examples

Example 1: Simple code explanation
javascript
{ "name": "ask-qoder", "arguments": {   "prompt": "Explain what main.py does",  "cwd": "/path/to/project",  "timeout_ms": 180000 }}
Example 2: Ask a second opinion
javascript
{ "name": "ask-qoder", "arguments": {   "prompt": "@src/service.py Review this file for security issues and suggest improvements",  "model": "qwen-plus",  "permission_mode": "dont_ask",  "timeout_ms": 300000 }}
Example 3: Multi-turn conversation via resume
javascript
// First call — session_id comes back in structuredContent{ "name": "ask-qoder", "arguments": {  "prompt": "Help me refactor this module to improve readability",  "cwd": "/projects/backend",  "timeout_ms": 300000 }}// Then reuse structuredContent.session_id:{ "name": "ask-qoder", "arguments": {  "prompt": "Now add error handling for database timeouts",  "resume_session_id": "77826b5c-cd6b-4213-b423-d95b4e1deab0"}}// Or discover ids with list-sessions{ "name": "list-sessions", "arguments": {} }
Example 4: Code review with specific focus
javascript
{ "name": "ask-qoder", "arguments": {  "prompt": "Analyze performance bottlenecks in utils.py",  "model": "qwen-max",  "permission_mode": "default",  "output_format": "text",  "timeout_ms": 240000 }}
Example 5: Read-only analysis
javascript
{ "name": "ask-qoder", "arguments": {  "prompt": "Audit this codebase for security issues; do not modify anything",  "cwd": "/workspaces/repo",  "sandbox": "read-only",  "timeout_ms": 300000 }}

read-only disables write/shell tools — good for audits and reviews.

Example 6: Project-wide analysis
javascript
{ "name": "ask-qoder", "arguments": {  "prompt": "Summarize the architecture of this project and identify key modules",  "cwd": "/workspaces/repo",  "timeout_ms": 420000,  "model": "qwen-plus"}}

Best Practices

  1. Specify working directory — Always pass cwd when operating on a specific project
  2. Use timeout protection — For complex prompts, set explicit timeout_ms shorter than 60min
  3. Resume for multi-turn — Chain follow-ups via resume_session_id instead of repeating context
  4. Model selection — Call list-models first to discover currently supported models; larger models are better for deep analysis
  5. Permission mode — The server default is read-only (dont_ask); set QODERCLI_DEFAULT_PERMISSION_MODE=bypass_permissions to make full (YOLO) access the default for personal deployments. Per-call: tasks that must create/modify files need sandbox: "workspace-write"; shell access needs danger-full-access. Do not combine sandbox with an explicit permission_mode (the latter wins)

Environment variables

VariableDefaultDescription
QODERCLI_PATHqodercliPath to the qodercli binary
QODERCLI_TIMEOUT_MS600000Default timeout
QODERCLI_MAX_OUTPUT_MB50Per-call stdout/stderr cap in MB (OOM protection)
QODERCLI_DEFAULT_PERMISSION_MODEdont_askDefault permission mode when the caller omits permission_mode/approval_policy/sandbox; set bypass_permissions for full (YOLO) access
HTTP_PROXY-HTTP proxy URL for qodercli
HTTPS_PROXY-HTTPS proxy URL for qodercli

Development

bash
npm test        # smoke test: protocol handshake + tool invocationnode src/index.js   # run the server manually (stdio)

Disclaimer

This is an unofficial, third-party tool. It is not affiliated with, endorsed, or sponsored by Qoder. Use permission_mode: bypass_permissions with care — delegated prompts may modify files in the target working directory.

Product Hunt Gallery

Main gallery image (1270×760, dark tech theme): ph-gallery.png. Optional demo video can be converted from the GIF (docs/demo.gif).

License

MIT

來源:README.md,提交 c38fccf

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分