envibe-mcp 0.1.1 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +8 -1
  2. package/dist/index.js +117 -9
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -66,7 +66,14 @@ This is the MCP server component of [envibe](https://github.com/dominic-righther
66
66
  | `env_list` | List visible variables with access levels |
67
67
  | `env_get` | Get a variable's value (respects permissions) |
68
68
  | `env_set` | Set a variable (only `full` access) |
69
- | `env_describe` | Get detailed info about a variable |
69
+ | `env_describe` | Get detailed info including format and example |
70
+ | `env_check_required` | Check which required variables are missing |
71
+
72
+ ### v0.2.0 Features
73
+
74
+ - **Better error messages** - When access is denied, get helpful guidance
75
+ - **Format hints** - Know what format a variable should be (url, key, number, etc.)
76
+ - **Required var checking** - Use `env_check_required` to guide users through setup
70
77
 
71
78
  ## For CLI tools
72
79
 
package/dist/index.js CHANGED
@@ -21291,7 +21291,7 @@ async function startMCPServer() {
21291
21291
  },
21292
21292
  {
21293
21293
  name: "env_describe",
21294
- description: "Get detailed information about a variable including its access level and description.",
21294
+ description: "Get detailed information about a variable including its access level, description, format, and example.",
21295
21295
  inputSchema: {
21296
21296
  type: "object",
21297
21297
  properties: {
@@ -21302,6 +21302,14 @@ async function startMCPServer() {
21302
21302
  },
21303
21303
  required: ["key"]
21304
21304
  }
21305
+ },
21306
+ {
21307
+ name: "env_check_required",
21308
+ description: "Check which required environment variables are missing. Use this to help users set up their environment.",
21309
+ inputSchema: {
21310
+ type: "object",
21311
+ properties: {}
21312
+ }
21305
21313
  }
21306
21314
  ]
21307
21315
  };
@@ -21332,18 +21340,57 @@ async function startMCPServer() {
21332
21340
  }
