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:
@@ -1,8 +1,7 @@
|
||||
# delegate-ai-mcp
|
||||
|
||||
An MCP server that lets Claude Code delegate light, low-stakes work to a local
|
||||
[qwen-code](https://github.com/QwenLM/qwen-code) CLI instance, instead of spending its own
|
||||
budget on it.
|
||||
MCP servers that let Claude Code delegate light, low-stakes work to local AI CLI backends,
|
||||
instead of spending its own budget on it. Currently one backend: qwen-code.
|
||||
|
||||
## 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
|
||||
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
|
||||
|
||||
- Node.js 24+ (the server runs `.ts` source directly via Node's native TypeScript
|
||||
type-stripping — no build step, no compiler)
|
||||
- Node.js 24+ (native TypeScript type-stripping)
|
||||
- `qwen` on `PATH` and working (`qwen -p "test"` should return a reply)
|
||||
|
||||
## 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
|
||||
require a live `qwen` install.
|
||||
|
||||
## Status / roadmap
|
||||
## Status
|
||||
|
||||
Project conventions (build/typecheck strategy, lint/format tooling, multi-tool source
|
||||
structure, publish-shaped `package.json`) are being worked through a
|
||||
Project conventions are being worked through a
|
||||
[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`.
|
||||
|
||||
@@ -16,8 +16,7 @@ server.registerTool(
|
||||
title: "Delegate to qwen",
|
||||
description:
|
||||
"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. " +
|
||||
"Can take several minutes to respond — only use for work that doesn't block on a fast reply.",
|
||||
"small single-file edits) to the local qwen-code CLI, offloading it from the main session. ",
|
||||
inputSchema: {
|
||||
prompt: z.string().describe("The prompt to send to qwen, non-interactively."),
|
||||
},
|
||||
|
||||
@@ -10,7 +10,8 @@ export interface DelegateResult {
|
||||
}
|
||||
|
||||
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. */
|
||||
timeoutMs?: number;
|
||||
/** 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
|
||||
* ignored on success and surfaced only when the run itself fails.
|
||||
*/
|
||||
export function delegateToQwen(
|
||||
export function delegateToQwen (
|
||||
prompt: string,
|
||||
options: DelegateOptions = {},
|
||||
): Promise<DelegateResult> {
|
||||
|
||||
Reference in New Issue
Block a user