@envseal/mcp-server 0.1.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/LICENSE +201 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.js +84 -0
- package/dist/cli-args.d.ts +31 -0
- package/dist/cli-args.js +100 -0
- package/dist/confirm.d.ts +75 -0
- package/dist/confirm.js +247 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/respond.d.ts +22 -0
- package/dist/respond.js +44 -0
- package/dist/server.d.ts +12 -0
- package/dist/server.js +43 -0
- package/dist/test-prompter.d.ts +40 -0
- package/dist/test-prompter.js +68 -0
- package/dist/tools/await.d.ts +15 -0
- package/dist/tools/await.js +20 -0
- package/dist/tools/declare.d.ts +253 -0
- package/dist/tools/declare.js +20 -0
- package/dist/tools/describe.d.ts +12 -0
- package/dist/tools/describe.js +22 -0
- package/dist/tools/request.d.ts +15 -0
- package/dist/tools/request.js +22 -0
- package/dist/tools/revoke.d.ts +12 -0
- package/dist/tools/revoke.js +16 -0
- package/dist/tools/use.d.ts +15 -0
- package/dist/tools/use.js +22 -0
- package/dist/tools/verify.d.ts +12 -0
- package/dist/tools/verify.js +24 -0
- package/package.json +43 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import type { Broker } from '@envseal/core';
|
|
2
|
+
export declare const name = "env_declare";
|
|
3
|
+
export declare const description: string;
|
|
4
|
+
export declare const inputSchema: import("zod").ZodObject<{
|
|
5
|
+
entries: import("zod").ZodArray<import("zod").ZodEffects<import("zod").ZodObject<{
|
|
6
|
+
key: import("zod").ZodString;
|
|
7
|
+
description: import("zod").ZodString;
|
|
8
|
+
required: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
9
|
+
secret: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
10
|
+
format: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
11
|
+
pattern: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
|
+
minLength: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
13
|
+
maxLength: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
14
|
+
example: import("zod").ZodOptional<import("zod").ZodString>;
|
|
15
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
16
|
+
pattern?: string | undefined;
|
|
17
|
+
minLength?: number | undefined;
|
|
18
|
+
maxLength?: number | undefined;
|
|
19
|
+
example?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
pattern?: string | undefined;
|
|
22
|
+
minLength?: number | undefined;
|
|
23
|
+
maxLength?: number | undefined;
|
|
24
|
+
example?: string | undefined;
|
|
25
|
+
}>>;
|
|
26
|
+
provider: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
27
|
+
id: import("zod").ZodString;
|
|
28
|
+
name: import("zod").ZodString;
|
|
29
|
+
signupUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
30
|
+
docsUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
rotateUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
scopesNeeded: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
33
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
signupUrl?: string | undefined;
|
|
37
|
+
docsUrl?: string | undefined;
|
|
38
|
+
rotateUrl?: string | undefined;
|
|
39
|
+
scopesNeeded?: string[] | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
signupUrl?: string | undefined;
|
|
44
|
+
docsUrl?: string | undefined;
|
|
45
|
+
rotateUrl?: string | undefined;
|
|
46
|
+
scopesNeeded?: string[] | undefined;
|
|
47
|
+
}>>;
|
|
48
|
+
verify: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
49
|
+
method: import("zod").ZodEnum<["GET", "POST"]>;
|
|
50
|
+
url: import("zod").ZodString;
|
|
51
|
+
headerTemplate: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
|
|
52
|
+
expectStatus: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodNumber, "many">>;
|
|
53
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
54
|
+
method: "GET" | "POST";
|
|
55
|
+
url: string;
|
|
56
|
+
headerTemplate: Record<string, string>;
|
|
57
|
+
expectStatus: number[];
|
|
58
|
+
}, {
|
|
59
|
+
method: "GET" | "POST";
|
|
60
|
+
url: string;
|
|
61
|
+
headerTemplate: Record<string, string>;
|
|
62
|
+
expectStatus?: number[] | undefined;
|
|
63
|
+
}>>;
|
|
64
|
+
sink: import("zod").ZodDefault<import("zod").ZodEnum<["dotenv", "keychain", "sops", "onepassword", "doppler", "vault", "external"]>>;
|
|
65
|
+
rotation: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
66
|
+
maxAgeDays: import("zod").ZodNumber;
|
|
67
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
68
|
+
maxAgeDays: number;
|
|
69
|
+
}, {
|
|
70
|
+
maxAgeDays: number;
|
|
71
|
+
}>>;
|
|
72
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
73
|
+
key: string;
|
|
74
|
+
description: string;
|
|
75
|
+
required: boolean;
|
|
76
|
+
secret: boolean;
|
|
77
|
+
sink: "dotenv" | "keychain" | "sops" | "onepassword" | "doppler" | "vault" | "external";
|
|
78
|
+
format?: {
|
|
79
|
+
pattern?: string | undefined;
|
|
80
|
+
minLength?: number | undefined;
|
|
81
|
+
maxLength?: number | undefined;
|
|
82
|
+
example?: string | undefined;
|
|
83
|
+
} | undefined;
|
|
84
|
+
provider?: {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
signupUrl?: string | undefined;
|
|
88
|
+
docsUrl?: string | undefined;
|
|
89
|
+
rotateUrl?: string | undefined;
|
|
90
|
+
scopesNeeded?: string[] | undefined;
|
|
91
|
+
} | undefined;
|
|
92
|
+
verify?: {
|
|
93
|
+
method: "GET" | "POST";
|
|
94
|
+
url: string;
|
|
95
|
+
headerTemplate: Record<string, string>;
|
|
96
|
+
expectStatus: number[];
|
|
97
|
+
} | undefined;
|
|
98
|
+
rotation?: {
|
|
99
|
+
maxAgeDays: number;
|
|
100
|
+
} | undefined;
|
|
101
|
+
}, {
|
|
102
|
+
key: string;
|
|
103
|
+
description: string;
|
|
104
|
+
required?: boolean | undefined;
|
|
105
|
+
secret?: boolean | undefined;
|
|
106
|
+
format?: {
|
|
107
|
+
pattern?: string | undefined;
|
|
108
|
+
minLength?: number | undefined;
|
|
109
|
+
maxLength?: number | undefined;
|
|
110
|
+
example?: string | undefined;
|
|
111
|
+
} | undefined;
|
|
112
|
+
provider?: {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
signupUrl?: string | undefined;
|
|
116
|
+
docsUrl?: string | undefined;
|
|
117
|
+
rotateUrl?: string | undefined;
|
|
118
|
+
scopesNeeded?: string[] | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
verify?: {
|
|
121
|
+
method: "GET" | "POST";
|
|
122
|
+
url: string;
|
|
123
|
+
headerTemplate: Record<string, string>;
|
|
124
|
+
expectStatus?: number[] | undefined;
|
|
125
|
+
} | undefined;
|
|
126
|
+
sink?: "dotenv" | "keychain" | "sops" | "onepassword" | "doppler" | "vault" | "external" | undefined;
|
|
127
|
+
rotation?: {
|
|
128
|
+
maxAgeDays: number;
|
|
129
|
+
} | undefined;
|
|
130
|
+
}>, {
|
|
131
|
+
key: string;
|
|
132
|
+
description: string;
|
|
133
|
+
required: boolean;
|
|
134
|
+
secret: boolean;
|
|
135
|
+
sink: "dotenv" | "keychain" | "sops" | "onepassword" | "doppler" | "vault" | "external";
|
|
136
|
+
format?: {
|
|
137
|
+
pattern?: string | undefined;
|
|
138
|
+
minLength?: number | undefined;
|
|
139
|
+
maxLength?: number | undefined;
|
|
140
|
+
example?: string | undefined;
|
|
141
|
+
} | undefined;
|
|
142
|
+
provider?: {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
signupUrl?: string | undefined;
|
|
146
|
+
docsUrl?: string | undefined;
|
|
147
|
+
rotateUrl?: string | undefined;
|
|
148
|
+
scopesNeeded?: string[] | undefined;
|
|
149
|
+
} | undefined;
|
|
150
|
+
verify?: {
|
|
151
|
+
method: "GET" | "POST";
|
|
152
|
+
url: string;
|
|
153
|
+
headerTemplate: Record<string, string>;
|
|
154
|
+
expectStatus: number[];
|
|
155
|
+
} | undefined;
|
|
156
|
+
rotation?: {
|
|
157
|
+
maxAgeDays: number;
|
|
158
|
+
} | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
key: string;
|
|
161
|
+
description: string;
|
|
162
|
+
required?: boolean | undefined;
|
|
163
|
+
secret?: boolean | undefined;
|
|
164
|
+
format?: {
|
|
165
|
+
pattern?: string | undefined;
|
|
166
|
+
minLength?: number | undefined;
|
|
167
|
+
maxLength?: number | undefined;
|
|
168
|
+
example?: string | undefined;
|
|
169
|
+
} | undefined;
|
|
170
|
+
provider?: {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
signupUrl?: string | undefined;
|
|
174
|
+
docsUrl?: string | undefined;
|
|
175
|
+
rotateUrl?: string | undefined;
|
|
176
|
+
scopesNeeded?: string[] | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
verify?: {
|
|
179
|
+
method: "GET" | "POST";
|
|
180
|
+
url: string;
|
|
181
|
+
headerTemplate: Record<string, string>;
|
|
182
|
+
expectStatus?: number[] | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
sink?: "dotenv" | "keychain" | "sops" | "onepassword" | "doppler" | "vault" | "external" | undefined;
|
|
185
|
+
rotation?: {
|
|
186
|
+
maxAgeDays: number;
|
|
187
|
+
} | undefined;
|
|
188
|
+
}>, "many">;
|
|
189
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
190
|
+
entries: {
|
|
191
|
+
key: string;
|
|
192
|
+
description: string;
|
|
193
|
+
required: boolean;
|
|
194
|
+
secret: boolean;
|
|
195
|
+
sink: "dotenv" | "keychain" | "sops" | "onepassword" | "doppler" | "vault" | "external";
|
|
196
|
+
format?: {
|
|
197
|
+
pattern?: string | undefined;
|
|
198
|
+
minLength?: number | undefined;
|
|
199
|
+
maxLength?: number | undefined;
|
|
200
|
+
example?: string | undefined;
|
|
201
|
+
} | undefined;
|
|
202
|
+
provider?: {
|
|
203
|
+
id: string;
|
|
204
|
+
name: string;
|
|
205
|
+
signupUrl?: string | undefined;
|
|
206
|
+
docsUrl?: string | undefined;
|
|
207
|
+
rotateUrl?: string | undefined;
|
|
208
|
+
scopesNeeded?: string[] | undefined;
|
|
209
|
+
} | undefined;
|
|
210
|
+
verify?: {
|
|
211
|
+
method: "GET" | "POST";
|
|
212
|
+
url: string;
|
|
213
|
+
headerTemplate: Record<string, string>;
|
|
214
|
+
expectStatus: number[];
|
|
215
|
+
} | undefined;
|
|
216
|
+
rotation?: {
|
|
217
|
+
maxAgeDays: number;
|
|
218
|
+
} | undefined;
|
|
219
|
+
}[];
|
|
220
|
+
}, {
|
|
221
|
+
entries: {
|
|
222
|
+
key: string;
|
|
223
|
+
description: string;
|
|
224
|
+
required?: boolean | undefined;
|
|
225
|
+
secret?: boolean | undefined;
|
|
226
|
+
format?: {
|
|
227
|
+
pattern?: string | undefined;
|
|
228
|
+
minLength?: number | undefined;
|
|
229
|
+
maxLength?: number | undefined;
|
|
230
|
+
example?: string | undefined;
|
|
231
|
+
} | undefined;
|
|
232
|
+
provider?: {
|
|
233
|
+
id: string;
|
|
234
|
+
name: string;
|
|
235
|
+
signupUrl?: string | undefined;
|
|
236
|
+
docsUrl?: string | undefined;
|
|
237
|
+
rotateUrl?: string | undefined;
|
|
238
|
+
scopesNeeded?: string[] | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
verify?: {
|
|
241
|
+
method: "GET" | "POST";
|
|
242
|
+
url: string;
|
|
243
|
+
headerTemplate: Record<string, string>;
|
|
244
|
+
expectStatus?: number[] | undefined;
|
|
245
|
+
} | undefined;
|
|
246
|
+
sink?: "dotenv" | "keychain" | "sops" | "onepassword" | "doppler" | "vault" | "external" | undefined;
|
|
247
|
+
rotation?: {
|
|
248
|
+
maxAgeDays: number;
|
|
249
|
+
} | undefined;
|
|
250
|
+
}[];
|
|
251
|
+
}>;
|
|
252
|
+
export declare function handler(args: unknown, broker: Broker): Promise<import("../respond.js").ToolResult>;
|
|
253
|
+
//# sourceMappingURL=declare.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { INPUT_SCHEMAS } from '@envseal/protocol';
|
|
2
|
+
import { respond, respondError } from '../respond.js';
|
|
3
|
+
export const name = 'env_declare';
|
|
4
|
+
export const description = 'Declares that this project needs the given environment variables by writing entries to the project ' +
|
|
5
|
+
'manifest (env.schema.jsonc). Idempotent; does not prompt the user. ' +
|
|
6
|
+
'Declare metadata only: key name, description, and optional format/provider constraints. ' +
|
|
7
|
+
'It will NOT collect values and rejects any entry that tries to carry a value. ' +
|
|
8
|
+
'After declaring, call env_describe to check presence or env_request to prompt the user for the value.';
|
|
9
|
+
export const inputSchema = INPUT_SCHEMAS.env_declare;
|
|
10
|
+
export async function handler(args, broker) {
|
|
11
|
+
try {
|
|
12
|
+
const input = INPUT_SCHEMAS.env_declare.parse(args ?? {});
|
|
13
|
+
const result = await broker.declare(input);
|
|
14
|
+
return respond(result);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
return respondError(error);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=declare.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Broker } from '@envseal/core';
|
|
2
|
+
export declare const name = "env_describe";
|
|
3
|
+
export declare const description: string;
|
|
4
|
+
export declare const inputSchema: import("zod").ZodObject<{
|
|
5
|
+
scope: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
7
|
+
scope?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
scope?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function handler(args: unknown, broker: Broker): Promise<import("../respond.js").ToolResult>;
|
|
12
|
+
//# sourceMappingURL=describe.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { INPUT_SCHEMAS } from '@envseal/protocol';
|
|
2
|
+
import { respond, respondError } from '../respond.js';
|
|
3
|
+
export const name = 'env_describe';
|
|
4
|
+
export const description = 'Returns only redacted status: whether each key is present, a length bucket, and a salted fingerprint. ' +
|
|
5
|
+
'This never returns secret values and there is no flag, option, or debug mode that makes it do so. ' +
|
|
6
|
+
'Do not attempt to read .env directly — that is blocked and unnecessary. ' +
|
|
7
|
+
'Use this to see which declared keys exist, whether a value is present, and whether a stored value ' +
|
|
8
|
+
'changed since your last call (compare fingerprints). ' +
|
|
9
|
+
'It will NOT return, echo, or reconstruct any value. ' +
|
|
10
|
+
'To collect a missing value, first call env_declare (if the key is not yet declared), then env_request.';
|
|
11
|
+
export const inputSchema = INPUT_SCHEMAS.env_describe;
|
|
12
|
+
export async function handler(args, broker) {
|
|
13
|
+
try {
|
|
14
|
+
const input = INPUT_SCHEMAS.env_describe.parse(args ?? {});
|
|
15
|
+
const result = await broker.describe();
|
|
16
|
+
return respond(result);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return respondError(error);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=describe.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Broker } from '@envseal/core';
|
|
2
|
+
export declare const name = "env_request";
|
|
3
|
+
export declare const description: string;
|
|
4
|
+
export declare const inputSchema: import("zod").ZodObject<{
|
|
5
|
+
keys: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
6
|
+
reason: import("zod").ZodString;
|
|
7
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
8
|
+
keys: string[];
|
|
9
|
+
reason: string;
|
|
10
|
+
}, {
|
|
11
|
+
keys: string[];
|
|
12
|
+
reason: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function handler(args: unknown, broker: Broker): Promise<import("../respond.js").ToolResult>;
|
|
15
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { INPUT_SCHEMAS } from '@envseal/protocol';
|
|
2
|
+
import { respond, respondError } from '../respond.js';
|
|
3
|
+
export const name = 'env_request';
|
|
4
|
+
export const description = 'Opens a secure input surface where the user types the value directly. You will never see the value. ' +
|
|
5
|
+
'Returns a ticket immediately; poll env_await for the outcome. ' +
|
|
6
|
+
'You must call env_declare for a key before you can request it. ' +
|
|
7
|
+
"The 'reason' field is shown verbatim to the user, so write it as a clear, honest ask explaining why " +
|
|
8
|
+
'the project needs the key. ' +
|
|
9
|
+
'It will NOT return the value, and the typed value never crosses this channel — only a ticket that ' +
|
|
10
|
+
'you poll with env_await.';
|
|
11
|
+
export const inputSchema = INPUT_SCHEMAS.env_request;
|
|
12
|
+
export async function handler(args, broker) {
|
|
13
|
+
try {
|
|
14
|
+
const input = INPUT_SCHEMAS.env_request.parse(args ?? {});
|
|
15
|
+
const result = await broker.request(input);
|
|
16
|
+
return respond(result);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return respondError(error);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Broker } from '@envseal/core';
|
|
2
|
+
export declare const name = "env_revoke";
|
|
3
|
+
export declare const description = "Removes stored credentials. Records in the audit log and emits the provider rotation URL so you can help the user invalidate the old key.";
|
|
4
|
+
export declare const inputSchema: import("zod").ZodObject<{
|
|
5
|
+
keys: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
6
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
7
|
+
keys: string[];
|
|
8
|
+
}, {
|
|
9
|
+
keys: string[];
|
|
10
|
+
}>;
|
|
11
|
+
export declare function handler(args: unknown, broker: Broker): Promise<import("../respond.js").ToolResult>;
|
|
12
|
+
//# sourceMappingURL=revoke.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EnvRevokeInput, INPUT_SCHEMAS } from '@envseal/protocol';
|
|
2
|
+
import { respond, respondError } from '../respond.js';
|
|
3
|
+
export const name = 'env_revoke';
|
|
4
|
+
export const description = 'Removes stored credentials. Records in the audit log and emits the provider rotation URL so you can help the user invalidate the old key.';
|
|
5
|
+
export const inputSchema = INPUT_SCHEMAS.env_revoke;
|
|
6
|
+
export async function handler(args, broker) {
|
|
7
|
+
try {
|
|
8
|
+
const input = EnvRevokeInput.parse(args);
|
|
9
|
+
const result = await broker.revoke(input);
|
|
10
|
+
return respond(result);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
return respondError(error);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=revoke.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Broker } from '@envseal/core';
|
|
2
|
+
export declare const name = "env_use";
|
|
3
|
+
export declare const description: string;
|
|
4
|
+
export declare const inputSchema: import("zod").ZodObject<{
|
|
5
|
+
keys: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
6
|
+
command: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
7
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
8
|
+
keys: string[];
|
|
9
|
+
command: string[];
|
|
10
|
+
}, {
|
|
11
|
+
keys: string[];
|
|
12
|
+
command: string[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare function handler(args: unknown, broker: Broker): Promise<import("../respond.js").ToolResult>;
|
|
15
|
+
//# sourceMappingURL=use.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { INPUT_SCHEMAS } from '@envseal/protocol';
|
|
2
|
+
import { respond, respondError } from '../respond.js';
|
|
3
|
+
export const name = 'env_use';
|
|
4
|
+
export const description = 'Runs a command with the named secrets injected into the child environment only. ' +
|
|
5
|
+
'Output is filtered so the values cannot appear in what you read back. ' +
|
|
6
|
+
'Requires user confirmation. ' +
|
|
7
|
+
'Pass the command as an argv array with no shell. ' +
|
|
8
|
+
'It will NOT print the secrets to you, will NOT export them into your own environment, and refuses to ' +
|
|
9
|
+
'run without explicit user confirmation. ' +
|
|
10
|
+
'To check whether a key exists instead of running a command, call env_describe.';
|
|
11
|
+
export const inputSchema = INPUT_SCHEMAS.env_use;
|
|
12
|
+
export async function handler(args, broker) {
|
|
13
|
+
try {
|
|
14
|
+
const input = INPUT_SCHEMAS.env_use.parse(args ?? {});
|
|
15
|
+
const result = await broker.use(input);
|
|
16
|
+
return respond(result);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return respondError(error);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=use.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Broker } from '@envseal/core';
|
|
2
|
+
export declare const name = "env_verify";
|
|
3
|
+
export declare const description: string;
|
|
4
|
+
export declare const inputSchema: import("zod").ZodObject<{
|
|
5
|
+
keys: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
6
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
7
|
+
keys: string[];
|
|
8
|
+
}, {
|
|
9
|
+
keys: string[];
|
|
10
|
+
}>;
|
|
11
|
+
export declare function handler(args: unknown, broker: Broker): Promise<import("../respond.js").ToolResult>;
|
|
12
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { INPUT_SCHEMAS } from '@envseal/protocol';
|
|
2
|
+
import { respond, respondError } from '../respond.js';
|
|
3
|
+
import { annotateVerifyResults } from '../confirm.js';
|
|
4
|
+
export const name = 'env_verify';
|
|
5
|
+
export const description = 'Tests a stored credential against its provider and returns a classified result. ' +
|
|
6
|
+
'Never returns the provider\'s response body. ' +
|
|
7
|
+
'Results are classified as ok, auth_failed, forbidden, rate_limited, network_error, no_probe, or ' +
|
|
8
|
+
'probe_not_approved, plus a short sanitized message. ' +
|
|
9
|
+
'It will NOT return raw provider responses, headers, or the credential itself. ' +
|
|
10
|
+
'To check mere presence rather than validity, call env_describe instead.';
|
|
11
|
+
export const inputSchema = INPUT_SCHEMAS.env_verify;
|
|
12
|
+
export async function handler(args, broker) {
|
|
13
|
+
try {
|
|
14
|
+
const input = INPUT_SCHEMAS.env_verify.parse(args ?? {});
|
|
15
|
+
// `probe_not_approved` alone names a host and nothing the caller can act
|
|
16
|
+
// on. See annotateVerifyResults.
|
|
17
|
+
const result = annotateVerifyResults(await broker.verify(input));
|
|
18
|
+
return respond(result);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
return respondError(error);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=verify.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@envseal/mcp-server",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"envseal-mcp": "./dist/bin.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"!dist/**/*.map"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public",
|
|
23
|
+
"provenance": true
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@modelcontextprotocol/sdk": "^1.13.0",
|
|
27
|
+
"zod": "^3.24.1",
|
|
28
|
+
"@envseal/protocol": "0.1.0",
|
|
29
|
+
"@envseal/core": "0.1.0",
|
|
30
|
+
"@envseal/prompters": "0.1.0",
|
|
31
|
+
"@envseal/registry": "0.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"tsx": "^4.19.2",
|
|
35
|
+
"zod-to-json-schema": "^3.24.1"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.json && pnpm gen:dialects",
|
|
39
|
+
"gen:dialects": "tsx scripts/gen-dialects.ts",
|
|
40
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
41
|
+
"test": "vitest run"
|
|
42
|
+
}
|
|
43
|
+
}
|