infisical-mcp 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 CHANGED
@@ -19,3 +19,22 @@ Needs an Infisical machine identity (client id + secret). Optional INFISICAL_SIT
19
19
  - `delete_secret` — Delete an Infisical secret by key.
20
20
 
21
21
  Part of [awesome-mcps](https://github.com/mrfentmen/awesome-mcps).
22
+
23
+ <!-- paywall -->
24
+ ## Premium tools
25
+
26
+ These tools need a license key:
27
+
28
+ * `secret_entropy_audit`
29
+ * `secret_set_diff`
30
+
31
+ Buy a key at https://mcp-marketplace.io/server/io-github-mrfentmen-infisical-mcp and set it in your MCP client config:
32
+
33
+ ```json
34
+ "env": { "MCP_LICENSE_KEY": "mcp_live_..." }
35
+ ```
36
+
37
+ The key is checked against MCP Marketplace, cached for 24 hours, and keeps
38
+ working offline once one check has succeeded. Every other tool on this server
39
+ stays free.
40
+ <!-- /paywall -->
package/dist/api.d.ts CHANGED
@@ -7,3 +7,20 @@ export declare function getSecret(projectId: string, key: string, environment?:
7
7
  export declare function createSecret(projectId: string, key: string, value: string, environment?: string, secretPath?: string): Promise<string>;
8
8
  export declare function updateSecret(projectId: string, key: string, value: string, environment?: string, secretPath?: string): Promise<string>;
9
9
  export declare function deleteSecret(projectId: string, key: string, environment?: string, secretPath?: string): Promise<string>;
10
+ export interface InfisicalEntropyArgs {
11
+ secrets: string;
12
+ label?: string;
13
+ }
14
+ export declare function secretEntropyAudit(args: InfisicalEntropyArgs): Promise<string>;
15
+ export interface InfisicalNamesArgs {
16
+ names: string;
17
+ style?: string;
18
+ }
19
+ export declare function secretNameHygiene(args: InfisicalNamesArgs): Promise<string>;
20
+ export interface InfisicalDiffArgs {
21
+ left: string;
22
+ right: string;
23
+ left_label?: string;
24
+ right_label?: string;
25
+ }
26
+ export declare function secretSetDiff(args: InfisicalDiffArgs): Promise<string>;
package/dist/api.js CHANGED
@@ -106,3 +106,310 @@ export async function deleteSecret(projectId, key, environment, secretPath) {
106
106
  const data = await req(url, { method: "DELETE" });
107
107
  return pretty(data);
108
108
  }
109
+ // ---- muxB tools:
110
+ const INF_CHARSET_EXTRA = 100;
111
+ const INF_PLACEHOLDER = new Set([
112
+ "changeme", "change_me", "change-me", "password", "passwd", "secret", "token",
113
+ "example", "examplekey", "test", "testing", "todo", "fixme", "xxx", "yyy",
114
+ "yourkeyhere", "your_key_here", "your-password", "your_password", "placeholder",
115
+ "dummy", "sample", "replace", "replaceme", "undefined", "null", "none", "empty",
116
+ "admin", "root", "default", "insert", "value", "secretvalue", "password123",
117
+ ]);
118
+ const INF_RISKY = [
119
+ /password/i, /passwd/i, /pwd/i, /secret/i, /token/i, /private[_.-]?key/i,
120
+ /^key$/i, /api[_.-]?key/i, /credential/i, /cred[s]?$/i, /auth/i, /private/i,
121
+ /dsn/i, /connection[_.-]?string/i, /(^|_)pass($|_)/i,
122
+ ];
123
+ const INF_SEQUENCES = [
124
+ "abcdefghijklmnopqrstuvwxyz", "0123456789", "qwertyuiop", "asdfghjkl", "zxcvbnm",
125
+ "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
126
+ ];
127
+ function infPool(value) {
128
+ let pool = 0;
129
+ if (/[a-z]/.test(value))
130
+ pool += 26;
131
+ if (/[A-Z]/.test(value))
132
+ pool += 32;
133
+ if (/[0-9]/.test(value))
134
+ pool += 10;
135
+ if (value.includes(" "))
136
+ pool += 1;
137
+ if (/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/.test(value))
138
+ pool += 32;
139
+ if (/[^\x20-\x7e]/.test(value))
140
+ pool += INF_CHARSET_EXTRA;
141
+ return pool;
142
+ }
143
+ function infEntropyPerChar(value) {
144
+ const counts = new Map();
145
+ for (const ch of value)
146
+ counts.set(ch, (counts.get(ch) ?? 0) + 1);
147
+ let h = 0;
148
+ for (const n of counts.values()) {
149
+ const p = n / value.length;
150
+ h -= p * Math.log2(p);
151
+ }
152
+ return h;
153
+ }
154
+ function infMaxRun(value) {
155
+ let best = 0;
156
+ for (const seq of INF_SEQUENCES) {
157
+ for (let len = seq.length; len > best; len--) {
158
+ for (let i = 0; i + len <= seq.length; i++) {
159
+ if (value.includes(seq.slice(i, i + len).toLowerCase()))
160
+ best = len;
161
+ }
162
+ }
163
+ }
164
+ return best;
165
+ }
166
+ function infStrength(bits, value) {
167
+ const grade = bits < 28 ? "very weak" : bits < 40 ? "weak" : bits < 60 ? "fair" : bits < 80 ? "strong" : "very strong";
168
+ const predictable = INF_PLACEHOLDER.has(value.toLowerCase()) ||
169
+ (value.length > 3 && infRepeatShare(value) > 0.5) ||
170
+ infMaxRun(value) >= 6;
171
+ if (!predictable)
172
+ return grade;
173
+ return `${grade} on paper, but predictable content - treat as ${bits < 28 ? "very weak" : "weak"}`;
174
+ }
175
+ function infRepeatShare(value) {
176
+ if (!value.length)
177
+ return 0;
178
+ const counts = new Map();
179
+ for (const ch of value)
180
+ counts.set(ch, (counts.get(ch) ?? 0) + 1);
181
+ return 1 - counts.size / value.length;
182
+ }
183
+ function infFlags(key, value, values) {
184
+ const notes = [];
185
+ if (value.length === 0)
186
+ notes.push("empty value");
187
+ const lower = value.toLowerCase();
188
+ if (INF_PLACEHOLDER.has(lower))
189
+ notes.push(`value is the placeholder "${value}"`);
190
+ if (value === key)
191
+ notes.push("value is identical to its key");
192
+ if (value.toLowerCase() === key.toLowerCase())
193
+ notes.push("value is the key name in a different case");
194
+ if (value.length > 0 && value.toLowerCase().includes(key.toLowerCase()))
195
+ notes.push("value contains the key name");
196
+ if (infRepeatShare(value) > 0.5 && value.length > 3)
197
+ notes.push("value repeats the same few characters");
198
+ const run = infMaxRun(value);
199
+ if (run >= 4)
200
+ notes.push(`value contains a ${run}-character run of a keyboard/alphabet sequence`);
201
+ const shared = values.get(value);
202
+ if (shared && shared.length > 1)
203
+ notes.push(`same value is used by ${shared.join(", ")}`);
204
+ if (/^[A-Za-z0-9+/]{24,}={0,2}$/.test(value))
205
+ notes.push("value looks like base64-encoded material, not a generated secret");
206
+ if (/^[0-9a-f]{32,}$/i.test(value))
207
+ notes.push("value looks like a hex-encoded key or digest");
208
+ if (/^[A-Za-z0-9_-]+$/.test(value) && /[A-Z]/.test(value) && /[a-z]/.test(value) && /[0-9]/.test(value) && !/[-_]/.test(value) && value.length < 20) {
209
+ notes.push("value mixes cases and digits but has no separator; likely a word with a digit glued on");
210
+ }
211
+ return notes;
212
+ }
213
+ function infParsePairs(text) {
214
+ const trimmed = text.trim();
215
+ if (!trimmed)
216
+ return [];
217
+ if (trimmed.startsWith("{")) {
218
+ try {
219
+ const parsed = JSON.parse(trimmed);
220
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
221
+ return Object.entries(parsed)
222
+ .map(([k, v]) => ({ key: k, value: typeof v === "string" ? v : JSON.stringify(v ?? null) }))
223
+ .slice(0, 100);
224
+ }
225
+ }
226
+ catch {
227
+ throw new InfisicalError("That looks like JSON but does not parse. Send a JSON object of key/value pairs.");
228
+ }
229
+ }
230
+ const out = [];
231
+ for (const line of trimmed.split(/\r?\n/).slice(0, 100)) {
232
+ const row = line.trim();
233
+ if (!row || row.startsWith("#"))
234
+ continue;
235
+ const eq = row.indexOf("=");
236
+ if (eq <= 0)
237
+ continue;
238
+ out.push({ key: row.slice(0, eq).trim(), value: row.slice(eq + 1).trim() });
239
+ }
240
+ return out;
241
+ }
242
+ function infValueIndex(pairs) {
243
+ const index = new Map();
244
+ for (const p of pairs) {
245
+ if (!p.value)
246
+ continue;
247
+ const list = index.get(p.value) ?? [];
248
+ list.push(p.key);
249
+ index.set(p.value, list);
250
+ }
251
+ return index;
252
+ }
253
+ export async function secretEntropyAudit(args) {
254
+ const pairs = infParsePairs(args.secrets ?? "");
255
+ if (pairs.length === 0) {
256
+ return "Send the secret material to audit as KEY=value lines (or a JSON object), e.g. STRIPE_KEY=sk_live_9fJ2kQp81x.";
257
+ }
258
+ const seen = infValueIndex(pairs);
259
+ const rows = pairs.map((p) => {
260
+ const pool = infPool(p.value);
261
+ const bits = p.value.length > 0 && pool > 1 ? p.value.length * Math.log2(pool) : 0;
262
+ return {
263
+ key: p.key,
264
+ value: p.value,
265
+ bits,
266
+ perChar: p.value.length > 0 ? infEntropyPerChar(p.value) : 0,
267
+ flags: infFlags(p.key, p.value, seen),
268
+ };
269
+ });
270
+ const risky = rows.filter((r) => r.flags.length > 0);
271
+ const weak = rows.filter((r) => r.bits < 60).sort((a, b) => a.bits - b.bits);
272
+ const lines = [
273
+ `${rows.length} secret(s) audited${args.label ? ` from ${args.label}` : ""}. Values are measured, never printed.`,
274
+ "",
275
+ "bits = length x log2(charset size), the standard estimate of brute-force search space.",
276
+ ...rows.map((r) => {
277
+ const head = `${r.key}: ${r.bits.toFixed(1)} bits (${r.perChar.toFixed(2)} bits/char, ${infStrength(r.bits, r.value)})`;
278
+ return r.flags.length ? `${head}\n - ${r.flags.join("\n - ")}` : head;
279
+ }),
280
+ "",
281
+ `Flagged: ${risky.length} of ${rows.length}.`,
282
+ ];
283
+ if (weak.length) {
284
+ lines.push(`Weakest first: ${weak.slice(0, 5).map((r) => `${r.key} (${r.bits.toFixed(0)} bits)`).join(", ")}.`);
285
+ }
286
+ if (!risky.length && !weak.length)
287
+ lines.push("No placeholder, reuse, sequence or charset problems found.");
288
+ return lines.join("\n");
289
+ }
290
+ function infStyleOf(name) {
291
+ if (/^[A-Z][A-Z0-9]*(_[A-Z0-9]+)+$/.test(name))
292
+ return "SHOUTING_SNAKE_CASE";
293
+ if (/^[a-z][a-z0-9]*([A-Z][a-z0-9]*)+$/.test(name))
294
+ return "camelCase";
295
+ if (/^[a-z][a-z0-9]*(-[a-z0-9]+)+$/.test(name))
296
+ return "kebab-case";
297
+ if (/^[a-z][a-z0-9]*(_[a-z0-9]+)+$/.test(name))
298
+ return "snake_case";
299
+ if (/^[a-z][a-z0-9]*(\.[a-z0-9]+)+$/.test(name))
300
+ return "dot.separated";
301
+ if (/^[A-Z0-9_]+$/.test(name))
302
+ return "SHOUTING_NO_UNDERSCORES";
303
+ return "other";
304
+ }
305
+ function infCanonical(name) {
306
+ return name
307
+ .replace(/([a-z0-9])([A-Z])/g, "$1_$2")
308
+ .replace(/[^A-Za-z0-9]+/g, "_")
309
+ .replace(/_+/g, "_")
310
+ .replace(/^_|_$/g, "")
311
+ .toUpperCase();
312
+ }
313
+ export async function secretNameHygiene(args) {
314
+ const wanted = (args.style ?? "SHOUTING_SNAKE_CASE").trim();
315
+ const names = (args.names ?? "")
316
+ .split(/[\n,]/)
317
+ .map((n) => n.trim())
318
+ .filter(Boolean)
319
+ .slice(0, 100);
320
+ if (names.length === 0) {
321
+ return "Send the secret names to check, one per line or comma separated, e.g. STRIPE_SECRET_KEY, db-password.";
322
+ }
323
+ const lower = new Map();
324
+ for (const n of names) {
325
+ const k = n.toLowerCase();
326
+ lower.set(k, [...(lower.get(k) ?? []), n]);
327
+ }
328
+ const rows = names.map((name) => {
329
+ const notes = [];
330
+ const style = infStyleOf(name);
331
+ if (style !== wanted)
332
+ notes.push(`naming style is ${style}, not ${wanted}`);
333
+ if (/\s/.test(name))
334
+ notes.push("contains whitespace, which needs quoting in most .env parsers");
335
+ if (name.length > 40)
336
+ notes.push(`${name.length} characters is long for an env var name`);
337
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name))
338
+ notes.push("is not a valid environment variable name");
339
+ const risky = INF_RISKY.filter((re) => re.test(name));
340
+ if (risky.length)
341
+ notes.push(`name says what the secret is: matches ${risky.length} sensitive-word pattern(s)`);
342
+ const perChar = name.length > 0 ? infEntropyPerChar(name) : 0;
343
+ if (perChar > 3.4 || /^[A-Za-z0-9+/]{24,}={0,2}$/.test(name) || /^[0-9a-f]{24,}$/i.test(name)) {
344
+ notes.push("looks like a pasted value rather than a name");
345
+ }
346
+ const clashing = (lower.get(name.toLowerCase()) ?? []).filter((n) => n !== name);
347
+ if (clashing.length)
348
+ notes.push(`collides on case-insensitive lookup with ${clashing.join(", ")}`);
349
+ return { name, style, notes, suggested: infCanonical(name) };
350
+ });
351
+ const flagged = rows.filter((r) => r.notes.length > 0);
352
+ return [
353
+ `${rows.length} secret name(s) checked against ${wanted}.`,
354
+ "",
355
+ ...rows.map((r) => r.notes.length === 0
356
+ ? `${r.name} — clean (${r.style})`
357
+ : `${r.name} (${r.style})\n - ${r.notes.join("\n - ")}\n suggest: ${r.suggested || "(not renameable)"}`),
358
+ "",
359
+ `Clean: ${rows.length - flagged.length}. Needs attention: ${flagged.length}.`,
360
+ ].join("\n");
361
+ }
362
+ function infNormalise(value) {
363
+ return value.trim().toLowerCase();
364
+ }
365
+ export async function secretSetDiff(args) {
366
+ const leftName = (args.left_label ?? "left set").trim() || "left set";
367
+ const rightName = (args.right_label ?? "right set").trim() || "right set";
368
+ const left = infParsePairs(args.left ?? "");
369
+ const right = infParsePairs(args.right ?? "");
370
+ if (left.length === 0 && right.length === 0) {
371
+ return "Send both sets as KEY=value lines. Fill in at least one of them.";
372
+ }
373
+ const leftMap = new Map(left.map((p) => [p.key, p.value]));
374
+ const rightMap = new Map(right.map((p) => [p.key, p.value]));
375
+ const onlyLeft = [...leftMap.keys()].filter((k) => !rightMap.has(k));
376
+ const onlyRight = [...rightMap.keys()].filter((k) => !leftMap.has(k));
377
+ const shared = [...leftMap.keys()].filter((k) => rightMap.has(k));
378
+ const changed = [];
379
+ const caseOnly = [];
380
+ for (const k of shared) {
381
+ const a = leftMap.get(k);
382
+ const b = rightMap.get(k);
383
+ if (a === b)
384
+ continue;
385
+ if (infNormalise(a) === infNormalise(b))
386
+ caseOnly.push(k);
387
+ else
388
+ changed.push(k);
389
+ }
390
+ const leftDupes = infValueIndex(left);
391
+ const rightDupes = infValueIndex(right);
392
+ const rightValues = new Set(right.map((p) => p.value).filter(Boolean));
393
+ const crossShared = left.filter((p) => p.value && rightValues.has(p.value)).length;
394
+ const dupeNote = (name, index) => [...index.entries()]
395
+ .filter(([, keys]) => keys.length > 1)
396
+ .map(([value, keys]) => `${name}: ${keys.join(", ")} share one value (${value.length} chars)`)
397
+ .slice(0, 5);
398
+ return [
399
+ `${leftName}: ${left.length} key(s). ${rightName}: ${right.length} key(s). ${shared.length} in both. Values are never printed.`,
400
+ "",
401
+ onlyLeft.length ? `Only in ${leftName} (${onlyLeft.length}): ${onlyLeft.slice(0, 20).join(", ")}` : `Only in ${leftName}: none.`,
402
+ onlyRight.length ? `Only in ${rightName} (${onlyRight.length}): ${onlyRight.slice(0, 20).join(", ")}` : `Only in ${rightName}: none.`,
403
+ changed.length
404
+ ? `Different values (${changed.length}): ${changed.slice(0, 20).join(", ")}`
405
+ : "Different values: none.",
406
+ caseOnly.length
407
+ ? `Differ only by case/whitespace (${caseOnly.length}): ${caseOnly.slice(0, 10).join(", ")}`
408
+ : "Differ only by case/whitespace: none.",
409
+ ...dupeNote(leftName, leftDupes),
410
+ ...dupeNote(rightName, rightDupes),
411
+ crossShared > 0 ? `${crossShared} value(s) are reused across the two sets.` : "No values reused across the two sets.",
412
+ ]
413
+ .filter(Boolean)
414
+ .join("\n");
415
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns null when the caller may run the tool, or a short message telling
3
+ * them how to get a key.
4
+ *
5
+ * A good key is remembered for an hour, so a busy session does not hit the
6
+ * license server on every call and keeps working through a brief outage.
7
+ */
8
+ export declare function premiumRequired(tool: string): Promise<string | null>;
@@ -0,0 +1,79 @@
1
+ // Premium tools on this server need a license key bought from MCP Marketplace.
2
+ // Buyers put the key in their MCP client config as MCP_LICENSE_KEY. Every tool
3
+ // that is not listed in PREMIUM keeps working without a key.
4
+ const SLUG = "infisical-mcp";
5
+ // Tools that need a key. Everything else is free.
6
+ const PREMIUM = new Set([
7
+ "secret_entropy_audit",
8
+ "secret_set_diff",
9
+ ]);
10
+ const BUY_URL = `https://mcp-marketplace.io/server/io-github-mrfentmen-${SLUG}`;
11
+ // The license check calls the marketplace's verify endpoint directly instead of
12
+ // using @mcp_marketplace/license. That SDK sends no `apikey` header, so every
13
+ // check it makes is rejected by Supabase before it reaches the function. The
14
+ // publishable key below is public by design - it ships in mcp-marketplace.io's
15
+ // own JavaScript and only ever reaches their licence check.
16
+ const DEFAULT_VERIFY_URL = "https://virupvwhtkpkjsiskckg.supabase.co/functions/v1/verify-key";
17
+ const PUBLISHABLE_KEY = "sb_publishable_BuqlW96Ke8C_zzJG-LQv1Q_YHi_r_4h";
18
+ const OK_CACHE_MS = 60 * 60 * 1000;
19
+ const BAD_CACHE_MS = 60 * 1000;
20
+ const seen = new Map();
21
+ const REASONS = {
22
+ missing_key: "no key is set",
23
+ invalid_format: "that key is not a valid MCP Marketplace key",
24
+ not_found: "that key was not found",
25
+ revoked: "that key has been revoked",
26
+ rotated: "that key was rotated, use your new one",
27
+ expired: "that key has expired, renew it",
28
+ rate_limited: "there were too many checks just now, try again shortly",
29
+ network_error: "the license server could not be reached",
30
+ };
31
+ function blocked(tool, reason) {
32
+ const why = REASONS[reason] ?? `the license server answered "${reason}"`;
33
+ return `"${tool}" needs a license key, but ${why}. ` +
34
+ `Set MCP_LICENSE_KEY in your MCP client config. Get a key: ${BUY_URL}`;
35
+ }
36
+ async function verify(key) {
37
+ const res = await fetch(process.env.MCP_LICENSE_VERIFY_URL || DEFAULT_VERIFY_URL, {
38
+ method: "POST",
39
+ headers: {
40
+ apikey: PUBLISHABLE_KEY,
41
+ Authorization: `Bearer ${PUBLISHABLE_KEY}`,
42
+ "Content-Type": "application/json",
43
+ },
44
+ body: JSON.stringify({ key, slug: SLUG }),
45
+ // an unusable key answers 400 with a JSON body, so read the body either way
46
+ signal: AbortSignal.timeout(15000),
47
+ });
48
+ const data = (await res.json());
49
+ if (typeof data?.valid !== "boolean")
50
+ return { valid: false, reason: "unexpected_response" };
51
+ return data;
52
+ }
53
+ /**
54
+ * Returns null when the caller may run the tool, or a short message telling
55
+ * them how to get a key.
56
+ *
57
+ * A good key is remembered for an hour, so a busy session does not hit the
58
+ * license server on every call and keeps working through a brief outage.
59
+ */
60
+ export async function premiumRequired(tool) {
61
+ if (!PREMIUM.has(tool))
62
+ return null;
63
+ const key = process.env.MCP_LICENSE_KEY;
64
+ if (!key)
65
+ return blocked(tool, "missing_key");
66
+ const hit = seen.get(key);
67
+ if (hit && Date.now() - hit.at < (hit.valid ? OK_CACHE_MS : BAD_CACHE_MS)) {
68
+ return hit.valid ? null : blocked(tool, hit.reason ?? "invalid");
69
+ }
70
+ let result;
71
+ try {
72
+ result = await verify(key);
73
+ }
74
+ catch {
75
+ result = { valid: false, reason: "network_error" };
76
+ }
77
+ seen.set(key, { ...result, at: Date.now() });
78
+ return result.valid ? null : blocked(tool, result.reason ?? "invalid");
79
+ }
package/dist/server.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { z } from "zod";
3
- import { errorMessage, listSecrets, getSecret, createSecret, updateSecret, deleteSecret, } from "./api.js";
3
+ import { errorMessage, listSecrets, getSecret, createSecret, updateSecret, deleteSecret, secretEntropyAudit, secretNameHygiene, secretSetDiff } from "./api.js";
4
+ import { premiumRequired } from "./license.js";
4
5
  const text = (t) => ({ content: [{ type: "text", text: t }] });
5
6
  const textError = (t) => ({ content: [{ type: "text", text: t }], isError: true });
6
7
  const READ_ONLY = { readOnlyHint: true, openWorldHint: true };
@@ -101,5 +102,65 @@ export function createServer() {
101
102
  return textError(errorMessage(e));
102
103
  }
103
104
  });
