envibe-mcp 0.1.0 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +8 -1
  2. package/dist/index.js +212 -46
  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
@@ -20603,193 +20603,245 @@ var CLASSIFICATION_PATTERNS = [
20603
20603
  name: "stripe-secret",
20604
20604
  pattern: /^STRIPE_SECRET/i,
20605
20605
  suggestedAccess: "hidden" /* HIDDEN */,
20606
- description: "Stripe secret key"
20606
+ description: "Stripe secret key",
20607
+ format: "key",
20608
+ example: "sk_live_..."
20607
20609
  },
20608
20610
  {
20609
20611
  name: "private-key",
20610
20612
  pattern: /PRIVATE[_-]?KEY/i,
20611
20613
  suggestedAccess: "hidden" /* HIDDEN */,
20612
- description: "Private key material"
20614
+ description: "Private key material",
20615
+ format: "pem",
20616
+ example: "-----BEGIN PRIVATE KEY-----..."
20613
20617
  },
20614
20618
  {
20615
20619
  name: "signing-secret",
20616
20620
  pattern: /SIGNING[_-]?SECRET/i,
20617
20621
  suggestedAccess: "hidden" /* HIDDEN */,
20618
- description: "Signing secret"
20622
+ description: "Signing secret",
20623
+ format: "key"
20619
20624
  },
20620
20625
  {
20621
20626
  name: "api-key",
20622
20627
  pattern: /API[_-]?KEY/i,
20623
20628
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20624
- description: "API key"
20629
+ description: "API key",
20630
+ format: "key",
20631
+ example: "sk-..."
20625
20632
  },
20626
20633
  {
20627
20634
  name: "secret-key",
20628
20635
  pattern: /SECRET[_-]?KEY/i,
20629
20636
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20630
- description: "Secret key"
20637
+ description: "Secret key",
20638
+ format: "key"
20631
20639
  },
20632
20640
  {
20633
20641
  name: "access-key",
20634
20642
  pattern: /ACCESS[_-]?KEY/i,
20635
20643
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20636
- description: "Access key"
20644
+ description: "Access key",
20645
+ format: "key",
20646
+ example: "AKIA..."
20637
20647
  },
20638
20648
  {
20639
20649
  name: "auth-token",
20640
20650
  pattern: /AUTH[_-]?TOKEN/i,
20641
20651
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20642
- description: "Authentication token"
20652
+ description: "Authentication token",
20653
+ format: "token"
20643
20654
  },
20644
20655
  {
20645
20656
  name: "bearer-token",
20646
20657
  pattern: /BEARER[_-]?TOKEN/i,
20647
20658
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20648
- description: "Bearer token"
20659
+ description: "Bearer token",
20660
+ format: "token"
20649
20661
  },
20650
20662
  {
20651
20663
  name: "jwt-secret",
20652
20664
  pattern: /JWT[_-]?SECRET/i,
20653
20665
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20654
- description: "JWT signing secret"
20666
+ description: "JWT signing secret",
20667
+ format: "key"
20655
20668
  },
20656
20669
  {
20657
20670
  name: "password",
20658
20671
  pattern: /PASSWORD/i,
20659
20672
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20660
- description: "Password credential"
20673
+ description: "Password credential",
20674
+ format: "password"
20661
20675
  },
20662
20676
  {
20663
20677
  name: "credential",
20664
20678
  pattern: /CREDENTIAL/i,
20665
20679
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20666
- description: "Credential"
20680
+ description: "Credential",
20681
+ format: "key"
20667
20682
  },
20668
20683
  {
20669
20684
  name: "secret",
20670
20685
  pattern: /SECRET/i,
20671
20686
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20672
- description: "Secret value"
20687
+ description: "Secret value",
20688
+ format: "key"
20673
20689
  },
20674
20690
  {
20675
20691
  name: "token",
20676
20692
  pattern: /TOKEN$/i,
20677
20693
  suggestedAccess: "placeholder" /* PLACEHOLDER */,
20678
- description: "Token"
20694
+ description: "Token",
20695
+ format: "token"
20679
20696
  },
20680
20697
  {
20681
20698
  name: "database-url",
20682
20699
  pattern: /DATABASE[_-]?URL/i,
20683
- suggestedAccess: "read-only" /* READ_ONLY */,
20684
- description: "Database connection URL"
20700
+ suggestedAccess: "placeholder" /* PLACEHOLDER */,
20701
+ description: "Database connection URL (may contain password)",
20702
+ format: "url",
20703
+ example: "postgres://user:pass@localhost:5432/dbname"
20685
20704
  },