21333
21341
  case "env_get": {
21334
21342
  const key = args.key;
21343
+ const config2 = manifest2.variables[key];
21335
21344
  const variable = getVariableForAI(key, env, manifest2);
21345
+ if (config2 && config2.access === "hidden" /* HIDDEN */) {
21346
+ return {
21347
+ content: [
21348
+ {
21349
+ type: "text",
21350
+ text: JSON.stringify({
21351
+ error: "ACCESS_DENIED",
21352
+ key,
21353
+ access: "hidden",
21354
+ message: "This variable is hidden from AI. Ask the user to configure it manually.",
21355
+ hint: config2.description
21356
+ }, null, 2)
21357
+ }
21358
+ ],
21359
+ isError: true
21360
+ };
21361
+ }
21336
21362
  if (!variable) {
21337
21363
  return {
21338
21364
  content: [
21339
21365
  {
21340
21366
  type: "text",
21341
- text: `Error: Variable "${key}" is hidden or does not exist`
21367
+ text: JSON.stringify({
21368
+ error: "NOT_FOUND",
21369
+ key,
21370
+ message: `Variable "${key}" does not exist in the manifest.`
21371
+ }, null, 2)
21342
21372
  }
21343
21373
  ],
21344
21374
  isError: true
21345
21375
  };
21346
21376
  }
21377
+ if (variable.access === "placeholder" /* PLACEHOLDER */) {
21378
+ return {
21379
+ content: [
21380
+ {
21381
+ type: "text",
21382
+ text: JSON.stringify({
21383
+ value: variable.displayValue,
21384
+ access: "placeholder",
21385
+ message: "You can reference this variable but cannot see the actual value.",
21386
+ hint: config2?.description,
21387
+ format: config2?.format,
21388
+ example: config2?.example
21389
+ }, null, 2)
21390
+ }
21391
+ ]
21392
+ };
21393
+ }
21347
21394
  return {
21348
21395
  content: [
21349
21396
  {
@@ -21385,25 +21432,50 @@ async function startMCPServer() {
21385
21432
  const key = args.key;
21386
21433
  const variable = getVariableForAI(key, env, manifest2);
21387
21434
  const config2 = manifest2.variables[key];
21388
- if (!variable) {
21435
+ if (config2 && config2.access === "hidden" /* HIDDEN */) {
21389
21436
  return {
21390
21437
  content: [
21391
21438
  {
21392
21439
  type: "text",
21393
- text: `Error: Variable "${key}" is hidden or does not exist`
21440
+ text: JSON.stringify({
21441
+ key,
21442
+ access: "hidden",
21443
+ canModify: false,
21444
+ description: config2.description,
21445
+ message: "This variable is hidden from AI. Ask the user to configure it.",
21446
+ required: config2.required ?? false,
21447
+ format: config2.format,
21448
+ example: config2.example
21449
+ }, null, 2)
21450
+ }
21451
+ ]
21452
+ };
21453
+ }
21454
+ if (!variable && !config2) {
21455
+ return {
21456
+ content: [
21457
+ {
21458
+ type: "text",
21459
+ text: JSON.stringify({
21460
+ error: "NOT_FOUND",
21461
+ key,
21462
+ message: `Variable "${key}" does not exist in the manifest.`
21463
+ }, null, 2)
21394
21464
  }
21395
21465
  ],
21396
21466
  isError: true
21397
21467
  };
21398
21468
  }
21399
21469
  const info = {
21400
- key: variable.key,
21401
- access: variable.access,
21402
- canModify: variable.canModify,
21403
- description: variable.description,
21470
+ key: variable?.key ?? key,
21471
+ access: variable?.access ?? config2?.access,
21472
+ canModify: variable?.canModify ?? false,
21473
+ description: variable?.description ?? config2?.description,
21404
21474
  required: config2?.required ?? false,
21405
21475
  hasDefault: config2?.default !== undefined,
21406
- isSet: env[key] !== undefined
21476
+ isSet: env[key] !== undefined,
21477
+ format: config2?.format,
21478
+ example: config2?.example
21407
21479
  };
21408
21480
  return {
21409
21481
  content: [
@@ -21414,6 +21486,42 @@ async function startMCPServer() {
21414
21486
  ]
21415
21487
  };
21416
21488
  }
21489
+ case "env_check_required": {
21490
+ const missing = [];
21491
+ const set2 = [];
21492
+ for (const [key, config2] of Object.entries(manifest2.variables)) {
21493
+ if (config2.required) {
21494
+ if (env[key] === undefined || env[key] === "") {
21495
+ missing.push({
21496
+ key,
21497
+ description: config2.description,
21498
+ format: config2.format,
21499
+ example: config2.example
21500
+ });
21501
+ } else {
21502
+ const variable = getVariableForAI(key, env, manifest2);
21503
+ if (variable && (variable.access === "full" /* FULL */ || variable.access === "read-only" /* READ_ONLY */)) {
21504
+ set2.push({ key, value: variable.displayValue });
21505
+ } else {
21506
+ set2.push({ key, value: "<set>" });
21507
+ }
21508
+ }
21509
+ }
21510
+ }
21511
+ const result = {
21512
+ missing,
21513
+ set: set2,
21514
+ message: missing.length > 0 ? `${missing.length} required variable(s) are not set. Ask the user to configure them.` : "All required variables are set."
21515
+ };
21516
+ return {
21517
+ content: [
21518
+ {
21519
+ type: "text",
21520
+ text: JSON.stringify(result, null, 2)
21521
+ }
21522
+ ]
21523
+ };
21524
+ }
21417
21525
  default:
21418
21526
  return {
21419
21527
  content: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envibe-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "MCP server for envibe - the missing permission layer between AI agents and your .env",
5
5
  "type": "module",
6
6
  "bin": {