@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.
- package/bin/init.js +33 -13
- 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
|
|
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
|
-
|
|
161
|
+
const autoWrite = (await ask(' Add these to your Claude settings automatically? [Y/n]: ')).trim().toLowerCase();
|
|
151
162
|
print();
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
print(
|
|
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