20686
20705
  {
20687
20706
  name: "redis-url",
20688
20707
  pattern: /REDIS[_-]?URL/i,
20689
- suggestedAccess: "read-only" /* READ_ONLY */,
20690
- description: "Redis connection URL"
20708
+ suggestedAccess: "placeholder" /* PLACEHOLDER */,
20709
+ description: "Redis connection URL (may contain password)",
20710
+ format: "url",
20711
+ example: "redis://user:pass@localhost:6379/0"
20691
20712
  },
20692
20713
  {
20693
20714
  name: "mongodb-uri",
20694
20715
  pattern: /MONGO(DB)?[_-]?URI/i,
20695
- suggestedAccess: "read-only" /* READ_ONLY */,
20696
- description: "MongoDB connection URI"
20716
+ suggestedAccess: "placeholder" /* PLACEHOLDER */,
20717
+ description: "MongoDB connection URI (may contain password)",
20718
+ format: "url",
20719
+ example: "mongodb://user:pass@localhost:27017/dbname"
20697
20720
  },
20698
20721
  {
20699
20722
  name: "connection-string",
20700
20723
  pattern: /CONNECTION[_-]?STRING/i,
20701
- suggestedAccess: "read-only" /* READ_ONLY */,
20702
- description: "Connection string"
20724
+ suggestedAccess: "placeholder" /* PLACEHOLDER */,
20725
+ description: "Connection string (may contain password)",
20726
+ format: "url"
20703
20727
  },
20704
20728
  {
20705
20729
  name: "url-suffix",
20706
20730
  pattern: /_URL$/i,
20707
20731
  suggestedAccess: "read-only" /* READ_ONLY */,
20708
- description: "URL endpoint"
20732
+ description: "URL endpoint",
20733
+ format: "url",
20734
+ example: "https://api.example.com"
20709
20735
  },
20710
20736
  {
20711
20737
  name: "uri-suffix",
20712
20738
  pattern: /_URI$/i,
20713
20739
  suggestedAccess: "read-only" /* READ_ONLY */,
20714
- description: "URI endpoint"
20740
+ description: "URI endpoint",
20741
+ format: "url"
20715
20742
  },
20716
20743
  {
20717
20744
  name: "host",
20718
20745
  pattern: /_HOST$/i,
20719
20746
  suggestedAccess: "read-only" /* READ_ONLY */,
20720
- description: "Host address"
20747
+ description: "Host address",
20748
+ format: "hostname",
20749
+ example: "localhost"
20721
20750
  },
20722
20751
  {
20723
20752
  name: "node-env",
20724
20753
  pattern: /^NODE_ENV$/i,
20725
20754
  suggestedAccess: "full" /* FULL */,
20726
- description: "Node.js environment mode"
20755
+ description: "Node.js environment mode",
20756
+ format: "enum",
20757
+ example: "development | production | test"
20727
20758
  },
20728
20759
  {
20729
20760
  name: "env-suffix",
20730
20761
  pattern: /_ENV$/i,
20731
20762
  suggestedAccess: "full" /* FULL */,
20732
- description: "Environment setting"
20763
+ description: "Environment setting",
20764
+ format: "string"
20733
20765
  },
20734
20766
  {
20735
20767
  name: "debug",
20736
20768
  pattern: /DEBUG/i,
20737
20769
  suggestedAccess: "full" /* FULL */,
20738
- description: "Debug flag"
20770
+ description: "Debug flag",
20771
+ format: "boolean",
20772
+ example: "true | false"
20739
20773
  },
20740
20774
  {
20741
20775
  name: "log-level",
20742
20776
  pattern: /LOG[_-]?LEVEL/i,
20743
20777
  suggestedAccess: "full" /* FULL */,
20744
- description: "Logging level"
20778
+ description: "Logging level",
20779
+ format: "enum",
20780
+ example: "debug | info | warn | error"
20745
20781
  },
20746
20782
  {
20747
20783
  name: "port",
20748
20784
  pattern: /^PORT$/i,
20749
20785
  suggestedAccess: "full" /* FULL */,
20750
- description: "Server port"
20786
+ description: "Server port",
20787
+ format: "number",
20788
+ example: "3000"
20751
20789
  },
20752
20790
  {
20753
20791
  name: "port-suffix",
20754
20792
  pattern: /_PORT$/i,
20755
20793
  suggestedAccess: "full" /* FULL */,
20756
- description: "Port number"
20794
+ description: "Port number",
20795
+ format: "number",
20796
+ example: "5432"
20757
20797
  },
20758
20798
  {
20759
20799
  name: "timeout",
20760
20800
  pattern: /TIMEOUT/i,
20761
20801
  suggestedAccess: "full" /* FULL */,
20762
- description: "Timeout setting"
20802
+ description: "Timeout setting",
20803
+ format: "number",
20804
+ example: "30000"
20763
20805
  },
