Rewrite README to match locked TS conventions; minor tool/doc tweaks

Reflects the resolved wayfinder map (issue #1): no build process ever,
separate MCP server process + registration per backend, no lint/format
tooling. Also includes small wording tweaks to the qwen_delegate tool
description and timeout comment made outside this session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRnb5Gqdu7gVTQrwAqFdfJ
This commit is contained in:
2026-09-06 18:12:42 +02:00
co-authored by Claude-Bot
parent f3c9016676
commit 061a1f381d
3 changed files with 23 additions and 13 deletions
+19 -9
View File
@@ -1,8 +1,7 @@
# delegate-ai-mcp # delegate-ai-mcp
An MCP server that lets Claude Code delegate light, low-stakes work to a local MCP servers that let Claude Code delegate light, low-stakes work to local AI CLI backends,
[qwen-code](https://github.com/QwenLM/qwen-code) CLI instance, instead of spending its own instead of spending its own budget on it. Currently one backend: qwen-code.
budget on it.
## How it works ## How it works
@@ -17,10 +16,18 @@ was confirmed. Replies can take several minutes on a cold local model, so the to
generous (10 min) timeout rather than trying to enforce "light work" in code — that's a generous (10 min) timeout rather than trying to enforce "light work" in code — that's a
judgment call left to whoever's calling the tool. judgment call left to whoever's calling the tool.
Each backend is its own MCP server process with its own `claude mcp add` registration —
there's no single multi-tool server. Adding a second backend means adding its own
`src/<backend>-delegate.ts` + `src/<backend>-delegate-server.ts` pair and registering it
separately (see Status below — the shared subprocess helper this implies isn't extracted yet).
No build step: everything runs as plain `.ts` source via Node's native TypeScript
type-stripping. No `tsconfig.json`, no `dist/`, no lint/format tooling — deliberate choices,
not oversights (see the wayfinder map linked below).
## Prerequisites ## Prerequisites
- Node.js 24+ (the server runs `.ts` source directly via Node's native TypeScript - Node.js 24+ (native TypeScript type-stripping)
type-stripping — no build step, no compiler)
- `qwen` on `PATH` and working (`qwen -p "test"` should return a reply) - `qwen` on `PATH` and working (`qwen -p "test"` should return a reply)
## Setup ## Setup
@@ -61,9 +68,12 @@ Runs `test/qwen-delegate.test.ts` on Node's built-in test runner (`node --test`)
framework dependency. The subprocess spawn is mocked, so tests run in milliseconds and don't framework dependency. The subprocess spawn is mocked, so tests run in milliseconds and don't
require a live `qwen` install. require a live `qwen` install.
## Status / roadmap ## Status
Project conventions (build/typecheck strategy, lint/format tooling, multi-tool source Project conventions are being worked through a
structure, publish-shaped `package.json`) are being worked through a
[wayfinder map](https://git.arthurerlich.de/haylan/delegate-ai-mcp/issues/1) on this repo's [wayfinder map](https://git.arthurerlich.de/haylan/delegate-ai-mcp/issues/1) on this repo's
issue tracker see `docs/agents/issue-tracker.md` for how issues/tickets work here. issue tracker (see `docs/agents/issue-tracker.md` for how issues/tickets work here). Decided
so far: no build process, ever; separate MCP server process + registration per backend, with a
shared `src/lib/spawn-cli.ts` helper once a second backend exists (not extracted yet — still
just `qwen-delegate.ts`); no lint/format tooling for now. Still open: a publish-shaped
`package.json`.
+1 -2
View File
@@ -16,8 +16,7 @@ server.registerTool(
title: "Delegate to qwen", title: "Delegate to qwen",
description: description:
"Delegate a light, low-stakes prompt (simple lookups, quick research, boilerplate text, " + "Delegate a light, low-stakes prompt (simple lookups, quick research, boilerplate text, " +
"small single-file edits) to the local qwen-code CLI, offloading it from the main session. " + "small single-file edits) to the local qwen-code CLI, offloading it from the main session. ",
"Can take several minutes to respond — only use for work that doesn't block on a fast reply.",
inputSchema: { inputSchema: {
prompt: z.string().describe("The prompt to send to qwen, non-interactively."), prompt: z.string().describe("The prompt to send to qwen, non-interactively."),
}, },
+3 -2
View File
@@ -10,7 +10,8 @@ export interface DelegateResult {
} }
export interface DelegateOptions { export interface DelegateOptions {
/** Milliseconds before giving up. qwen-code has been observed taking 3-6 min for a trivial /** Milliseconds before giving up. qwen-code has been observed taking 3-6 min for a trivial,
* takes time to warm up on the first request,
* prompt against a local model proxy, so default generous — see research/qwen-mcp-delegation.md. */ * prompt against a local model proxy, so default generous — see research/qwen-mcp-delegation.md. */
timeoutMs?: number; timeoutMs?: number;
/** Injectable for tests. Defaults to node:child_process's spawn. */ /** Injectable for tests. Defaults to node:child_process's spawn. */
@@ -24,7 +25,7 @@ const DEFAULT_TIMEOUT_MS = 10 * 60 * 1000; // 10 min
* qwen-code prints startup warnings (e.g. failed MCP sub-servers) to stderr; those are * qwen-code prints startup warnings (e.g. failed MCP sub-servers) to stderr; those are
* ignored on success and surfaced only when the run itself fails. * ignored on success and surfaced only when the run itself fails.
*/ */
export function delegateToQwen( export function delegateToQwen (
prompt: string, prompt: string,
options: DelegateOptions = {}, options: DelegateOptions = {},
): Promise<DelegateResult> { ): Promise<DelegateResult> {