mirror of
https://github.com/morluto/rea.git
synced 2026-12-01 11:01:11 +00:00
* test(clients): check configured MCP catalogs in native harnesses * test(opencode): resolve the native CLI in the isolated home * ci(clients): identify native catalog discovery in the job log * test(ci): isolate native clients and preserve registration failures
26 lines
941 B
JavaScript
26 lines
941 B
JavaScript
import { writeFileSync } from "node:fs";
|
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
|
|
// Used in a disposable native client project. Record only this known selector.
|
|
const selection = process.env.REA_MCP_TOOL_FAMILIES;
|
|
const state =
|
|
selection === undefined
|
|
? "absent"
|
|
: selection === "electron,javascript-runtime"
|
|
? "selected"
|
|
: "unexpected";
|
|
const tool = `probe_environment_${state}`;
|
|
const receipt = process.argv[2];
|
|
const server = new McpServer({ name: "rea-environment-probe", version: "1" });
|
|
server.registerTool(
|
|
tool,
|
|
{ description: "Read the configuration test result." },
|
|
() => ({ content: [{ type: "text", text: state }] }),
|
|
);
|
|
server.server.oninitialized = () => {
|
|
if (receipt)
|
|
writeFileSync(receipt, JSON.stringify({ initialized: true, tool }) + "\n");
|
|
};
|
|
await server.connect(new StdioServerTransport());
|