20764
20806
  {
20765
20807
  name: "max-size",
20766
20808
  pattern: /MAX[_-]?(SIZE|LENGTH|COUNT)/i,
20767
20809
  suggestedAccess: "full" /* FULL */,
20768
- description: "Size/count limit"
20810
+ description: "Size/count limit",
20811
+ format: "number",
20812
+ example: "100"
20769
20813
  },
20770
20814
  {
20771
20815
  name: "enable-disable",
20772
20816
  pattern: /(ENABLE|DISABLE)[_-]/i,
20773
20817
  suggestedAccess: "full" /* FULL */,
20774
- description: "Feature flag"
20818
+ description: "Feature flag",
20819
+ format: "boolean",
20820
+ example: "true | false"
20775
20821
  },
20776
20822
  {
20777
20823
  name: "feature-flag",
20778
20824
  pattern: /FEATURE[_-]/i,
20779
20825
  suggestedAccess: "full" /* FULL */,
20780
- description: "Feature flag"
20826
+ description: "Feature flag",
20827
+ format: "boolean",
20828
+ example: "true | false"
20781
20829
  },
20782
20830
  {
20783
20831
  name: "region",
20784
20832
  pattern: /_REGION$/i,
20785
20833
  suggestedAccess: "full" /* FULL */,
20786
- description: "Cloud region"
20834
+ description: "Cloud region",
20835
+ format: "string",
20836
+ example: "us-east-1"
20787
20837
  },
20788
20838
  {
20789
20839
  name: "version",
20790
20840
  pattern: /_VERSION$/i,
20791
20841
  suggestedAccess: "full" /* FULL */,
20792
- description: "Version number"
20842
+ description: "Version number",
20843
+ format: "string",
20844
+ example: "1.0.0"
20793
20845
  }
20794
20846
  ];
20795
20847
  function classifyVariable(name) {
@@ -20797,7 +20849,9 @@ function classifyVariable(name) {
20797
20849
  if (pattern.pattern.test(name)) {
20798
20850
  return {
20799
20851
  access: pattern.suggestedAccess,
20800
- description: pattern.description
20852
+ description: pattern.description,
20853
+ format: pattern.format,
20854
+ example: pattern.example
20801
20855
  };
20802
20856
  }
20803
20857
  }
@@ -21149,6 +21203,10 @@ async function configureClaudeSettings(silent = false) {
21149
21203
  } else {
21150
21204
  console.log(" Already configured");
21151
21205
  }
21206
+ console.log("");
21207
+ console.log(" Recommended next steps:");
21208
+ console.log(" → Add to .gitignore: .env.ai");
21209
+ console.log(" → Review settings: npm i -g envibe && envibe view");
21152
21210
  }
21153
21211
  return { denyAdded, allowAdded, mcpConfigured, discoveredFiles };
21154
21212
  }
@@ -21287,7 +21345,7 @@ async function startMCPServer() {
21287
21345
  },
21288
21346
  {
21289
21347
  name: "env_describe",
21290
- description: "Get detailed information about a variable including its access level and description.",
21348
+ description: "Get detailed information about a variable including its access level, description, format, and example.",
21291
21349
  inputSchema: {
21292
21350
  type: "object",
21293
21351
  properties: {
@@ -21298,6 +21356,14 @@ async function startMCPServer() {
21298
21356
  },
21299
21357
  required: ["key"]
21300
21358
  }
21359
+ },
21360
+ {
21361
+ name: "env_check_required",
21362
+ description: "Check which required environment variables are missing. Use this to help users set up their environment.",
21363
+ inputSchema: {
21364
+ type: "object",
21365
+ properties: {}
21366
+ }
21301
21367
  }
21302
21368
  ]
21303
21369
  };
@@ -21328,18 +21394,57 @@ async function startMCPServer() {
21328
21394
  }
