23 lines
1.1 KiB
JavaScript
23 lines
1.1 KiB
JavaScript
// Stdio handshake smoke test for gitea-mcp.exe: spawn it over stdio pointing
|
|
// at gitea.mymoyu.top, list tools, call the read-only get_me tool. Because the
|
|
// dsh sandbox denies spawning processes with piped stdio (documented EPERM),
|
|
// this script must be run by the harness outside that boundary — the running
|
|
// dsh web process — or skipped in favor of the bridge's own live verification.
|
|
import { Client } from "file:///C:/Users/12914/.dsh/profiles/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js";
|
|
import { StdioClientTransport } from "file:///C:/Users/12914/.dsh/profiles/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js";
|
|
|
|
const exe = "C:\\Users\\12914\\.dsh\\bin\\gitea-mcp\\gitea-mcp.exe";
|
|
const transport = new StdioClientTransport({
|
|
command: exe,
|
|
args: ["-t", "stdio", "-H", "https://gitea.mymoyu.top"]
|
|
});
|
|
const client = new Client({ name: "smoke", version: "0.0.1" });
|
|
await client.connect(transport);
|
|
|
|
const tools = await client.listTools();
|
|
const names = tools.tools.map((t) => t.name);
|
|
console.log(JSON.stringify({ toolCount: names.length, sample: names.slice(0, 8) }));
|
|
|
|
await client.close();
|
|
process.exit(0);
|