thunderclient-mcp 1.0.4 → 1.0.6
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 +6 -12
- package/dist/thunder-client.d.ts +8 -6
- package/dist/thunder-client.d.ts.map +1 -1
- package/dist/thunder-client.js +21 -13
- package/dist/tools/definitions.d.ts +32 -50
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +22 -45
- package/dist/utils/schema-converter.d.ts.map +1 -1
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Thunder Client MCP
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Thunder Client MCP server leverages AI to create requests and collections. It can be used in various AI development environments, including Cline, Continue.dev, and GitHub Copilot.
|
|
4
4
|
|
|
5
5
|
## Available Tools
|
|
6
6
|
|
|
@@ -17,13 +17,7 @@ Saves API endpoints to Thunder Client, automatically creating collections and fo
|
|
|
17
17
|
- Add new requests to a specific collection in Thunder Client.
|
|
18
18
|
- Dynamically create a request using an AI-generated prompt.
|
|
19
19
|
|
|
20
|
-
### 2. `
|
|
21
|
-
|
|
22
|
-
**Description:** Show Thunder Client CLI help using `tc --help` in the given project directory.
|
|
23
|
-
|
|
24
|
-
- **Usage:** Get comprehensive help documentation for Thunder Client CLI
|
|
25
|
-
|
|
26
|
-
### 3. `tc_debug`
|
|
20
|
+
### 2. `tc_debug`
|
|
27
21
|
|
|
28
22
|
**Description:** Show Thunder Client CLI debug information using `tc --debug` in the given project directory.
|
|
29
23
|
|
|
@@ -113,23 +107,23 @@ This document contains simple example prompts for the `tc_create` tool to extrac
|
|
|
113
107
|
### 1. Extract APIs from Current Project
|
|
114
108
|
|
|
115
109
|
```
|
|
116
|
-
"Get the endpoints from current project and save
|
|
110
|
+
"Get the endpoints from the current project and save them with collection name 'My API' using Thunder Client MCP."
|
|
117
111
|
```
|
|
118
112
|
|
|
119
113
|
### 2. Extract APIs from Files and Folders
|
|
120
114
|
|
|
121
115
|
```
|
|
122
|
-
"Get the endpoints from app/main.py and save
|
|
116
|
+
"Get the endpoints from app/main.py and save them with collection name 'E-commerce API' and folder name 'Products' using Thunder Client MCP."
|
|
123
117
|
```
|
|
124
118
|
|
|
125
119
|
```
|
|
126
|
-
"Get the endpoints from src/routes/ folder and save
|
|
120
|
+
"Get the endpoints from the src/routes/ folder and save them with collection name 'Node API' using Thunder Client MCP."
|
|
127
121
|
```
|
|
128
122
|
|
|
129
123
|
### 3. Create Simple HTTP Requests
|
|
130
124
|
|
|
131
125
|
```
|
|
132
|
-
"Create a POST request to https://api.example.com/users with a JSON body and
|
|
126
|
+
"Create a POST request to https://api.example.com/users with a JSON body and an Authorization header using Thunder Client MCP."
|
|
133
127
|
```
|
|
134
128
|
|
|
135
129
|
## Troubleshooting
|
package/dist/thunder-client.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export declare class ThunderClient {
|
|
2
2
|
private validateProjectDir;
|
|
3
3
|
private execCommand;
|
|
4
|
-
|
|
5
|
-
projectDir: string;
|
|
4
|
+
runHelp(projectDir: string): Promise<{
|
|
6
5
|
success: boolean;
|
|
7
|
-
result?: string;
|
|
8
6
|
error?: string;
|
|
7
|
+
projectDir?: string;
|
|
8
|
+
version: string;
|
|
9
9
|
}>;
|
|
10
|
-
|
|
11
|
-
projectDir: string;
|
|
10
|
+
runDebug(projectDir: string): Promise<{
|
|
12
11
|
success: boolean;
|
|
13
|
-
result?: string;
|
|
14
12
|
error?: string;
|
|
13
|
+
projectDir?: string;
|
|
14
|
+
version: string;
|
|
15
15
|
}>;
|
|
16
16
|
runCurl({ curlInput, name, collection, folder, projectDir, }: {
|
|
17
17
|
curlInput: string;
|
|
@@ -22,6 +22,8 @@ export declare class ThunderClient {
|
|
|
22
22
|
}): Promise<{
|
|
23
23
|
success: boolean;
|
|
24
24
|
error?: string;
|
|
25
|
+
projectDir?: string;
|
|
26
|
+
version: string;
|
|
25
27
|
}>;
|
|
26
28
|
}
|
|
27
29
|
//# sourceMappingURL=thunder-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thunder-client.d.ts","sourceRoot":"","sources":["../src/thunder-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"thunder-client.d.ts","sourceRoot":"","sources":["../src/thunder-client.ts"],"names":[],"mappings":"AAmBA,qBAAa,aAAa;IACtB,OAAO,CAAC,kBAAkB;YAUZ,WAAW;IAmBnB,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAQhH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAQjH,OAAO,CAAC,EACV,SAAS,EACT,IAAI,EACJ,UAAU,EACV,MAAM,EACN,UAAU,GACb,EAAE;QACC,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CA4B1F"}
|
package/dist/thunder-client.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { exec } from "child_process";
|
|
2
2
|
import { promisify } from "util";
|
|
3
3
|
import * as fs from "fs";
|
|
4
|
+
import pkg from '../package.json' with { type: 'json' };
|
|
5
|
+
const version = pkg.version;
|
|
4
6
|
const execAsync = promisify(exec);
|
|
5
7
|
// Support multiple data flags in curl
|
|
6
8
|
function normalizeCurlInputForWindows(curlInput) {
|
|
@@ -21,8 +23,14 @@ export class ThunderClient {
|
|
|
21
23
|
}
|
|
22
24
|
async execCommand(command, cwd) {
|
|
23
25
|
try {
|
|
24
|
-
const { stdout } = await execAsync(command, { cwd });
|
|
25
|
-
|
|
26
|
+
const { stdout, stderr } = await execAsync(command, { cwd });
|
|
27
|
+
let succeeded = true;
|
|
28
|
+
let errorMessage = stderr ? stderr.trim() : undefined;
|
|
29
|
+
if ((stderr && stderr.trim()) || stdout?.trim().toLowerCase().includes("error")) {
|
|
30
|
+
succeeded = false;
|
|
31
|
+
errorMessage = errorMessage || stdout?.trim();
|
|
32
|
+
}
|
|
33
|
+
return { success: succeeded, result: stdout?.trim(), error: errorMessage };
|
|
26
34
|
}
|
|
27
35
|
catch (error) {
|
|
28
36
|
return {
|
|
@@ -31,33 +39,33 @@ export class ThunderClient {
|
|
|
31
39
|
};
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
|
-
async
|
|
42
|
+
async runHelp(projectDir) {
|
|
35
43
|
const check = this.validateProjectDir(projectDir);
|
|
36
44
|
if (!check.valid)
|
|
37
|
-
return { success: false, error: check.error, projectDir };
|
|
45
|
+
return { success: false, error: check.error, projectDir, version };
|
|
38
46
|
const result = await this.execCommand("tc --help", projectDir);
|
|
39
|
-
return { ...result, projectDir };
|
|
47
|
+
return { ...result, projectDir, version };
|
|
40
48
|
}
|
|
41
|
-
async
|
|
49
|
+
async runDebug(projectDir) {
|
|
42
50
|
const check = this.validateProjectDir(projectDir);
|
|
43
51
|
if (!check.valid)
|
|
44
|
-
return { success: false, error: check.error, projectDir };
|
|
52
|
+
return { success: false, error: check.error, projectDir, version };
|
|
45
53
|
const result = await this.execCommand("tc --debug", projectDir);
|
|
46
|
-
return { ...result, projectDir };
|
|
54
|
+
return { ...result, projectDir, version, };
|
|
47
55
|
}
|
|
48
56
|
async runCurl({ curlInput, name, collection, folder, projectDir, }) {
|
|
49
57
|
const check = this.validateProjectDir(projectDir);
|
|
50
58
|
if (!check.valid)
|
|
51
|
-
return { success: false, error: check.error };
|
|
59
|
+
return { success: false, error: check.error, version };
|
|
52
60
|
const trimmedInput = curlInput.trim();
|
|
53
61
|
if (!trimmedInput.toLowerCase().startsWith("curl ")) {
|
|
54
|
-
return { success: false, error: "Input must start with 'curl '" };
|
|
62
|
+
return { success: false, error: "Input must start with 'curl '", version };
|
|
55
63
|
}
|
|
56
64
|
let curlArgs = trimmedInput.slice(5).trim();
|
|
57
65
|
if (process.platform === "win32") {
|
|
58
66
|
curlArgs = normalizeCurlInputForWindows(curlArgs);
|
|
59
67
|
}
|
|
60
|
-
let cmd = `tc curl ${curlArgs}
|
|
68
|
+
let cmd = `tc curl ${curlArgs}`;
|
|
61
69
|
if (name)
|
|
62
70
|
cmd += ` --name "${name}"`;
|
|
63
71
|
if (collection)
|
|
@@ -67,10 +75,10 @@ export class ThunderClient {
|
|
|
67
75
|
cmd += ` --mcp`;
|
|
68
76
|
const result = await this.execCommand(cmd, projectDir);
|
|
69
77
|
if (result.success) {
|
|
70
|
-
return {
|
|
78
|
+
return { ...result, projectDir, version }; // ✅ Return only success: true
|
|
71
79
|
}
|
|
72
80
|
else {
|
|
73
|
-
return { success: false, error: result.error };
|
|
81
|
+
return { success: false, error: result.error, projectDir, version };
|
|
74
82
|
}
|
|
75
83
|
}
|
|
76
84
|
}
|
|
@@ -4,34 +4,11 @@ import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
|
4
4
|
interface ToolDefinition<TSchema extends ZodSchema, TResult> {
|
|
5
5
|
name: string;
|
|
6
6
|
description: string;
|
|
7
|
+
keywords?: string[];
|
|
7
8
|
schema: TSchema;
|
|
8
9
|
handler: (client: ThunderClient, args: z.infer<TSchema>) => Promise<TResult>;
|
|
9
10
|
}
|
|
10
11
|
export declare const toolDefinitions: {
|
|
11
|
-
readonly thunder_help: ToolDefinition<z.ZodObject<{
|
|
12
|
-
projectDir: z.ZodString;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
projectDir: string;
|
|
15
|
-
}, {
|
|
16
|
-
projectDir: string;
|
|
17
|
-
}>, {
|
|
18
|
-
projectDir: string;
|
|
19
|
-
success: boolean;
|
|
20
|
-
result?: string;
|
|
21
|
-
error?: string;
|
|
22
|
-
}>;
|
|
23
|
-
readonly thunder_debug: ToolDefinition<z.ZodObject<{
|
|
24
|
-
projectDir: z.ZodString;
|
|
25
|
-
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
projectDir: string;
|
|
27
|
-
}, {
|
|
28
|
-
projectDir: string;
|
|
29
|
-
}>, {
|
|
30
|
-
projectDir: string;
|
|
31
|
-
success: boolean;
|
|
32
|
-
result?: string;
|
|
33
|
-
error?: string;
|
|
34
|
-
}>;
|
|
35
12
|
readonly thunder_curl: ToolDefinition<z.ZodEffects<z.ZodObject<{
|
|
36
13
|
curlInput: z.ZodEffects<z.ZodString, string, string>;
|
|
37
14
|
name: z.ZodString;
|
|
@@ -39,91 +16,96 @@ export declare const toolDefinitions: {
|
|
|
39
16
|
folder: z.ZodOptional<z.ZodString>;
|
|
40
17
|
projectDir: z.ZodString;
|
|
41
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
projectDir: string;
|
|
42
20
|
curlInput: string;
|
|
43
21
|
name: string;
|
|
44
|
-
projectDir: string;
|
|
45
22
|
collection?: string | undefined;
|
|
46
23
|
folder?: string | undefined;
|
|
47
24
|
}, {
|
|
25
|
+
projectDir: string;
|
|
48
26
|
curlInput: string;
|
|
49
27
|
name: string;
|
|
50
|
-
projectDir: string;
|
|
51
28
|
collection?: string | undefined;
|
|
52
29
|
folder?: string | undefined;
|
|
53
30
|
}>, {
|
|
31
|
+
projectDir: string;
|
|
54
32
|
curlInput: string;
|
|
55
33
|
name: string;
|
|
56
|
-
projectDir: string;
|
|
57
34
|
collection?: string | undefined;
|
|
58
35
|
folder?: string | undefined;
|
|
59
36
|
}, {
|
|
37
|
+
projectDir: string;
|
|
60
38
|
curlInput: string;
|
|
61
39
|
name: string;
|
|
62
|
-
projectDir: string;
|
|
63
40
|
collection?: string | undefined;
|
|
64
41
|
folder?: string | undefined;
|
|
65
42
|
}>, {
|
|
66
43
|
success: boolean;
|
|
67
44
|
error?: string;
|
|
45
|
+
projectDir?: string;
|
|
46
|
+
version: string;
|
|
68
47
|
}>;
|
|
69
|
-
|
|
70
|
-
export declare const tools: Tool[];
|
|
71
|
-
export declare const toolHandlers: {
|
|
72
|
-
[k: string]: ToolDefinition<z.ZodObject<{
|
|
73
|
-
projectDir: z.ZodString;
|
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
projectDir: string;
|
|
76
|
-
}, {
|
|
77
|
-
projectDir: string;
|
|
78
|
-
}>, {
|
|
79
|
-
projectDir: string;
|
|
80
|
-
success: boolean;
|
|
81
|
-
result?: string;
|
|
82
|
-
error?: string;
|
|
83
|
-
}> | ToolDefinition<z.ZodObject<{
|
|
48
|
+
readonly thunder_debug: ToolDefinition<z.ZodObject<{
|
|
84
49
|
projectDir: z.ZodString;
|
|
85
50
|
}, "strip", z.ZodTypeAny, {
|
|
86
51
|
projectDir: string;
|
|
87
52
|
}, {
|
|
88
53
|
projectDir: string;
|
|
89
54
|
}>, {
|
|
90
|
-
projectDir: string;
|
|
91
55
|
success: boolean;
|
|
92
|
-
result?: string;
|
|
93
56
|
error?: string;
|
|
94
|
-
|
|
57
|
+
projectDir?: string;
|
|
58
|
+
version: string;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
61
|
+
export declare const tools: Tool[];
|
|
62
|
+
export declare const toolHandlers: {
|
|
63
|
+
[k: string]: ToolDefinition<z.ZodEffects<z.ZodObject<{
|
|
95
64
|
curlInput: z.ZodEffects<z.ZodString, string, string>;
|
|
96
65
|
name: z.ZodString;
|
|
97
66
|
collection: z.ZodOptional<z.ZodString>;
|
|
98
67
|
folder: z.ZodOptional<z.ZodString>;
|
|
99
68
|
projectDir: z.ZodString;
|
|
100
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
projectDir: string;
|
|
101
71
|
curlInput: string;
|
|
102
72
|
name: string;
|
|
103
|
-
projectDir: string;
|
|
104
73
|
collection?: string | undefined;
|
|
105
74
|
folder?: string | undefined;
|
|
106
75
|
}, {
|
|
76
|
+
projectDir: string;
|
|
107
77
|
curlInput: string;
|
|
108
78
|
name: string;
|
|
109
|
-
projectDir: string;
|
|
110
79
|
collection?: string | undefined;
|
|
111
80
|
folder?: string | undefined;
|
|
112
81
|
}>, {
|
|
82
|
+
projectDir: string;
|
|
113
83
|
curlInput: string;
|
|
114
84
|
name: string;
|
|
115
|
-
projectDir: string;
|
|
116
85
|
collection?: string | undefined;
|
|
117
86
|
folder?: string | undefined;
|
|
118
87
|
}, {
|
|
88
|
+
projectDir: string;
|
|
119
89
|
curlInput: string;
|
|
120
90
|
name: string;
|
|
121
|
-
projectDir: string;
|
|
122
91
|
collection?: string | undefined;
|
|
123
92
|
folder?: string | undefined;
|
|
124
93
|
}>, {
|
|
125
94
|
success: boolean;
|
|
126
95
|
error?: string;
|
|
96
|
+
projectDir?: string;
|
|
97
|
+
version: string;
|
|
98
|
+
}> | ToolDefinition<z.ZodObject<{
|
|
99
|
+
projectDir: z.ZodString;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
projectDir: string;
|
|
102
|
+
}, {
|
|
103
|
+
projectDir: string;
|
|
104
|
+
}>, {
|
|
105
|
+
success: boolean;
|
|
106
|
+
error?: string;
|
|
107
|
+
projectDir?: string;
|
|
108
|
+
version: string;
|
|
127
109
|
}>;
|
|
128
110
|
};
|
|
129
111
|
export declare const toolNames: Record<string, string>;
|
|
@@ -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;AAK1D,UAAU,cAAc,CAAC,OAAO,SAAS,SAAS,EAAE,OAAO;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,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;CAChF;AAmBD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwClB,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,CAC9C,CAAC,OAAO,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,OAAO,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CACpF,CAAC"}
|
|
@@ -1,47 +1,24 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { zodToMCPInputSchema } from "../utils/schema-converter.js";
|
|
3
3
|
import { resolve } from "path";
|
|
4
|
+
import { execSync } from 'child_process';
|
|
4
5
|
function defineTool(definition) {
|
|
5
6
|
return definition;
|
|
6
7
|
}
|
|
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
8
|
// Helper function to resolve project directory
|
|
14
9
|
function resolveProjectDir(projectDir) {
|
|
15
|
-
debugLog(`Input projectDir: ${projectDir}`);
|
|
16
10
|
if (projectDir === "." || projectDir === "./") {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
11
|
+
// Execute pwd command and get the current working directory
|
|
12
|
+
const currentDir = execSync('pwd', { encoding: 'utf8' }).trim();
|
|
13
|
+
return currentDir;
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
debugLog(`Resolved path: ${resolved}`);
|
|
23
|
-
return resolved;
|
|
15
|
+
return resolve(projectDir);
|
|
24
16
|
}
|
|
25
17
|
export const toolDefinitions = {
|
|
26
|
-
thunder_help: defineTool({
|
|
27
|
-
name: "tc_help",
|
|
28
|
-
description: "Show Thunder Client CLI help using `tc --help` in the given project directory.",
|
|
29
|
-
schema: z.object({
|
|
30
|
-
projectDir: z.string().min(1, "projectDir is required"),
|
|
31
|
-
}),
|
|
32
|
-
handler: async (client, args) => client.thunder_help(resolveProjectDir(args.projectDir.trim())),
|
|
33
|
-
}),
|
|
34
|
-
thunder_debug: defineTool({
|
|
35
|
-
name: "tc_debug",
|
|
36
|
-
description: "Show Thunder Client CLI debug using `tc --debug` in the given project directory.",
|
|
37
|
-
schema: z.object({
|
|
38
|
-
projectDir: z.string().min(1, "projectDir is required"),
|
|
39
|
-
}),
|
|
40
|
-
handler: async (client, args) => client.thunder_debug(resolveProjectDir(args.projectDir.trim())),
|
|
41
|
-
}),
|
|
42
18
|
thunder_curl: defineTool({
|
|
43
19
|
name: "tc_create",
|
|
44
|
-
description: "
|
|
20
|
+
description: "Create API endpoints to Thunder Client, automatically creating collections and folders if they do not already exist.",
|
|
21
|
+
keywords: ["thunder client", "thunder client mcp", "tc mcp", "thunder mcp", "thunderclient"],
|
|
45
22
|
schema: z
|
|
46
23
|
.object({
|
|
47
24
|
curlInput: z
|
|
@@ -53,26 +30,26 @@ export const toolDefinitions = {
|
|
|
53
30
|
name: z.string().min(2, { message: "Name must be at least 2 characters" }),
|
|
54
31
|
collection: z.string().optional(),
|
|
55
32
|
folder: z.string().optional(),
|
|
56
|
-
projectDir: z.string()
|
|
33
|
+
projectDir: z.string()
|
|
34
|
+
.min(1, "projectDir is required")
|
|
35
|
+
.describe("Get the full path to the project's directory (use process.cwd() and get it)."),
|
|
57
36
|
})
|
|
58
37
|
.refine(data => !(data.folder && !data.collection), {
|
|
59
38
|
message: "If 'folder' is provided, you must also provide 'collection'.",
|
|
60
39
|
path: ["collection"],
|
|
61
40
|
}),
|
|
62
|
-
handler: async (client, args) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
},
|
|
41
|
+
handler: async (client, args) => client.runCurl({ ...args, projectDir: resolveProjectDir(args.projectDir.trim()) }),
|
|
42
|
+
}),
|
|
43
|
+
thunder_debug: defineTool({
|
|
44
|
+
name: "tc_debug",
|
|
45
|
+
description: "Runs the Thunder Client debug command and display the result.",
|
|
46
|
+
keywords: ["thunder client", "thunder client mcp", "tc mcp", "thunder mcp", "thunderclient"],
|
|
47
|
+
schema: z.object({
|
|
48
|
+
projectDir: z.string()
|
|
49
|
+
.min(1, "projectDir is required")
|
|
50
|
+
.describe("Get the full path to the project's directory (use process.cwd() and get it)."),
|
|
51
|
+
}),
|
|
52
|
+
handler: async (client, args) => client.runDebug(resolveProjectDir(args.projectDir.trim())),
|
|
76
53
|
}),
|
|
77
54
|
};
|
|
78
55
|
export const tools = Object.values(toolDefinitions).map(def => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter.d.ts","sourceRoot":"","sources":["../../src/utils/schema-converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,GAAG;
|
|
1
|
+
{"version":3,"file":"schema-converter.d.ts","sourceRoot":"","sources":["../../src/utils/schema-converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,GAAG;IACtD,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAuDA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thunderclient-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Thunder Client MCP Server",
|
|
5
5
|
"main": "dist/index.js`",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.16.0",
|
|
29
|
-
"upath": "^2.0.1",
|
|
30
29
|
"zod": "^3.25.76",
|
|
31
30
|
"zod-to-json-schema": "^3.24.6"
|
|
32
31
|
},
|
|
@@ -36,4 +35,4 @@
|
|
|
36
35
|
"tsx": "^4.20.3",
|
|
37
36
|
"typescript": "^5.8.3"
|
|
38
37
|
}
|
|
39
|
-
}
|
|
38
|
+
}
|