105
+ server.registerTool("secret_entropy_audit", {
106
+ title: "Audit secret strength",
107
+ description: "Measure the strength of secret material you paste in, without any network call and without sending the values anywhere. Shannon entropy, charset size, placeholder and reuse detection.",
108
+ inputSchema: z.object({
109
+ secrets: z.string().describe("KEY=value lines, or a JSON object of key/value pairs"),
110
+ label: z.string().optional().describe("Where this material came from, e.g. 'staging .env'"),
111
+ }),
112
+ annotations: READ_ONLY,
113
+ }, async (args) => {
114
+ // ---- paywall: secret_entropy_audit ----
115
+ const paywallMessage = await premiumRequired("secret_entropy_audit");
116
+ if (paywallMessage)
117
+ return { content: [{ type: "text", text: paywallMessage }], isError: true };
118
+ // ---- paywall: end ----
119
+ try {
120
+ return text(await secretEntropyAudit(args));
121
+ }
122
+ catch (e) {
123
+ return textError(errorMessage(e));
124
+ }
125
+ });
126
+ server.registerTool("secret_name_hygiene", {
127
+ title: "Check secret names",
128
+ description: "Naming-convention check for secret keys: style, collisions, names that leak what they hold, names that are actually pasted values. Local only.",
129
+ inputSchema: z.object({
130
+ names: z.string().describe("Secret names, one per line or comma separated"),
131
+ style: z.string().default("SHOUTING_SNAKE_CASE").describe("Style the names should follow"),
132
+ }),
133
+ annotations: READ_ONLY,
134
+ }, async (args) => {
135
+ try {
136
+ return text(await secretNameHygiene(args));
137
+ }
138
+ catch (e) {
139
+ return textError(errorMessage(e));
140
+ }
141
+ });
142
+ server.registerTool("secret_set_diff", {
143
+ title: "Diff two secret sets",
144
+ description: "Compare two pasted KEY=value sets (e.g. staging against production): keys missing on either side, values that differ, values reused across environments. Names and value lengths only, never the values.",
145
+ inputSchema: z.object({
146
+ left: z.string().describe("KEY=value lines for the first set"),
147
+ right: z.string().describe("KEY=value lines for the second set"),
148
+ left_label: z.string().optional().describe("Name for the first set, e.g. dev"),
149
+ right_label: z.string().optional().describe("Name for the second set, e.g. prod"),
150
+ }),
151
+ annotations: READ_ONLY,
152
+ }, async (args) => {
153
+ // ---- paywall: secret_set_diff ----
154
+ const paywallMessage = await premiumRequired("secret_set_diff");
155
+ if (paywallMessage)
156
+ return { content: [{ type: "text", text: paywallMessage }], isError: true };
157
+ // ---- paywall: end ----
158
+ try {
159
+ return text(await secretSetDiff(args));
160
+ }
161
+ catch (e) {
162
+ return textError(errorMessage(e));
163
+ }
164
+ });
104
165
  return server;
105
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infisical-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Infisical API: list, read, create, update and delete secrets via universal auth.",
5
5
  "type": "module",
6
6
  "mcpName": "io.github.mrfentmen/infisical-mcp",