thunderclient-mcp 1.0.2 → 1.0.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAI1D,UAAU,cAAc,CAAC,OAAO,SAAS,SAAS,EAAE,OAAO;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9E;AA8BD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDlB,CAAC;AAEX,eAAO,MAAM,KAAK,EAAE,IAAI,EAIrB,CAAC;AAEJ,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAExB,CAAC;AAEF,eAAO,MAAM,SAAS,EAEjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5B,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtF,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,QAAQ,IAAI,CAAC,CAAC,KAAK,CAChD,CAAC,OAAO,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,OAAO,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAClF,CAAC"}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { zodToMCPInputSchema } from "../utils/schema-converter.js";
|
|
3
|
+
import { resolve } from "path";
|
|
3
4
|
function defineTool(definition) {
|
|
4
5
|
return definition;
|
|
5
6
|
}
|
|
7
|
+
// Debug logging helper
|
|
8
|
+
function debugLog(message, data) {
|
|
9
|
+
// if (process.env.DEBUG || process.env.MCP_DEBUG) {
|
|
10
|
+
console.error(`[MCP-DEBUG] ${message}`, data ? JSON.stringify(data, null, 2) : '');
|
|
11
|
+
// }
|
|
12
|
+
}
|
|
13
|
+
// Helper function to resolve project directory
|
|
14
|
+
function resolveProjectDir(projectDir) {
|
|
15
|
+
debugLog(`Input projectDir: ${projectDir}`);
|
|
16
|
+
if (projectDir === "." || projectDir === "./") {
|
|
17
|
+
const resolved = process.cwd();
|
|
18
|
+
debugLog(`Resolved "." to: ${resolved}`);
|
|
19
|
+
return resolved;
|
|
20
|
+
}
|
|
21
|
+
const resolved = resolve(projectDir);
|
|
22
|
+
debugLog(`Resolved path: ${resolved}`);
|
|
23
|
+
return resolved;
|
|
24
|
+
}
|
|
6
25
|
export const toolDefinitions = {
|
|
7
26
|
thunder_help: defineTool({
|
|
8
27
|
name: "tc_help",
|
|
@@ -10,7 +29,7 @@ export const toolDefinitions = {
|
|
|
10
29
|
schema: z.object({
|
|
11
30
|
projectDir: z.string().min(1, "projectDir is required"),
|
|
12
31
|
}),
|
|
13
|
-
handler: async (client, args) => client.thunder_help(args.projectDir.trim()),
|
|
32
|
+
handler: async (client, args) => client.thunder_help(resolveProjectDir(args.projectDir.trim())),
|
|
14
33
|
}),
|
|
15
34
|
thunder_debug: defineTool({
|
|
16
35
|
name: "tc_debug",
|
|
@@ -18,7 +37,7 @@ export const toolDefinitions = {
|
|
|
18
37
|
schema: z.object({
|
|
19
38
|
projectDir: z.string().min(1, "projectDir is required"),
|
|
20
39
|
}),
|
|
21
|
-
handler: async (client, args) => client.thunder_debug(args.projectDir.trim()),
|
|
40
|
+
handler: async (client, args) => client.thunder_debug(resolveProjectDir(args.projectDir.trim())),
|
|
22
41
|
}),
|
|
23
42
|
thunder_curl: defineTool({
|
|
24
43
|
name: "tc_create",
|
|
@@ -40,7 +59,20 @@ export const toolDefinitions = {
|
|
|
40
59
|
message: "If 'folder' is provided, you must also provide 'collection'.",
|
|
41
60
|
path: ["collection"],
|
|
42
61
|
}),
|
|
43
|
-
handler: async (client, args) =>
|
|
62
|
+
handler: async (client, args) => {
|
|
63
|
+
debugLog('tc_create called with args', args);
|
|
64
|
+
const resolvedProjectDir = resolveProjectDir(args.projectDir.trim());
|
|
65
|
+
debugLog(`tc_create using resolved project dir: ${resolvedProjectDir}`);
|
|
66
|
+
try {
|
|
67
|
+
const result = await client.runCurl({ ...args, projectDir: resolvedProjectDir });
|
|
68
|
+
debugLog('tc_create result', result);
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
debugLog('tc_create error', error);
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
44
76
|
}),
|
|
45
77
|
};
|
|
46
78
|
export const tools = Object.values(toolDefinitions).map(def => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thunderclient-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Thunder Client MCP Server",
|
|
5
5
|
"main": "dist/index.js`",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.16.0",
|
|
29
|
+
"upath": "^2.0.1",
|
|
29
30
|
"zod": "^3.25.76",
|
|
30
31
|
"zod-to-json-schema": "^3.24.6"
|
|
31
32
|
},
|