mcp-gov 1.2.2 → 1.2.4

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 (2) hide show
  1. package/bin/mcp-gov.js +35 -19
  2. package/package.json +1 -1
package/bin/mcp-gov.js CHANGED
@@ -51,9 +51,10 @@ async function main() {
51
51
  console.log(' 2) Unwrap MCP servers');
52
52
  console.log(' 3) View audit logs');
53
53
  console.log(' 4) Edit rules');
54
+ console.log(' 5) Exit');
54
55
  console.log('');
55
56
 
56
- const choice = await ask('Enter choice [1-4]: ');
57
+ const choice = await ask('Enter choice [1-5]: ');
57
58
 
58
59
  switch (choice.trim()) {
59
60
  case '1':
@@ -68,6 +69,11 @@ async function main() {
68
69
  case '4':
69
70
  await handleRules();
70
71
  break;
72
+ case '5':
73
+ console.log('\nGoodbye!');
74
+ rl.close();
75
+ process.exit(0);
76
+ break;
71
77
  default:
72
78
  console.log('Invalid choice');
73
79
  rl.close();
@@ -76,17 +82,22 @@ async function main() {
76
82
  }
77
83
 
78
84
  async function handleWrap() {
79
- const defaultPath = '~/.config/claude/config.json';
80
- const fullDefault = join(homedir(), '.config', 'claude', 'config.json');
81
- const configPath = await ask(`Enter config path [${defaultPath}]: `);
82
- const input = configPath.trim() || fullDefault;
83
- const path = input.startsWith('~') ? input.replace('~', homedir()) : input;
84
- rl.close();
85
+ const defaultPath = '~/.claude.json';
86
+ const fullDefault = join(homedir(), '.claude.json');
85
87
 
86
- if (!existsSync(path)) {
87
- console.error(`\nError: Config file not found: ${path}`);
88
- process.exit(1);
88
+ let path;
89
+ while (true) {
90
+ const configPath = await ask(`Enter config path [${defaultPath}]: `);
91
+ const input = configPath.trim() || fullDefault;
92
+ path = input.startsWith('~') ? input.replace('~', homedir()) : input;
93
+
94
+ if (existsSync(path)) {
95
+ break;
96
+ }
97
+ console.log(`\nFile not found: ${path}`);
98
+ console.log('Please try again.\n');
89
99
  }
100
+ rl.close();
90
101
 
91
102
  console.log(`\nWrapping servers...\n`);
92
103
 
@@ -100,17 +111,22 @@ async function handleWrap() {
100
111
  }
101
112
 
102
113
  async function handleUnwrap() {
103
- const defaultPath = '~/.config/claude/config.json';
104
- const fullDefault = join(homedir(), '.config', 'claude', 'config.json');
105
- const configPath = await ask(`Enter config path [${defaultPath}]: `);
106
- const input = configPath.trim() || fullDefault;
107
- const path = input.startsWith('~') ? input.replace('~', homedir()) : input;
108
- rl.close();
114
+ const defaultPath = '~/.claude.json';
115
+ const fullDefault = join(homedir(), '.claude.json');
116
+
117
+ let path;
118
+ while (true) {
119
+ const configPath = await ask(`Enter config path [${defaultPath}]: `);
120
+ const input = configPath.trim() || fullDefault;
121
+ path = input.startsWith('~') ? input.replace('~', homedir()) : input;
109
122
 
110
- if (!existsSync(path)) {
111
- console.error(`\nError: Config file not found: ${path}`);
112
- process.exit(1);
123
+ if (existsSync(path)) {
124
+ break;
125
+ }
126
+ console.log(`\nFile not found: ${path}`);
127
+ console.log('Please try again.\n');
113
128
  }
129
+ rl.close();
114
130
 
115
131
  console.log(`\nUnwrapping servers...\n`);
116
132
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-gov",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "MCP Governance System - Permission control and audit logging for Model Context Protocol servers",
5
5
  "type": "module",
6
6
  "main": "src/index.js",