@pxlabz/tasq-mcp 0.1.25 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -117
- package/package.json +8 -28
- package/tasq-mcp.js +5 -0
- package/dist/tasq-mcp.js +0 -32293
- package/examples/smoke-client.ts +0 -101
package/examples/smoke-client.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* The smallest stdio MCP client that exercises the published server: spawn
|
|
4
|
-
* `tasq-mcp`, create a task, read it back, print one JSON line.
|
|
5
|
-
*
|
|
6
|
-
* Driven by `tests/e2e/cli-smoke.sh` criterion 13. Everything it needs comes
|
|
7
|
-
* from the environment the server itself reads, so the shell script sets no
|
|
8
|
-
* flags: TASQ_API_KEY, TASQ_WORKSPACE and TASQ_API_URL.
|
|
9
|
-
*
|
|
10
|
-
* TASQ_MCP_BIN=packages/mcp/dist/tasq-mcp.js \
|
|
11
|
-
* TASQ_API_KEY=… TASQ_WORKSPACE=… TASQ_API_URL=… \
|
|
12
|
-
* bun packages/mcp/examples/smoke-client.ts "Task title" ENG
|
|
13
|
-
*/
|
|
14
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
15
|
-
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
16
|
-
|
|
17
|
-
type CallResult = {
|
|
18
|
-
content?: { type: string; text?: string }[];
|
|
19
|
-
isError?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
function textOf(result: CallResult): string {
|
|
23
|
-
return (result.content ?? []).map((part) => part.text ?? "").join("\n");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const title = process.argv[2] ?? "mcp smoke task";
|
|
27
|
-
|
|
28
|
-
const team = process.argv[3] ?? "ENG";
|
|
29
|
-
|
|
30
|
-
const bin = process.env.TASQ_MCP_BIN ?? "dist/tasq-mcp.js";
|
|
31
|
-
|
|
32
|
-
const transport = new StdioClientTransport({
|
|
33
|
-
command: "node",
|
|
34
|
-
args: [bin],
|
|
35
|
-
// The server reads its config from its own environment, exactly as a
|
|
36
|
-
// harness would hand it over.
|
|
37
|
-
env: {
|
|
38
|
-
PATH: process.env.PATH ?? "",
|
|
39
|
-
TASQ_API_KEY: process.env.TASQ_API_KEY ?? "",
|
|
40
|
-
TASQ_WORKSPACE: process.env.TASQ_WORKSPACE ?? "",
|
|
41
|
-
TASQ_API_URL: process.env.TASQ_API_URL ?? "",
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const client = new Client({ name: "tasq-mcp-smoke", version: "0.1.0" });
|
|
46
|
-
|
|
47
|
-
await client.connect(transport);
|
|
48
|
-
|
|
49
|
-
const tools = (await client.listTools()).tools.map((tool) => tool.name);
|
|
50
|
-
|
|
51
|
-
const created = (await client.callTool({
|
|
52
|
-
name: "task_create",
|
|
53
|
-
arguments: { title, team },
|
|
54
|
-
})) as CallResult;
|
|
55
|
-
|
|
56
|
-
if (created.isError === true) {
|
|
57
|
-
console.log(
|
|
58
|
-
JSON.stringify({
|
|
59
|
-
ok: false,
|
|
60
|
-
step: "task_create",
|
|
61
|
-
toolCount: tools.length,
|
|
62
|
-
error: textOf(created),
|
|
63
|
-
}),
|
|
64
|
-
);
|
|
65
|
-
await client.close();
|
|
66
|
-
process.exit(1);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const identifier = (JSON.parse(textOf(created)) as { identifier?: string })
|
|
70
|
-
.identifier;
|
|
71
|
-
|
|
72
|
-
const viewed = (await client.callTool({
|
|
73
|
-
name: "task_view",
|
|
74
|
-
arguments: { id: identifier },
|
|
75
|
-
})) as CallResult;
|
|
76
|
-
|
|
77
|
-
if (viewed.isError === true) {
|
|
78
|
-
console.log(
|
|
79
|
-
JSON.stringify({
|
|
80
|
-
ok: false,
|
|
81
|
-
step: "task_view",
|
|
82
|
-
toolCount: tools.length,
|
|
83
|
-
error: textOf(viewed),
|
|
84
|
-
}),
|
|
85
|
-
);
|
|
86
|
-
await client.close();
|
|
87
|
-
process.exit(1);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const task = JSON.parse(textOf(viewed)) as { identifier: string; title: string };
|
|
91
|
-
|
|
92
|
-
console.log(
|
|
93
|
-
JSON.stringify({
|
|
94
|
-
ok: task.title === title,
|
|
95
|
-
toolCount: tools.length,
|
|
96
|
-
identifier: task.identifier,
|
|
97
|
-
title: task.title,
|
|
98
|
-
}),
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
await client.close();
|