





















@@ -1,4 +1,5 @@
11import fs from "node:fs/promises";
2+import { createRequire } from "node:module";
23import path from "node:path";
34import { Client } from "@modelcontextprotocol/sdk/client/index.js";
45import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
@@ -11,6 +12,8 @@ import type {
1112QaTransportActionName,
1213} from "./suite-runtime-types.js";
131415+const requireFromHere = createRequire(import.meta.url);
16+1417function findSkill(skills: QaSkillStatusEntry[], name: string) {
1518return skills.find((skill) => skill.name === name);
1619}
@@ -28,7 +31,7 @@ async function writeWorkspaceSkill(params: {
2831}
29323033async function callPluginToolsMcp(params: {
31-env: Pick<QaSuiteRuntimeEnv, "gateway">;
34+env: Pick<QaSuiteRuntimeEnv, "gateway" | "repoRoot">;
3235toolName: string;
3336args: Record<string, unknown>;
3437}) {
@@ -40,8 +43,13 @@ async function callPluginToolsMcp(params: {
4043const nodeExecPath = await resolveQaNodeExecPath();
4144const transport = new StdioClientTransport({
4245command: nodeExecPath,
43-args: ["--import", "tsx", "src/mcp/plugin-tools-serve.ts"],
46+args: [
47+"--import",
48+requireFromHere.resolve("tsx"),
49+path.join(params.env.repoRoot, "src/mcp/plugin-tools-serve.ts"),
50+],
4451stderr: "pipe",
52+cwd: params.env.gateway.tempRoot,
4553env: transportEnv,
4654});
4755const client = new Client({ name: "openclaw-qa-suite", version: "0.0.0" }, {});
@@ -50,7 +58,13 @@ async function callPluginToolsMcp(params: {
5058const listed = await client.listTools();
5159const tool = listed.tools.find((entry) => entry.name === params.toolName);
5260if (!tool) {
53-throw new Error(`MCP tool missing: ${params.toolName}`);
61+const availableTools = listed.tools
62+.map((entry) => entry.name)
63+.filter((name): name is string => typeof name === "string" && name.length > 0)
64+.toSorted();
65+throw new Error(
66+`MCP tool missing: ${params.toolName}; available tools: ${availableTools.join(", ") || "<none>"}`,
67+);
5468}
5569return await client.callTool({
5670name: params.toolName,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。