21329
21395
  case "env_get": {
21330
21396
  const key = args.key;
21397
+ const config2 = manifest2.variables[key];
21331
21398
  const variable = getVariableForAI(key, env, manifest2);
21399
+ if (config2 && config2.access === "hidden" /* HIDDEN */) {
21400
+ return {
21401
+ content: [
21402
+ {
21403
+ type: "text",
21404
+ text: JSON.stringify({
21405
+ error: "ACCESS_DENIED",
21406
+ key,
21407
+ access: "hidden",
21408
+ message: "This variable is hidden from AI. Ask the user to configure it manually.",
21409
+ hint: config2.description
21410
+ }, null, 2)
21411
+ }
21412
+ ],
21413
+ isError: true
21414
+ };
21415
+ }
21332
21416
  if (!variable) {
21333
21417
  return {
21334
21418
  content: [
21335
21419
  {
21336
21420
  type: "text",
21337
- text: `Error: Variable "${key}" is hidden or does not exist`
21421
+ text: JSON.stringify({
21422
+ error: "NOT_FOUND",
21423
+ key,
21424
+ message: `Variable "${key}" does not exist in the manifest.`
21425
+ }, null, 2)
21338
21426
  }
21339
21427
  ],
21340
21428
  isError: true
21341
21429
  };
21342
21430
  }
21431
+ if (variable.access === "placeholder" /* PLACEHOLDER */) {
21432
+ return {
21433
+ content: [
21434
+ {
21435
+ type: "text",
21436
+ text: JSON.stringify({
21437
+ value: variable.displayValue,
21438
+ access: "placeholder",
21439
+ message: "You can reference this variable but cannot see the actual value.",
21440
+ hint: config2?.description,
21441
+ format: config2?.format,
21442
+ example: config2?.example
21443
+ }, null, 2)
21444
+ }
21445
+ ]
21446
+ };
21447
+ }
21343
21448
  return {
21344
21449
  content: [
21345
21450
  {
@@ -21381,25 +21486,50 @@ async function startMCPServer() {
21381
21486
  const key = args.key;
21382
21487
  const variable = getVariableForAI(key, env, manifest2);
21383
21488
  const config2 = manifest2.variables[key];
21384
- if (!variable) {
21489
+ if (config2 && config2.access === "hidden" /* HIDDEN */) {
21385
21490
  return {
21386
21491
  content: [
21387
21492
  {
21388
21493
  type: "text",
21389
- text: `Error: Variable "${key}" is hidden or does not exist`
21494
+ text: JSON.stringify({
21495
+ key,
21496
+ access: "hidden",
21497
+ canModify: false,
21498
+ description: config2.description,
21499
+ message: "This variable is hidden from AI. Ask the user to configure it.",
21500
+ required: config2.required ?? false,
21501
+ format: config2.format,
21502
+ example: config2.example
21503
+ }, null, 2)
21504
+ }
21505
+ ]
21506
+ };
21507
+ }
21508
+ if (!variable && !config2) {
21509
+ return {
21510
+ content: [
21511
+ {
21512
+ type: "text",
21513
+ text: JSON.stringify({
21514
+ error: "NOT_FOUND",
21515
+ key,
21516
+ message: `Variable "${key}" does not exist in the manifest.`
21517
+ }, null, 2)
21390
21518
  }
21391
21519
  ],
21392
21520
  isError: true
21393
21521
  };
21394
21522
  }
21395
21523
  const info = {
21396
- key: variable.key,
21397
- access: variable.access,
21398
- canModify: variable.canModify,
21399
- description: variable.description,
21524
+ key: variable?.key ?? key,
21525
+ access: variable?.access ?? config2?.access,
21526
+ canModify: variable?.canModify ?? false,
21527
+ description: variable?.description ?? config2?.description,
21400
21528
  required: config2?.required ?? false,
21401
21529
  hasDefault: config2?.default !== undefined,
21402
- isSet: env[key] !== undefined
21530
+ isSet: env[key] !== undefined,
21531
+ format: config2?.format,
21532
+ example: config2?.example
21403
21533
  };
21404
21534
  return {
21405
21535
  content: [
@@ -21410,6 +21540,42 @@ async function startMCPServer() {
21410
21540
  ]
21411
21541
  };
21412
21542
  }
21543
+ case "env_check_required": {
21544
+ const missing = [];
21545
+ const set2 = [];
21546
+ for (const [key, config2] of Object.entries(manifest2.variables)) {
21547
+ if (config2.required) {
21548
+ if (env[key] === undefined || env[key] === "") {
21549
+ missing.push({
21550
+ key,
21551
+ description: config2.description,
21552
+ format: config2.format,
21553
+ example: config2.example
21554
+ });
21555
+ } else {
21556
+ const variable = getVariableForAI(key, env, manifest2);
21557
+ if (variable && (variable.access === "full" /* FULL */ || variable.access === "read-only" /* READ_ONLY */)) {
21558
+ set2.push({ key, value: variable.displayValue });
21559
+ } else {
21560
+ set2.push({ key, value: "<set>" });
21561
+ }
21562
+ }
21563
+ }
21564
+ }
21565
+ const result = {
21566
+ missing,
21567
+ set: set2,
21568
+ message: missing.length > 0 ? `${missing.length} required variable(s) are not set. Ask the user to configure them.` : "All required variables are set."
21569
+ };
21570
+ return {
21571
+ content: [
21572
+ {
21573
+ type: "text",
21574
+ text: JSON.stringify(result, null, 2)
21575
+ }
21576
+ ]
21577
+ };
21578
+ }
21413
21579
  default:
21414
21580
  return {
21415
21581
  content: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envibe-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "MCP server for envibe - the missing permission layer between AI agents and your .env",
5
5
  "type": "module",
6
6
  "bin": {