@testingbot/mcp-server 1.0.0 → 1.0.1
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 +2 -3
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +18 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/constants.d.ts +32 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +32 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/error.d.ts +14 -0
- package/dist/lib/error.d.ts.map +1 -0
- package/dist/lib/error.js +27 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/get-auth.d.ts +6 -0
- package/dist/lib/get-auth.d.ts.map +1 -0
- package/dist/lib/get-auth.js +7 -0
- package/dist/lib/get-auth.js.map +1 -0
- package/dist/lib/logger.d.ts +4 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +51 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/types.d.ts +64 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +12 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +40 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/server-factory.d.ts +19 -0
- package/dist/server-factory.d.ts.map +1 -0
- package/dist/server-factory.js +98 -0
- package/dist/server-factory.js.map +1 -0
- package/dist/tools/browsers.d.ts +3 -0
- package/dist/tools/browsers.d.ts.map +1 -0
- package/dist/tools/browsers.js +73 -0
- package/dist/tools/browsers.js.map +1 -0
- package/dist/tools/builds.d.ts +3 -0
- package/dist/tools/builds.d.ts.map +1 -0
- package/dist/tools/builds.js +115 -0
- package/dist/tools/builds.js.map +1 -0
- package/dist/tools/cdp.d.ts +3 -0
- package/dist/tools/cdp.d.ts.map +1 -0
- package/dist/tools/cdp.js +78 -0
- package/dist/tools/cdp.js.map +1 -0
- package/dist/tools/live.d.ts +3 -0
- package/dist/tools/live.d.ts.map +1 -0
- package/dist/tools/live.js +221 -0
- package/dist/tools/live.js.map +1 -0
- package/dist/tools/screenshots.d.ts +3 -0
- package/dist/tools/screenshots.d.ts.map +1 -0
- package/dist/tools/screenshots.js +132 -0
- package/dist/tools/screenshots.js.map +1 -0
- package/dist/tools/storage.d.ts +3 -0
- package/dist/tools/storage.d.ts.map +1 -0
- package/dist/tools/storage.js +114 -0
- package/dist/tools/storage.js.map +1 -0
- package/dist/tools/team.d.ts +3 -0
- package/dist/tools/team.d.ts.map +1 -0
- package/dist/tools/team.js +171 -0
- package/dist/tools/team.js.map +1 -0
- package/dist/tools/tests.d.ts +3 -0
- package/dist/tools/tests.d.ts.map +1 -0
- package/dist/tools/tests.js +307 -0
- package/dist/tools/tests.js.map +1 -0
- package/dist/tools/tunnels.d.ts +3 -0
- package/dist/tools/tunnels.d.ts.map +1 -0
- package/dist/tools/tunnels.js +74 -0
- package/dist/tools/tunnels.js.map +1 -0
- package/dist/tools/user.d.ts +3 -0
- package/dist/tools/user.d.ts.map +1 -0
- package/dist/tools/user.js +65 -0
- package/dist/tools/user.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleMCPError, validateUrl } from "../lib/utils.js";
|
|
3
|
+
import logger from "../lib/logger.js";
|
|
4
|
+
export default function addScreenshotTools(server, testingBotApi, _config) {
|
|
5
|
+
const tools = {};
|
|
6
|
+
tools.takeScreenshot = server.tool("takeScreenshot", "Take screenshots of a URL across multiple browsers and platforms. Returns a screenshot ID to retrieve results.", {
|
|
7
|
+
url: z.string().url().describe("The URL to screenshot"),
|
|
8
|
+
browsers: z
|
|
9
|
+
.array(z.object({
|
|
10
|
+
browserName: z.string().describe("Browser name (chrome, firefox, safari, etc.)"),
|
|
11
|
+
version: z.string().optional().describe("Browser version (or 'latest')"),
|
|
12
|
+
os: z.string().describe("Operating system (WIN11, MAC, etc.)"),
|
|
13
|
+
}))
|
|
14
|
+
.describe("Array of browser configurations"),
|
|
15
|
+
resolution: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.default("1920x1080")
|
|
19
|
+
.describe("Screen resolution (e.g., '1920x1080')"),
|
|
20
|
+
waitTime: z
|
|
21
|
+
.union([z.number(), z.string().transform(Number)])
|
|
22
|
+
.pipe(z.number().min(0).max(60))
|
|
23
|
+
.optional()
|
|
24
|
+
.default(5)
|
|
25
|
+
.describe("Time to wait before taking screenshot (in seconds, max 60)"),
|
|
26
|
+
fullPage: z
|
|
27
|
+
.union([z.boolean(), z.string().transform((s) => s === "true")])
|
|
28
|
+
.pipe(z.boolean())
|
|
29
|
+
.optional()
|
|
30
|
+
.default(false)
|
|
31
|
+
.describe("Capture full page or just viewport"),
|
|
32
|
+
}, async (args) => {
|
|
33
|
+
try {
|
|
34
|
+
if (!validateUrl(args.url)) {
|
|
35
|
+
throw new Error("Invalid URL provided");
|
|
36
|
+
}
|
|
37
|
+
logger.info({ url: args.url, browsers: args.browsers.length }, "Taking screenshots");
|
|
38
|
+
const result = await testingBotApi.takeScreenshot(args.url, args.browsers, args.resolution, args.waitTime, args.fullPage);
|
|
39
|
+
return {
|
|
40
|
+
content: [
|
|
41
|
+
{
|
|
42
|
+
type: "text",
|
|
43
|
+
text: `Screenshot job created successfully!\n\n**Screenshot ID**: ${result.id}\n\nUse the \`retrieveScreenshots\` tool with this ID to get the results once processing is complete.`,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return handleMCPError("takeScreenshot", error);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
tools.retrieveScreenshots = server.tool("retrieveScreenshots", "Retrieve screenshot results by screenshot ID. Returns URLs to the generated screenshots.", {
|
|
53
|
+
screenshotId: z.string().describe("The screenshot ID from takeScreenshot"),
|
|
54
|
+
}, async (args) => {
|
|
55
|
+
try {
|
|
56
|
+
logger.info({ screenshotId: args.screenshotId }, "Retrieving screenshots");
|
|
57
|
+
const result = await testingBotApi.retrieveScreenshots(args.screenshotId);
|
|
58
|
+
let formattedOutput = `## Screenshots for ${result.url}\n\n`;
|
|
59
|
+
formattedOutput += `**Status**: ${result.state || "processing"}\n\n`;
|
|
60
|
+
if (result.screenshots && Array.isArray(result.screenshots)) {
|
|
61
|
+
result.screenshots.forEach((screenshot) => {
|
|
62
|
+
formattedOutput += `### ${screenshot.browser} ${screenshot.version} on ${screenshot.os}\n`;
|
|
63
|
+
formattedOutput += `- **Screenshot**: ${screenshot.image_url}\n`;
|
|
64
|
+
formattedOutput += `- **Thumbnail**: ${screenshot.thumb_url}\n`;
|
|
65
|
+
formattedOutput += "\n";
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
formattedOutput += "Screenshots are still processing. Please try again in a moment.\n";
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: "text",
|
|
75
|
+
text: formattedOutput,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return handleMCPError("retrieveScreenshots", error);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
tools.getScreenshotList = server.tool("getScreenshotList", "Get a list of all screenshot jobs with pagination.", {
|
|
85
|
+
offset: z
|
|
86
|
+
.union([z.number(), z.string().transform(Number)])
|
|
87
|
+
.pipe(z.number().min(0))
|
|
88
|
+
.optional()
|
|
89
|
+
.default(0)
|
|
90
|
+
.describe("Offset for pagination (default: 0)"),
|
|
91
|
+
limit: z
|
|
92
|
+
.union([z.number(), z.string().transform(Number)])
|
|
93
|
+
.pipe(z.number().min(1).max(100))
|
|
94
|
+
.optional()
|
|
95
|
+
.default(10)
|
|
96
|
+
.describe("Number of screenshot jobs to retrieve (default: 10, max: 100)"),
|
|
97
|
+
}, async (args) => {
|
|
98
|
+
try {
|
|
99
|
+
const offset = Number(args.offset ?? 0);
|
|
100
|
+
const limit = Number(args.limit ?? 10);
|
|
101
|
+
logger.info({ offset, limit }, "Fetching screenshot list");
|
|
102
|
+
const response = await testingBotApi.getScreenshotList(offset, limit);
|
|
103
|
+
const screenshots = response?.data || [];
|
|
104
|
+
let formattedOutput = `## Screenshot Jobs (showing ${limit} from offset ${offset})\n\n`;
|
|
105
|
+
if (screenshots.length > 0) {
|
|
106
|
+
screenshots.forEach((screenshot) => {
|
|
107
|
+
formattedOutput += `### ${screenshot.url}\n`;
|
|
108
|
+
formattedOutput += `- **ID**: ${screenshot.id}\n`;
|
|
109
|
+
formattedOutput += `- **Status**: ${screenshot.state || "processing"}\n`;
|
|
110
|
+
formattedOutput += `- **Created**: ${screenshot.created_at}\n`;
|
|
111
|
+
formattedOutput += "\n";
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
formattedOutput += "No screenshot jobs found.\n";
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
content: [
|
|
119
|
+
{
|
|
120
|
+
type: "text",
|
|
121
|
+
text: formattedOutput,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
return handleMCPError("getScreenshotList", error);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return tools;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=screenshots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../src/tools/screenshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,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AAE;oBACtC,eAAe,IAAI,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;oBAC7C,eAAe,IAAI,aAAa,UAAU,CAAC,EAAE,IAAI,CAAC;oBAClD,eAAe,IAAI,iBAAiB,UAAU,CAAC,KAAK,IAAI,YAAY,IAAI,CAAC;oBACzE,eAAe,IAAI,kBAAkB,UAAU,CAAC,UAAU,IAAI,CAAC;oBAC/D,eAAe,IAAI,IAAI,CAAC;gBAC1B,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,eAAe,IAAI,6BAA6B,CAAC;YACnD,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,eAAe;qBACtB;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,cAAc,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/tools/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,MAAM,EAAE,GAAG,EACX,aAAa,EAAE,GAAG,EAClB,OAAO,EAAE,gBAAgB,uBA8I1B"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleMCPError, validateUrl } from "../lib/utils.js";
|
|
3
|
+
import logger from "../lib/logger.js";
|
|
4
|
+
export default function addStorageTools(server, testingBotApi, _config) {
|
|
5
|
+
const tools = {};
|
|
6
|
+
tools.uploadFile = server.tool("uploadFile", "Upload a local file (APK, IPA, or ZIP) to TestingBot storage for mobile app testing. Returns an app_url for use in tests.", {
|
|
7
|
+
localFilePath: z.string().describe("Local path to the file to upload"),
|
|
8
|
+
}, async (args) => {
|
|
9
|
+
try {
|
|
10
|
+
logger.info({ path: args.localFilePath }, "Uploading file");
|
|
11
|
+
const result = await testingBotApi.uploadFile(args.localFilePath);
|
|
12
|
+
return {
|
|
13
|
+
content: [
|
|
14
|
+
{
|
|
15
|
+
type: "text",
|
|
16
|
+
text: `File uploaded successfully!\n\n**App URL**: ${result.app_url}\n\nUse this URL in your test capabilities.`,
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return handleMCPError("uploadFile", error);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
tools.uploadRemoteFile = server.tool("uploadRemoteFile", "Upload a file from a remote URL to TestingBot storage. The file will be downloaded from the URL and stored.", {
|
|
26
|
+
remoteUrl: z.string().url().describe("Remote URL of the file to upload"),
|
|
27
|
+
}, async (args) => {
|
|
28
|
+
try {
|
|
29
|
+
if (!validateUrl(args.remoteUrl)) {
|
|
30
|
+
throw new Error("Invalid URL provided");
|
|
31
|
+
}
|
|
32
|
+
logger.info({ url: args.remoteUrl }, "Uploading remote file");
|
|
33
|
+
const result = await testingBotApi.uploadRemoteFile(args.remoteUrl);
|
|
34
|
+
return {
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: "text",
|
|
38
|
+
text: `Remote file uploaded successfully!\n\n**App URL**: ${result.app_url}\n\nUse this URL in your test capabilities.`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
return handleMCPError("uploadRemoteFile", error);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
tools.getStorageFiles = server.tool("getStorageFiles", "List all files in TestingBot storage with pagination.", {
|
|
48
|
+
offset: z
|
|
49
|
+
.union([z.number(), z.string().transform(Number)])
|
|
50
|
+
.pipe(z.number().min(0))
|
|
51
|
+
.optional()
|
|
52
|
+
.default(0)
|
|
53
|
+
.describe("Offset for pagination (default: 0)"),
|
|
54
|
+
limit: z
|
|
55
|
+
.union([z.number(), z.string().transform(Number)])
|
|
56
|
+
.pipe(z.number().min(1).max(100))
|
|
57
|
+
.optional()
|
|
58
|
+
.default(10)
|
|
59
|
+
.describe("Number of files to retrieve (default: 10, max: 100)"),
|
|
60
|
+
}, async (args) => {
|
|
61
|
+
try {
|
|
62
|
+
const offset = Number(args.offset ?? 0);
|
|
63
|
+
const limit = Number(args.limit ?? 10);
|
|
64
|
+
logger.info({ offset, limit }, "Fetching storage files");
|
|
65
|
+
const response = await testingBotApi.getStorageFiles(offset, limit);
|
|
66
|
+
const files = response?.data || [];
|
|
67
|
+
let formattedOutput = `## Storage Files (showing ${limit} from offset ${offset})\n\n`;
|
|
68
|
+
if (files.length > 0) {
|
|
69
|
+
files.forEach((file) => {
|
|
70
|
+
formattedOutput += `### ${file.name}\n`;
|
|
71
|
+
formattedOutput += `- **App URL**: ${file.app_url}\n`;
|
|
72
|
+
formattedOutput += `- **Size**: ${(file.size / 1024 / 1024).toFixed(2)} MB\n`;
|
|
73
|
+
formattedOutput += `- **Uploaded**: ${file.uploaded_at}\n`;
|
|
74
|
+
formattedOutput += "\n";
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
formattedOutput += "No files found in storage.\n";
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: "text",
|
|
84
|
+
text: formattedOutput,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
return handleMCPError("getStorageFiles", error);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
tools.deleteStorageFile = server.tool("deleteStorageFile", "Delete a file from TestingBot storage using its app_url.", {
|
|
94
|
+
appUrl: z.string().describe("The app_url of the file to delete"),
|
|
95
|
+
}, async (args) => {
|
|
96
|
+
try {
|
|
97
|
+
logger.info({ appUrl: args.appUrl }, "Deleting storage file");
|
|
98
|
+
await testingBotApi.deleteStorageFile(args.appUrl);
|
|
99
|
+
return {
|
|
100
|
+
content: [
|
|
101
|
+
{
|
|
102
|
+
type: "text",
|
|
103
|
+
text: `File deleted successfully from storage.`,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
return handleMCPError("deleteStorageFile", error);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return tools;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/tools/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,MAAW,EACX,aAAkB,EAClB,OAAyB;IAEzB,MAAM,KAAK,GAAwB,EAAE,CAAC;IAEtC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAC5B,YAAY,EACZ,2HAA2H,EAC3H;QACE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KACvE,EACD,KAAK,EAAE,IAA+B,EAAE,EAAE;QACxC,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,gBAAgB,CAAC,CAAC;YAE5D,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAElE,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,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KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../src/tools/team.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,uBAuM9F"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleMCPError } from "../lib/utils.js";
|
|
3
|
+
import logger from "../lib/logger.js";
|
|
4
|
+
export default function addTeamTools(server, testingBotApi, _config) {
|
|
5
|
+
const tools = {};
|
|
6
|
+
tools.getTeam = server.tool("getTeam", "Retrieve team settings and information including plan details, team size, and configuration.", {}, async () => {
|
|
7
|
+
try {
|
|
8
|
+
logger.info("Fetching team settings");
|
|
9
|
+
const response = await testingBotApi.getTeam();
|
|
10
|
+
const team = response?.data || response;
|
|
11
|
+
let formattedOutput = `## Team Settings\n\n`;
|
|
12
|
+
if (team.name) {
|
|
13
|
+
formattedOutput += `- **Team Name**: ${team.name}\n`;
|
|
14
|
+
}
|
|
15
|
+
if (team.plan) {
|
|
16
|
+
formattedOutput += `- **Plan**: ${team.plan}\n`;
|
|
17
|
+
}
|
|
18
|
+
if (team.users !== undefined) {
|
|
19
|
+
formattedOutput += `- **Users**: ${team.users}\n`;
|
|
20
|
+
}
|
|
21
|
+
if (team.parallel_tests !== undefined) {
|
|
22
|
+
formattedOutput += `- **Parallel Tests**: ${team.parallel_tests}\n`;
|
|
23
|
+
}
|
|
24
|
+
if (team.max_parallel !== undefined) {
|
|
25
|
+
formattedOutput += `- **Max Parallel**: ${team.max_parallel}\n`;
|
|
26
|
+
}
|
|
27
|
+
// Concurrency information
|
|
28
|
+
if (team.concurrency) {
|
|
29
|
+
formattedOutput += `\n### Concurrency\n`;
|
|
30
|
+
if (team.concurrency.allowed) {
|
|
31
|
+
formattedOutput += `**Allowed**:\n`;
|
|
32
|
+
if (team.concurrency.allowed.vms !== undefined) {
|
|
33
|
+
formattedOutput += `- VMs: ${team.concurrency.allowed.vms}\n`;
|
|
34
|
+
}
|
|
35
|
+
if (team.concurrency.allowed.physical !== undefined) {
|
|
36
|
+
formattedOutput += `- Physical: ${team.concurrency.allowed.physical}\n`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (team.concurrency.current) {
|
|
40
|
+
formattedOutput += `**Current**:\n`;
|
|
41
|
+
if (team.concurrency.current.vms !== undefined) {
|
|
42
|
+
formattedOutput += `- VMs: ${team.concurrency.current.vms}\n`;
|
|
43
|
+
}
|
|
44
|
+
if (team.concurrency.current.physical !== undefined) {
|
|
45
|
+
formattedOutput += `- Physical: ${team.concurrency.current.physical}\n`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (team.created_at) {
|
|
50
|
+
formattedOutput += `\n- **Created**: ${team.created_at}\n`;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
content: [
|
|
54
|
+
{
|
|
55
|
+
type: "text",
|
|
56
|
+
text: formattedOutput,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
return handleMCPError("getTeam", error);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
tools.getUsersInTeam = server.tool("getUsersInTeam", "Get a list of all users in your team with their roles and permissions.", {}, async () => {
|
|
66
|
+
try {
|
|
67
|
+
logger.info("Fetching team users");
|
|
68
|
+
const response = await testingBotApi.getUsersInTeam();
|
|
69
|
+
const users = response?.data || (Array.isArray(response) ? response : []);
|
|
70
|
+
let formattedOutput = `## Team Users\n\n`;
|
|
71
|
+
if (users.length > 0) {
|
|
72
|
+
users.forEach((user) => {
|
|
73
|
+
const fullName = `${user.first_name || ""} ${user.last_name || ""}`.trim();
|
|
74
|
+
formattedOutput += `### ${fullName || `User ${user.id}`}\n`;
|
|
75
|
+
formattedOutput += `- **User ID**: ${user.id}\n`;
|
|
76
|
+
if (user.email) {
|
|
77
|
+
formattedOutput += `- **Email**: ${user.email}\n`;
|
|
78
|
+
}
|
|
79
|
+
if (user.plan) {
|
|
80
|
+
formattedOutput += `- **Plan**: ${user.plan}\n`;
|
|
81
|
+
}
|
|
82
|
+
if (user.roles && Array.isArray(user.roles) && user.roles.length > 0) {
|
|
83
|
+
formattedOutput += `- **Roles**: ${user.roles.join(", ")}\n`;
|
|
84
|
+
}
|
|
85
|
+
if (user.read_only !== undefined) {
|
|
86
|
+
formattedOutput += `- **Read Only**: ${user.read_only ? "Yes" : "No"}\n`;
|
|
87
|
+
}
|
|
88
|
+
if (user.max_concurrent !== undefined) {
|
|
89
|
+
formattedOutput += `- **Max Concurrent**: ${user.max_concurrent}\n`;
|
|
90
|
+
}
|
|
91
|
+
if (user.max_concurrent_mobile !== undefined) {
|
|
92
|
+
formattedOutput += `- **Max Concurrent Mobile**: ${user.max_concurrent_mobile}\n`;
|
|
93
|
+
}
|
|
94
|
+
if (user.seconds !== undefined) {
|
|
95
|
+
formattedOutput += `- **Seconds**: ${user.seconds}\n`;
|
|
96
|
+
}
|
|
97
|
+
if (user.last_login) {
|
|
98
|
+
formattedOutput += `- **Last Login**: ${user.last_login}\n`;
|
|
99
|
+
}
|
|
100
|
+
if (user.current_vm_concurrency !== undefined) {
|
|
101
|
+
formattedOutput += `- **Current VM Concurrency**: ${user.current_vm_concurrency}\n`;
|
|
102
|
+
}
|
|
103
|
+
if (user.current_physical_concurrency !== undefined) {
|
|
104
|
+
formattedOutput += `- **Current Physical Concurrency**: ${user.current_physical_concurrency}\n`;
|
|
105
|
+
}
|
|
106
|
+
formattedOutput += "\n";
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
formattedOutput += "No users found in team.\n";
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{
|
|
115
|
+
type: "text",
|
|
116
|
+
text: formattedOutput,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
return handleMCPError("getUsersInTeam", error);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
tools.getUserFromTeam = server.tool("getUserFromTeam", "Retrieve detailed information about a specific user in your team by their user ID.", {
|
|
126
|
+
userId: z
|
|
127
|
+
.union([z.number(), z.string().transform(Number)])
|
|
128
|
+
.pipe(z.number())
|
|
129
|
+
.describe("The user ID"),
|
|
130
|
+
}, async (args) => {
|
|
131
|
+
try {
|
|
132
|
+
const userId = Number(args.userId);
|
|
133
|
+
logger.info({ userId }, "Fetching team user details");
|
|
134
|
+
const user = await testingBotApi.getUserFromTeam(userId);
|
|
135
|
+
let formattedOutput = `## User Details: ${user.first_name || ""} ${user.last_name || ""}\n\n`;
|
|
136
|
+
formattedOutput += `- **User ID**: ${user.id}\n`;
|
|
137
|
+
formattedOutput += `- **Email**: ${user.email}\n`;
|
|
138
|
+
if (user.first_name) {
|
|
139
|
+
formattedOutput += `- **First Name**: ${user.first_name}\n`;
|
|
140
|
+
}
|
|
141
|
+
if (user.last_name) {
|
|
142
|
+
formattedOutput += `- **Last Name**: ${user.last_name}\n`;
|
|
143
|
+
}
|
|
144
|
+
if (user.role) {
|
|
145
|
+
formattedOutput += `- **Role**: ${user.role}\n`;
|
|
146
|
+
}
|
|
147
|
+
if (user.active !== undefined) {
|
|
148
|
+
formattedOutput += `- **Active**: ${user.active ? "Yes" : "No"}\n`;
|
|
149
|
+
}
|
|
150
|
+
if (user.created_at) {
|
|
151
|
+
formattedOutput += `- **Joined**: ${user.created_at}\n`;
|
|
152
|
+
}
|
|
153
|
+
if (user.last_login) {
|
|
154
|
+
formattedOutput += `- **Last Login**: ${user.last_login}\n`;
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
content: [
|
|
158
|
+
{
|
|
159
|
+
type: "text",
|
|
160
|
+
text: formattedOutput,
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
return handleMCPError("getUserFromTeam", error);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
return tools;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=team.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/tools/team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAW,EAAE,aAAkB,EAAE,OAAyB;IAC7F,MAAM,KAAK,GAAwB,EAAE,CAAC;IAEtC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CACzB,SAAS,EACT,8FAA8F,EAC9F,EAAE,EACF,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YAEtC,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,CAAC;YAE/C,MAAM,IAAI,GAAG,QAAQ,EAAE,IAAI,IAAI,QAAQ,CAAC;YAExC,IAAI,eAAe,GAAG,sBAAsB,CAAC;YAE7C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,eAAe,IAAI,oBAAoB,IAAI,CAAC,IAAI,IAAI,CAAC;YACvD,CAAC;YACD,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,eAAe,IAAI,eAAe,IAAI,CAAC,IAAI,IAAI,CAAC;YAClD,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CA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