Initial commit: qwen delegation MCP server, tracker setup, research
- qwen_delegate MCP tool: src/qwen-delegate.ts (testable core, subprocess spawn/timeout/parse) + src/qwen-delegate-server.ts (thin MCP stdio wiring) - test/qwen-delegate.test.ts (node:test, mocked spawn) - docs/agents/* + CLAUDE.md from /setup-matt-pocock-skills (Gitea issue tracker via tea CLI, default triage labels, single-context domain docs) - research/qwen-mcp-delegation.md, corrected after confirming qwen-code runs natively on Windows (no WSL) against a local OpenAI-compatible proxy Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CRnb5Gqdu7gVTQrwAqFdfJ
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env node
|
||||
// MCP stdio server exposing a single tool, qwen_delegate, that runs a prompt through the
|
||||
// local qwen-code CLI (see research/qwen-mcp-delegation.md). Register globally with:
|
||||
// claude mcp add --scope user qwen-delegate -- node <path-to-this-file>
|
||||
|
||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
||||
import { z } from "zod";
|
||||
import { delegateToQwen } from "./qwen-delegate.ts";
|
||||
|
||||
const server = new McpServer({ name: "qwen-delegate", version: "0.1.0" });
|
||||
|
||||
server.registerTool(
|
||||
"qwen_delegate",
|
||||
{
|
||||
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.",
|
||||
inputSchema: {
|
||||
prompt: z.string().describe("The prompt to send to qwen, non-interactively."),
|
||||
},
|
||||
},
|
||||
async ({ prompt }) => {
|
||||
const result = await delegateToQwen(prompt);
|
||||
return {
|
||||
content: [{ type: "text", text: result.output }],
|
||||
isError: !result.ok,
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
await server.connect(new StdioServerTransport());
|
||||
Reference in New Issue
Block a user