@proplandev/mcp 1.0.3 → 1.0.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/init.js +33 -13
  2. package/package.json +1 -1
package/bin/init.js CHANGED
@@ -145,21 +145,41 @@ if (mode === 'local') {
145
145
  }
146
146
  print();
147
147
 
148
- // 5. allowedTools tip
148
+ // 5. allowedTools — offer to auto-write
149
+ const ALLOWED_TOOLS = [
150
+ 'mcp__project-planner__get_project_status',
151
+ 'mcp__project-planner__get_next_tasks',
152
+ 'mcp__project-planner__get_project_roadmap',
153
+ 'mcp__project-planner__get_tasks',
154
+ 'mcp__project-planner__add_session_summary',
155
+ 'mcp__project-planner__update_task_status',
156
+ 'mcp__project-planner__add_note_to_task',
157
+ ];
158
+
159
+ const claudeSettingsPath = path.join(os.homedir(), '.claude', 'settings.json');
149
160
  print(bold(' Tip — skip approval prompts for read-only tools'));
150
- print(dim(' Add this to ~/.claude/settings.json:'));
161
+ const autoWrite = (await ask(' Add these to your Claude settings automatically? [Y/n]: ')).trim().toLowerCase();
151
162
  print();
152
- print(dim(' {'));
153
- print(dim(' "allowedTools": ['));
154
- print(dim(' "mcp__project-planner__get_project_status",'));
155
- print(dim(' "mcp__project-planner__get_next_tasks",'));
156
- print(dim(' "mcp__project-planner__get_project_roadmap",'));
157
- print(dim(' "mcp__project-planner__get_tasks",'));
158
- print(dim(' "mcp__project-planner__add_session_summary",'));
159
- print(dim(' "mcp__project-planner__update_task_status",'));
160
- print(dim(' "mcp__project-planner__add_note_to_task"'));
161
- print(dim(' ]'));
162
- print(dim(' }'));
163
+
164
+ if (autoWrite !== 'n') {
165
+ try {
166
+ let settings = {};
167
+ try { settings = JSON.parse(fs.readFileSync(claudeSettingsPath, 'utf8')); } catch { /* new file */ }
168
+ const existing_tools = Array.isArray(settings.allowedTools) ? settings.allowedTools : [];
169
+ const merged = [...new Set([...existing_tools, ...ALLOWED_TOOLS])];
170
+ settings.allowedTools = merged;
171
+ fs.mkdirSync(path.dirname(claudeSettingsPath), { recursive: true });
172
+ fs.writeFileSync(claudeSettingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf8');
173
+ print(green(' ✓ Claude settings updated') + ' ' + dim(claudeSettingsPath));
174
+ } catch (err) {
175
+ print(' ' + YELLOW + '⚠ Could not write settings: ' + err.message + RESET);
176
+ print(dim(' Add manually to ~/.claude/settings.json:'));
177
+ print(dim(' "allowedTools": ' + JSON.stringify(ALLOWED_TOOLS, null, 4).replace(/\n/g, '\n ')));
178
+ }
179
+ } else {
180
+ print(dim(' To add manually, paste into ~/.claude/settings.json:'));
181
+ print(dim(' "allowedTools": ' + JSON.stringify(ALLOWED_TOOLS, null, 4).replace(/\n/g, '\n ')));
182
+ }
163
183
  print();
164
184
 
165
185
  rl.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proplandev/mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "MCP server for Claude Code — persistent project memory, session continuity, and structural repo analysis",
5
5
  "type": "module",
6
6
  "main": "index.js",